mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
Fixed broken tests and compilation
Rollbacked some of Breandan's changes
This commit is contained in:
parent
189fa4c03b
commit
b31ca385c9
@ -1,6 +1,7 @@
|
|||||||
package testPlugin;
|
package testPlugin;
|
||||||
|
|
||||||
import com.intellij.codeInsight.intention.IntentionAction;
|
import com.intellij.codeInsight.intention.IntentionAction;
|
||||||
|
import com.intellij.testFramework.UsefulTestCase;
|
||||||
import com.intellij.testFramework.builders.JavaModuleFixtureBuilder;
|
import com.intellij.testFramework.builders.JavaModuleFixtureBuilder;
|
||||||
import com.intellij.testFramework.fixtures.*;
|
import com.intellij.testFramework.fixtures.*;
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
@ -14,7 +15,7 @@ import org.junit.*;
|
|||||||
* To change this template use File | Settings | File Templates.
|
* To change this template use File | Settings | File Templates.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class YourTest {
|
public class YourTest extends UsefulTestCase {
|
||||||
protected CodeInsightTestFixture myFixture;
|
protected CodeInsightTestFixture myFixture;
|
||||||
// Specify path to your test data
|
// Specify path to your test data
|
||||||
// e.g. final String dataPath = "c:\\users\\john
|
// e.g. final String dataPath = "c:\\users\\john
|
||||||
@ -26,7 +27,7 @@ public class YourTest {
|
|||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
|
||||||
final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
|
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 = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
|
||||||
myFixture.setTestDataPath(dataPath);
|
myFixture.setTestDataPath(dataPath);
|
||||||
final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);
|
final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);
|
||||||
|
@ -1,35 +1,11 @@
|
|||||||
public class Test {
|
public class Test {
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)<fold text=' { '> {
|
||||||
|
|
||||||
<fold text=' { '>
|
|
||||||
|
|
||||||
{
|
|
||||||
</fold>System.out.println("<fold text='http://en.wikipedia.org/'>simple:website</fold>");<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>
|
</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 main1(String[] args)
|
public static void main2(String[] args)<fold text=' { '> {
|
||||||
|
</fold>System.out.println("<fold text='Welcome to \n Wikipedia!'>simple:message</fold>");<fold text=' }'>
|
||||||
<fold text=' { '>
|
}</fold>
|
||||||
|
|
||||||
{
|
|
||||||
</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>
|
|
||||||
}
|
}
|
||||||
|
@ -3,19 +3,20 @@ package com.simpleplugin;
|
|||||||
import com.intellij.codeInsight.completion.CompletionType;
|
import com.intellij.codeInsight.completion.CompletionType;
|
||||||
import com.intellij.codeInsight.generation.actions.CommentByLineCommentAction;
|
import com.intellij.codeInsight.generation.actions.CommentByLineCommentAction;
|
||||||
import com.intellij.openapi.command.WriteCommandAction;
|
import com.intellij.openapi.command.WriteCommandAction;
|
||||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
|
|
||||||
import com.intellij.psi.PsiElement;
|
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.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||||
import com.intellij.usageView.UsageInfo;
|
import com.intellij.usageView.UsageInfo;
|
||||||
import com.simpleplugin.psi.SimpleProperty;
|
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 {
|
public class SimpleCodeInsightTest extends LightCodeInsightFixtureTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
VfsRootAccess.SHOULD_PERFORM_ACCESS_CHECK = false; // TODO: a workaround for v15
|
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ public class SimpleCodeInsightTest extends LightCodeInsightFixtureTestCase {
|
|||||||
|
|
||||||
public void testAnnotator() {
|
public void testAnnotator() {
|
||||||
myFixture.configureByFiles("AnnotatorTestData.java", "DefaultTestData.simple");
|
myFixture.configureByFiles("AnnotatorTestData.java", "DefaultTestData.simple");
|
||||||
myFixture.checkHighlighting(false, false, true);
|
myFixture.checkHighlighting(false, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFormatter() {
|
public void testFormatter() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user