public void test_StaticImport2() throws Exception { //GROOVY-3711: The following call now results in a valid script class node, so foo.Bar needs to get resolved. GroovyShell groovyShell = new GroovyShell(); compile("package foo; class Bar{}", groovyShell); assertNotNull(compile("import static foo.Bar.*", groovyShell)); }
public void test_StaticImport1() throws Exception { //GROOVY-3711: The following call now results in a valid script class node, so foo.Bar needs to get resolved. GroovyShell groovyShell = new GroovyShell(); compile("package foo; class Bar{}", groovyShell); assertNotNull(compile("import static foo.Bar.mooky", groovyShell)); }
public void test_EnumDef4_FAILS() throws Exception { if (notYetImplemented()) return; // Unknown type: ENUM_DEF assertNotNull(compile("enum EarthSeason implements Season{SPRING}")); // fails after parser }
public void test_NativeMethods2_FAILS() throws Exception { if (notYetImplemented()) return; // You defined a method without body. Try adding a body, or declare it abstract assertNotNull(compile("native foo()")); // fails after parser }
public void test_SpreadExpressionInGString1_FAILS() throws Exception { if (notYetImplemented()) return; // BUG! exception in phase 'conversion' in source unit 'Script1.groovy' null assertNotNull(compile("\"foo$*bar\"")); // fails after parser }
public void test_ClassicJavaForLoop1_FAILS() throws Exception { if (notYetImplemented()) return; // For statement contains unexpected tokens. Possible attempt to use unsupported Java-style for loop. // This syntax now replaced with closure list i.e. for (i=0;j=2;i<10;i++;j--) {... assertNotNull(compile("for (i = 0,j = 2;i < 10; i++, j--) {print i}")); // fails after parser }
public void test_ContinueWithValueAllowedInLoops_FAILS() throws Exception { if (notYetImplemented()) return; // Unexpected node type: a numeric literal found when expecting type: an identifier assertNotNull(compile("for (i in 1..100) {continue 2}")); // fails after parser }
public void test_Threadsafe2_FAILS() throws Exception { if (notYetImplemented()) return; // Unknown type: "threadsafe" assertNotNull(compile("public static transient final native threadsafe synchronized volatile strictfp foo() {}")); // fails after parser }
public void test_SpreadExpressionInGString2_FAILS() throws Exception { if (notYetImplemented()) return; // BUG! exception in phase 'class generation' in source unit 'Script1.groovy' // SpreadExpression should not be visited here assertNotNull(compile("\"foo${*bar}\"")); // fails after parser }
public void test_AnnotationDef1_FAILS() throws Exception { if (notYetImplemented()) return; // Unknown type: ANNOTATION_DEF assertNotNull(compile("public @interface Foo{}")); }
public void test_AnnotationDef2_FAILS() throws Exception { if (notYetImplemented()) return; // Unknown type: ANNOTATION_DEF assertNotNull(compile("public @interface Foo{int bar() default 123}")); }
public void test_BreakAllowedInMethods_FAILS() throws Exception { if (notYetImplemented()) return; // the break statement is only allowed inside loops or switches assertNotNull(compile("def myMethod(){break}")); // fails after parser }
public void test_BreakToLabeledStatementAllowedInLoops_FAILS() throws Exception { if (notYetImplemented()) return; // Unexpected node type: LABELED_STAT found when expecting type: an identifier assertNotNull(compile("for (i in 1..100) {break label1:}")); // fails after parser }
public void test_Threadsafe1_FAILS() throws Exception { if (notYetImplemented()) return; // Unknown type: "threadsafe" assertNotNull(compile("threadsafe foo() {}")); // fails after parser }
public void test_QualifiedExceptionTypes_FAILS() throws Exception { if (notYetImplemented()) return; // Unexpected node type: '.' found when expecting type: an identifier assertNotNull(compile("def foo() throws bar.MookyException{}")); // fails after parser }
public void test_EnumDef3_FAILS() throws Exception { if (notYetImplemented()) return; // Unknown type: ENUM_DEF assertNotNull(compile("enum Operation {ADDITION {double eval(x,y) {return x + y}}}")); // fails after parser }
public void test_ContinueToLabeledStatementAllowedInLoops_FAILS() throws Exception { if (notYetImplemented()) return; // Unexpected node type: LABELED_STAT found when expecting type: an identifier assertNotNull(compile("for (i in 1..100) {continue label1:}")); // fails after parser }
public void test_SpreadExpressionInClosure_FAILS() throws Exception { if (notYetImplemented()) return; // BUG! exception in phase 'class generation' in source unit 'Script1.groovy' // SpreadExpression should not be visited here assertNotNull(compile("myList{*name}")); // fails after parser }
public void test_TypeParameters_FAILS() throws Exception { if (notYetImplemented()) return; // Unexpected node type: TYPE_PARAMETERS found when expecting type: OBJBLOCK assertNotNull(compile("class Foo<T extends C & I> {T t}")); // fails after parser }
public void test_NativeMethods1_FAILS() throws Exception { if (notYetImplemented()) return; // You defined a method without body. Try adding a body, or declare it abstract assertNotNull(compile("public class R{public native void seek(long pos)}")); // fails after parser }