geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r575104 - /geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy
Date Wed, 12 Sep 2007 22:23:20 GMT
Author: jdillon
Date: Wed Sep 12 15:23:19 2007
New Revision: 575104

URL: http://svn.apache.org/viewvc?rev=575104&view=rev
Log:
Attempt to validate in a platform neutral fashion

Modified:
    geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy?rev=575104&r1=575103&r2=575104&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/j2ee-system/validate.groovy
Wed Sep 12 15:23:19 2007
@@ -17,12 +17,28 @@
  * under the License.
  */
 
-def expected1 = new File(basedir, "src/test/resources/META-INF/geronimo-plugin.xml").text
-def found1 = new File(basedir, "target/resources/META-INF/geronimo-plugin.xml").text
+def loadText = { filename ->
+    def file = new File(basedir, "$filename")
+    
+    def tmp = File.createTempFile('validate', null)
+    tmp.deleteOnExit()
+    
+    ant.copy(file: file, tofile: tmp)
+    ant.fixcrlf(eol: 'unix', file: tmp)
+    
+    def text = tmp.text
+    tmp.delete()
+    
+    return text
+}
 
-assert expected1 == found1
+def assertSame = { file1, file2 ->
+    def expect = loadText(file1)
+    def found = loadText(file2)
+    
+    assert expect == found
+}
 
-def expected2 = new File(basedir, "src/test/resources/META-INF/plan.xml").text
-def found2 = new File(basedir, "target/resources/META-INF/plan.xml").text
+assertSame('src/test/resources/META-INF/geronimo-plugin.xml', 'target/resources/META-INF/geronimo-plugin.xml')
 
-assert expected2 == found2
\ No newline at end of file
+assertSame('src/test/resources/META-INF/plan.xml', 'target/resources/META-INF/plan.xml')



Mime
View raw message