ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r722972 - in /ant/core/trunk/src: main/org/apache/tools/ant/taskdefs/DependSet.java tests/antunit/taskdefs/dependset-test.xml
Date Wed, 03 Dec 2008 17:04:24 GMT
Author: bodewig
Date: Wed Dec  3 09:04:24 2008
New Revision: 722972

URL: http://svn.apache.org/viewvc?rev=722972&view=rev
Log:
Add a verbose attribute to dependset.  PR 13681

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/DependSet.java
    ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/DependSet.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/DependSet.java?rev=722972&r1=722971&r2=722972&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/DependSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/DependSet.java Wed Dec  3 09:04:24
2008
@@ -291,7 +291,8 @@
         if (verbose) {
             for (Iterator i = missing.iterator(); i.hasNext(); ) {
                 Resource r = (Resource) i.next();
-                log("Expected " + what + " " + r.toLongString() + " is missing.");
+                log("Expected " + what + " " + r.toLongString()
+                    + " is missing.");
             }
         }
     }

Modified: ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml?rev=722972&r1=722971&r2=722972&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/dependset-test.xml Wed Dec  3 09:04:24 2008
@@ -66,12 +66,31 @@
       <srcfilelist dir="${input}" files="newer.tmp" />
       <targetfilelist dir="${output}" files="older.tmp" />
     </dependset>
-    <!--au:assertLogContains text="older.tmp&quot; is oldest target file"
-                          level="verbose"/-->
+    <au:assertLogContains text="older.tmp&quot; is oldest target file"
+                          level="verbose"/>
     <au:assertLogContains text="newer.tmp&quot; is newest source"
                           level="verbose"/>
     <au:assertLogContains text="Deleting all target files."
                           level="verbose"/>
+    <au:assertLogDoesntContain text="Deleting" level="info"/>
+    <au:assertFileDoesntExist file="${output}/older.tmp"/>
+  </target>
+
+  <target name="testMoreRecentSourceFileVerbose" depends="setUp">
+    <touch file="${output}/older.tmp" />
+    <sleep seconds="3" />
+    <touch file="${input}/newer.tmp" />
+    <dependset verbose="true">
+      <srcfilelist dir="${input}" files="newer.tmp" />
+      <targetfilelist dir="${output}" files="older.tmp" />
+    </dependset>
+    <au:assertLogContains text="older.tmp&quot; is oldest target file"
+                          level="info"/>
+    <au:assertLogContains text="newer.tmp&quot; is newest source"
+                          level="info"/>
+    <au:assertLogContains text="Deleting all target files."
+                          level="verbose"/>
+    <au:assertLogContains text="Deleting" level="info"/>
     <au:assertFileDoesntExist file="${output}/older.tmp"/>
   </target>
 
@@ -90,12 +109,39 @@
         <filelist dir="${output}/" files="targetset_1.tmp,targetset_2.tmp" />
       </targets>
     </dependset>
-    <!--au:assertLogContains text="targetset_1&quot; is oldest target file"
-                          level="verbose"/-->
+    <au:assertLogContains text="targetset_1.tmp&quot; is oldest target file"
+                          level="verbose"/>
     <au:assertLogContains text="sourceset_2.tmp&quot; is newest source"
                           level="verbose"/>
     <au:assertLogContains text="Deleting all target files."
                           level="verbose"/>
+    <au:assertLogDoesntContain text="Deleting" level="info"/>
+    <au:assertFileDoesntExist file="${output}/targetset_1.tmp" />
+    <au:assertFileDoesntExist file="${output}/targetset_2.tmp" />
+  </target>
+
+  <target name="testMultipleFilesVerbose" depends="setUp">
+    <touch file="${input}/sourceset_1.tmp" />
+    <touch file="${output}/targetset_1.tmp" />
+    <sleep seconds="3" />
+    <touch file="${input}/sourceset_2.tmp" />
+    <touch file="${output}/targetset_2.tmp" />
+    <sleep seconds="2" />	
+    <dependset verbose="true">
+      <sources>
+        <filelist dir="${input}" files="sourceset_1.tmp,sourceset_2.tmp" />
+      </sources>
+      <targets>
+        <filelist dir="${output}/" files="targetset_1.tmp,targetset_2.tmp" />
+      </targets>
+    </dependset>
+    <au:assertLogContains text="targetset_1.tmp&quot; is oldest target file"
+                          level="info"/>
+    <au:assertLogContains text="sourceset_2.tmp&quot; is newest source"
+                          level="info"/>
+    <au:assertLogContains text="Deleting all target files."
+                          level="verbose"/>
+    <au:assertLogContains text="Deleting" level="info"/>
     <au:assertFileDoesntExist file="${output}/targetset_1.tmp" />
     <au:assertFileDoesntExist file="${output}/targetset_2.tmp" />
   </target>
@@ -114,6 +160,31 @@
                           level="verbose"/>
     <au:assertLogContains text="Deleting all target files."
                           level="verbose"/>
+    <au:assertLogDoesntContain text="Deleting" level="info"/>
+    <au:assertLogDoesntContain
+       text="Expected source propertyresource &quot;null&quot; is missing."
+       level="info"/>
+    <au:assertFileDoesntExist file="${output}/older.tmp" />
+  </target>
+
+  <target name="testMissingSourceResourceVerbose" depends="setUp">
+    <touch file="${output}/older.tmp" />
+    <dependset verbose="true">
+      <sources>
+        <propertyresource name="thereisnosuchproperty" />
+      </sources>
+      <targets>
+        <filelist dir="${output}" files="older.tmp" />
+      </targets>
+    </dependset>
+    <au:assertLogContains text="1 nonexistent sources"
+                          level="verbose"/>
+    <au:assertLogContains text="Deleting all target files."
+                          level="verbose"/>
+    <au:assertLogContains text="Deleting" level="info"/>
+    <au:assertLogContains
+       text="Expected source propertyresource &quot;null&quot; is missing."
+       level="info"/>
     <au:assertFileDoesntExist file="${output}/older.tmp" />
   </target>
 



Mime
View raw message