1 46 47 package org.codehaus.groovy.classgen; 48 49 import groovy.lang.GroovyObject; 50 51 import org.codehaus.groovy.classgen.TestSupport; 52 53 57 public class RunClosureTest extends TestSupport { 58 59 public void testClosure() throws Exception { 60 GroovyObject object = compile("src/test/groovy/ClosureUsingOuterVariablesTest.groovy"); 61 object.invokeMethod("testExampleUseOfClosureScopesUsingEach", null); 62 } 63 64 public void testStaticClosureBug() throws Exception { 65 GroovyObject object = compile("src/test/groovy/bugs/StaticClosurePropertyBug.groovy"); 66 object.invokeMethod("testCallStaticClosure", null); 67 } 68 69 public void testZoharsBug() throws Exception { 70 GroovyObject object = compile("src/test/groovy/bugs/ZoharsBug.groovy"); 71 object.invokeMethod("testBug", null); 72 } 73 74 public void testBytecodeBug() throws Exception { 75 GroovyObject object = compile("src/test/groovy/bugs/BytecodeBug.groovy"); 76 object.invokeMethod("testTedsBytecodeBug", null); 77 } 78 79 public void testBytecode2Bug() throws Exception { 80 GroovyObject object = compile("src/test/groovy/bugs/Bytecode2Bug.groovy"); 81 object.invokeMethod("testTedsBytecodeBug", null); 82 } 83 84 public void testBytecode3Bug() throws Exception { 85 GroovyObject object = compile("src/test/groovy/bugs/Bytecode3Bug.groovy"); 86 object.invokeMethod("testIncrementPropertyInclosure", null); 88 } 89 90 public void testBytecode4Bug() throws Exception { 91 GroovyObject object = compile("src/test/groovy/bugs/Bytecode4Bug.groovy"); 92 object.invokeMethod("testInject", null); 93 object.invokeMethod("testUsingProperty", null); 94 } 95 96 public void testBytecode5Bug() throws Exception { 97 GroovyObject object = compile("src/test/groovy/bugs/Bytecode5Bug.groovy"); 98 object.invokeMethod("testUsingLocalVar", null); 99 } 100 101 public void testBytecode6Bug() throws Exception { 102 GroovyObject object = compile("src/test/groovy/bugs/Bytecode6Bug.groovy"); 103 object.invokeMethod("testPreFixReturn", null); 104 } 105 106 public void testPropertyTest() throws Exception { 107 GroovyObject object = compile("src/test/groovy/PropertyTest.groovy"); 108 object.invokeMethod("testNormalPropertyGettersAndSetters", null); 109 } 110 111 } 112 | Popular Tags |