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:47:44 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/master 968dd6ce9 -> b9dafc721


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/b9dafc72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/b9dafc72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/b9dafc72

Branch: refs/heads/master
Commit: b9dafc721d09e5d4429b93eb1e26c7d6170b5a65
Parents: 968dd6c
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:47:37 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/b9dafc72/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/b9dafc72/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 9b5278b..39a818a 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