harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r489625 - /harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java
Date Fri, 22 Dec 2006 11:29:09 GMT
Author: smishura
Date: Fri Dec 22 03:29:08 2006
New Revision: 489625

URL: http://svn.apache.org/viewvc?view=rev&rev=489625
Log:
Fix for golden files generation mode

Modified:
    harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java

Modified: harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java?view=diff&rev=489625&r1=489624&r2=489625
==============================================================================
--- harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java
(original)
+++ harmony/enhanced/classlib/trunk/support/src/test/java/org/apache/harmony/testframework/serialization/SerializationTest.java
Fri Dec 22 03:29:08 2006
@@ -85,7 +85,7 @@
     public static final String GOLDEN_PATH = "RESOURCE_DIR";
 
     private static final String outputPath = System.getProperty(GOLDEN_PATH,
-                                                          "test/common/unit");
+            "src/test/resources/serialization");
 
     /**
      * Parameterized c-tor inherited from superclass.
@@ -172,12 +172,19 @@
      * @throws IOException
      */
     protected void produceGoldenFiles() throws IOException {
+
+        String goldenPath = outputPath + File.separatorChar
+                + getClass().getName().replace('.', File.separatorChar)
+                + ".golden.";
+
         Object[] data = getData();
         for (int i = 0; i < data.length; i++) {
-            File gf = getDataFile(i);
-            gf.getParentFile().mkdirs();
-            gf.createNewFile();
-            putObjectToStream(data[i], new FileOutputStream(gf));
+
+            File goldenFile = new File(goldenPath + i + ".ser");
+            goldenFile.getParentFile().mkdirs();
+            goldenFile.createNewFile();
+
+            putObjectToStream(data[i], new FileOutputStream(goldenFile));
         }
     }
 



Mime
View raw message