groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject incubator-groovy git commit: GROOVY-6908: Groovy Ant task should inherit Ant properties when in "forked" mode (prep work - test case for non-fork mode)
Date Thu, 04 Jun 2015 07:49:47 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X b01cba823 -> 8429018ad


GROOVY-6908: Groovy Ant task should inherit Ant properties when in "forked" mode (prep work
- test case for non-fork mode)


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/8429018a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/8429018a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/8429018a

Branch: refs/heads/GROOVY_2_4_X
Commit: 8429018ad013a4dad7431f2440250f20e3d221a1
Parents: b01cba8
Author: Paul King <paulk@asert.com.au>
Authored: Thu Jun 4 17:47:37 2015 +1000
Committer: Paul King <paulk@asert.com.au>
Committed: Thu Jun 4 17:49:35 2015 +1000

----------------------------------------------------------------------
 .../src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml | 7 +++++++
 .../src/test/groovy/org/codehaus/groovy/ant/GroovyTest.java   | 7 +++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/8429018a/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml
----------------------------------------------------------------------
diff --git a/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml
b/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml
index 867155b..1efbb19 100644
--- a/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml
+++ b/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml
@@ -28,6 +28,13 @@
         </groovy>
     </target>
 
+    <target name="groovyAntPropertyWithoutFork" depends="defineTask">
+        <property name="someProp" value="someValue"/>
+        <groovy>
+            org.codehaus.groovy.ant.GroovyTest.FLAG = "someProp was " + project.properties.someProp
+        </groovy>
+    </target>
+
     <target name="groovyCodeInExternalFile" depends="defineTask">
         <groovy src="GroovyTest1.groovy"/>
     </target>

http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/8429018a/subprojects/groovy-ant/src/test/groovy/org/codehaus/groovy/ant/GroovyTest.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-ant/src/test/groovy/org/codehaus/groovy/ant/GroovyTest.java
b/subprojects/groovy-ant/src/test/groovy/org/codehaus/groovy/ant/GroovyTest.java
index 8c7dfca..ce182dd 100644
--- a/subprojects/groovy-ant/src/test/groovy/org/codehaus/groovy/ant/GroovyTest.java
+++ b/subprojects/groovy-ant/src/test/groovy/org/codehaus/groovy/ant/GroovyTest.java
@@ -51,6 +51,7 @@ public class GroovyTest extends GroovyTestCase {
         suite.addTest(new GroovyTest("testGroovyCodeWithinTag"));
         suite.addTest(new GroovyTest("testGroovyCodeExternalFile"));
         suite.addTest(new GroovyTest("testGroovyCodeInExternalFileWithOtherClass"));
+        suite.addTest(new GroovyTest("testPropertiesWithoutFork"));
         suite.addTest(new GroovyTest("testClasspath_missing"));
         suite.addTest(new GroovyTest("testClasspath_classpathAttribute"));
         suite.addTest(new GroovyTest("testClasspath_classpathrefAttribute"));
@@ -84,6 +85,12 @@ public class GroovyTest extends GroovyTestCase {
         assertEquals("from groovy file called from ant", FLAG);
     }
 
+    public void testPropertiesWithoutFork() {
+        assertNull(FLAG);
+        project.executeTarget("groovyAntPropertyWithoutFork");
+        assertEquals("someProp was someValue", FLAG);
+    }
+
     public void testGroovyCodeInExternalFileWithOtherClass() {
         assertNull(FLAG);
         project.executeTarget("groovyCodeInExternalFileWithOtherClass");


Mime
View raw message