db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1522011 - /db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PropertyToJavaGenerationTest.java
Date Wed, 11 Sep 2013 19:57:00 GMT
Author: tfischer
Date: Wed Sep 11 19:56:59 2013
New Revision: 1522011

URL: http://svn.apache.org/r1522011
Log:
Fix test for ubuntu where file modification timestamp is only second accuracy,
so checking for second generation run via modification timestamp does not work

Modified:
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PropertyToJavaGenerationTest.java

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PropertyToJavaGenerationTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PropertyToJavaGenerationTest.java?rev=1522011&r1=1522010&r2=1522011&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PropertyToJavaGenerationTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PropertyToJavaGenerationTest.java
Wed Sep 11 19:56:59 2013
@@ -177,12 +177,14 @@ public class PropertyToJavaGenerationTes
         assertTrue(propertiesResultFile.exists());
         long firstLastModified = propertiesResultFile.lastModified();
 
+        // delete target so we can see if generation does not run again
+        assertTrue(propertiesResultFile.delete());
+
         // execute
         controller.run(unitDescriptors);
 
         // verify
-        assertTrue(propertiesResultFile.exists());
-        assertEquals(firstLastModified, propertiesResultFile.lastModified());
+        assertFalse(propertiesResultFile.exists());
     }
 
     /**
@@ -225,7 +227,6 @@ public class PropertyToJavaGenerationTes
         File propertiesResultFile
             = new File(targetDir, "Properties.properties");
         assertTrue(propertiesResultFile.exists());
-        long firstLastModified = propertiesResultFile.lastModified();
 
         // change checksum file
         File checksumFile = new File(
@@ -235,12 +236,14 @@ public class PropertyToJavaGenerationTes
         FileUtils.writeStringToFile(checksumFile, "abc", "ISO-8859-1");
         assertTrue(checksumFile.setLastModified(checksumFileLastModified));
 
+        // delete target so we can see if generation runs again
+        assertTrue(propertiesResultFile.delete());
+
         // execute
         controller.run(unitDescriptors);
 
         // verify
         assertTrue(propertiesResultFile.exists());
-        assertFalse(firstLastModified == propertiesResultFile.lastModified());
     }
 
     /**
@@ -283,7 +286,6 @@ public class PropertyToJavaGenerationTes
         File propertiesResultFile
             = new File(targetDir, "Properties.properties");
         assertTrue(propertiesResultFile.exists());
-        long firstLastModified = propertiesResultFile.lastModified();
 
         // change modification date of source file
         File sourceFile = new File(
@@ -292,11 +294,13 @@ public class PropertyToJavaGenerationTes
         assertTrue(sourceFile.setLastModified(
                 System.currentTimeMillis() + 1000L));
 
+        // delete target so we can see if generation runs again
+        assertTrue(propertiesResultFile.delete());
+
         // execute
         controller.run(unitDescriptors);
 
         // verify
         assertTrue(propertiesResultFile.exists());
-        assertFalse(firstLastModified == propertiesResultFile.lastModified());
     }
 }



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


Mime
View raw message