ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r540066 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/LoadResource.java tests/antunit/taskdefs/loadresource-test.xml
Date Mon, 21 May 2007 08:48:16 GMT
Author: jhm
Date: Mon May 21 01:48:15 2007
New Revision: 540066

URL: http://svn.apache.org/viewvc?view=rev&rev=540066
Log:
Bug 42319: log-statement if resource.size is 0 and therefore the property is not set.

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/loadresource-test.xml
Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/LoadResource.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/LoadResource.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/LoadResource.java?view=diff&rev=540066&r1=540065&r2=540066
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/LoadResource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/LoadResource.java Mon May 21 01:48:15
2007
@@ -178,6 +178,8 @@
                 instream = crh.getAssembledReader();
 
                 text = crh.readFully(instream);
+            } else {
+                log("Do not set property " + property + " as its length is 0.");
             }
 
             if (text != null) {

Added: ant/core/trunk/src/tests/antunit/taskdefs/loadresource-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/loadresource-test.xml?view=auto&rev=540066
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/loadresource-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/loadresource-test.xml Mon May 21 01:48:15 2007
@@ -0,0 +1,24 @@
+<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
+
+  <import file="../antunit-base.xml" />
+
+  <target name="test-resourceString">
+    <loadresource property="p">
+      <string value="one"/>
+    </loadresource >
+    <au:assertPropertyEquals name="p" value="one"/>
+  </target>
+
+  <target name="test-resourceSizeZero" description="Bug 42319">
+    <loadresource property="p">
+      <string value=""/>
+    </loadresource >
+    <au:assertTrue>
+      <not>
+        <isset property="p"/>
+      </not>
+    </au:assertTrue>
+    <au:assertLogContains text="Do not set property p as its length is 0."/>
+  </target>
+
+</project>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message