cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r588613 - /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
Date Fri, 26 Oct 2007 11:51:53 GMT
Author: aadamchik
Date: Fri Oct 26 04:51:53 2007
New Revision: 588613

URL: http://svn.apache.org/viewvc?rev=588613&view=rev
Log:
CAY-879 Storing lifecycle listebers and callbacks in the *.map.xml and loading them back
(fixing test output location)

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java?rev=588613&r1=588612&r2=588613&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/test/java/org/apache/cayenne/map/MapLoaderLoadTest.java
Fri Oct 26 04:51:53 2007
@@ -19,10 +19,11 @@
 
 package org.apache.cayenne.map;
 
-import java.util.List;
-import java.io.PrintWriter;
-import java.io.FileOutputStream;
+import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.util.List;
 
 import junit.framework.TestCase;
 
@@ -32,6 +33,7 @@
 import org.apache.cayenne.query.SQLTemplate;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.testdo.embeddable.Embeddable1;
+import org.apache.cayenne.unit.CayenneResources;
 import org.xml.sax.InputSource;
 
 public class MapLoaderLoadTest extends TestCase {
@@ -122,13 +124,14 @@
     }
 
     public void testEncodeAsXML() throws FileNotFoundException {
-        //load map
+        // load map
         MapLoader mapLoader = new MapLoader();
         DataMap map = mapLoader.loadDataMap(getMapXml("testmap.map.xml"));
         assertNotNull(map);
 
-        //endode map
-        PrintWriter pw = new PrintWriter(new FileOutputStream("testmap_generated.map.xml"));
+        // encode map
+        File file = new File(CayenneResources.getResources().getTestDir(), "testmap_generated.map.xml");
+        PrintWriter pw = new PrintWriter(new FileOutputStream(file));
         map.encodeAsXML(pw);
         pw.close();
     }



Mime
View raw message