Fixed broken tests and compilation

Rollbacked some of Breandan's changes
This commit is contained in:
cheptsov 2016-11-02 14:41:48 +01:00
parent 189fa4c03b
commit b31ca385c9
4 changed files with 19 additions and 41 deletions

View File

@ -1,6 +1,7 @@
package testPlugin;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.builders.JavaModuleFixtureBuilder;
import com.intellij.testFramework.fixtures.*;
import junit.framework.Assert;
@ -14,7 +15,7 @@ import org.junit.*;
* To change this template use File | Settings | File Templates.
*/
public class YourTest {
public class YourTest extends UsefulTestCase {
protected CodeInsightTestFixture myFixture;
// Specify path to your test data
// e.g. final String dataPath = "c:\\users\\john
@ -26,7 +27,7 @@ public class YourTest {
public void setUp() throws Exception {
final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder();
final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getName());
myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
myFixture.setTestDataPath(dataPath);
final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);

View File

@ -2,6 +2,6 @@ public class Test {
public static void main(String[] args) {
System.out.println("simple:website");
System.out.println("simple:key with spaces");
System.out.println("simple:<error descr="Unresolved property">websit" < / error >);
System.out.println("simple:<error descr="Unresolved property">websit"</error>);
}
}

View File

@ -1,35 +1,11 @@
public class Test {
public static void main(String[] args)
<fold text=' { '>
{
</fold > System.out.println("<fold text='http://en.wikipedia.org/'>simple:website</fold>");<fold text = ' }' >
}
</fold>
public static void main1(String[] args)
<fold text=' { '>
{
</fold > System.out.println(
"<fold text='This is the value that could be looked up with the key \"key with spaces\".'>simple:key with " +
"spaces</fold>");<
fold text = ' }' >
}
</fold>
public static void main2(String[] args)
<fold text=' { '>
{
</fold > System.out.println("<fold text='Welcome to \n Wikipedia!'>simple:message</fold>");<
fold text = ' }' >
}
</fold>
public static void main(String[] args)<fold text=' { '> {
</fold>System.out.println("<fold text='http://en.wikipedia.org/'>simple:website</fold>");<fold text=' }'>
}</fold>
public static void main1(String[] args)<fold text=' { '> {
</fold>System.out.println("<fold text='This is the value that could be looked up with the key \"key with spaces\".'>simple:key with spaces</fold>");<fold text=' }'>
}</fold>
public static void main2(String[] args)<fold text=' { '> {
</fold>System.out.println("<fold text='Welcome to \n Wikipedia!'>simple:message</fold>");<fold text=' }'>
}</fold>
}

View File

@ -3,19 +3,20 @@ package com.simpleplugin;
import com.intellij.codeInsight.completion.CompletionType;
import com.intellij.codeInsight.generation.actions.CommentByLineCommentAction;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
import com.intellij.psi.PsiElement;
import com.intellij.psi.codeStyle.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import com.intellij.usageView.UsageInfo;
import com.simpleplugin.psi.SimpleProperty;
import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class SimpleCodeInsightTest extends LightCodeInsightFixtureTestCase {
@Override
protected void setUp() throws Exception {
VfsRootAccess.SHOULD_PERFORM_ACCESS_CHECK = false; // TODO: a workaround for v15
super.setUp();
}
@ -34,7 +35,7 @@ public class SimpleCodeInsightTest extends LightCodeInsightFixtureTestCase {
public void testAnnotator() {
myFixture.configureByFiles("AnnotatorTestData.java", "DefaultTestData.simple");
myFixture.checkHighlighting(false, false, true);
myFixture.checkHighlighting(false, false, true, true);
}
public void testFormatter() {