From 2a063c19d422b99424a652e78f08d8f8b01c7a51 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 1 Jul 2015 21:03:30 +0300 Subject: [PATCH] Cleanup (formatting) --- .../parser/partial/DeclarationParserTest.java | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java b/java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java index 960417707dda..4f0ecb3d6e7a 100644 --- a/java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java +++ b/java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java @@ -34,19 +34,12 @@ public class DeclarationParserTest extends JavaParsingTestCase { public void testPines() { doParserTest("{ class A> extends List> { } }"); } public void testIncompleteAnnotation() { doParserTest("{ public class Foo { public void testSomething(); @Null } }"); } public void testClassInit() { doParserTest("{ { /*comment*/ } }"); } - public void testAnnoDeclaration() { doParserTest("{ public @interface Annotation {} }"); } - public void testEnumSmartTypeCompletion() { doParserTest("{ @Preliminary(A.B\n#) public class TimeTravel {}\n" + - " @Preliminary(a=A.B\n#) public class TimeTravel {}\n" + - " @Preliminary(a=A.B\n#, b=c) public class TimeTravel {} }"); } - public void testTypeAnno() { - doParserTest("{ class C<@D T extends @F Object> extends @F Object {\n" + - " @F int @F[] method() throws @F Exception {\n" + - " a = this instanceof @F C;\n" + - " C<@F @G C> c = new @Q C<@F C>();\n" + - " c = (@F Object)c;\n" + - " Class c = @TA String.class;\n" + - " @F C.field++;\n" + - " }\n} }"); + + public void testEnumSmartTypeCompletion() { + doParserTest( + "{ @Preliminary(A.B\n#) public class TimeTravel {}\n" + + " @Preliminary(a=A.B\n#) public class TimeTravel {}\n" + + " @Preliminary(a=A.B\n#, b=c) public class TimeTravel {} }"); } public void testEnumBody0() { doParserTest("{ ; }", false, true); } @@ -59,6 +52,7 @@ public class DeclarationParserTest extends JavaParsingTestCase { public void testEnumWithInitializedConstants() { doParserTest("{ A(10) { },\n B { void method() {} } }", false, true); } public void testEnumWithoutConstants() { doParserTest("{ private A }", false, true); } + public void testAnnoDeclaration() { doParserTest("{ public @interface Annotation {} }"); } public void testAnnoSimple() { doParserTest("{ int foo (); }", true, false); } public void testAnnoDefault() { doParserTest("{ Class foo() default String.class; }", true, false); } public void testAnnoNested() { doParserTest("{ @interface Inner { String bar () default \"\"; } }", true, false); } @@ -66,6 +60,18 @@ public class DeclarationParserTest extends JavaParsingTestCase { public void testAnnoOtherMembers() { doParserTest("{ int field;\n void m() {}\n class C {}\n interface I {} }", true, false); } public void testAnnoLoop() { doParserTest("{ @@@ int i; }"); } + public void testTypeAnno() { + doParserTest( + "{ class C<@D T extends @F Object> extends @F Object {\n" + + " @F int @F[] method() throws @F Exception {\n" + + " a = this instanceof @F C;\n" + + " C<@F @G C> c = new @Q C<@F C>();\n" + + " c = (@F Object)c;\n" + + " Class c = @TA String.class;\n" + + " @F C.field++;\n" + + " }\n} }"); + } + public void testFieldSimple() { doParserTest("{ int field = 0; }"); } public void testFieldMulti() { doParserTest("{ int field1 = 0, field2; }"); } public void testUnclosedBracket() { doParserTest("{ int field[ }"); } @@ -94,9 +100,13 @@ public class DeclarationParserTest extends JavaParsingTestCase { public void testConstructorBrackets() { doParserTest("{ A() [] { } }"); } public void testVarArgBrackets() { doParserTest("{ void foo(int... x[]); }"); } - public void testGenericMethod() { doParserTest("{ public static test();\n" + - " void test1();\n" + - " String test2(); }"); } + public void testGenericMethod() { + doParserTest( + "{ public static test();\n" + + " void test1();\n" + + " String test2(); }"); + } + public void testGenericMethodErrors() { doParserTest("{ test (); }"); } public void testErrors() { doParserTest("{ public static protected int f1 = 0; }"); } public void testCompletionHack0() { doParserTest("{ \n String s = \"\"; }"); }