cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r734453 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java
Date Wed, 14 Jan 2009 17:37:08 GMT
Author: andrey
Date: Wed Jan 14 09:37:07 2009
New Revision: 734453

URL: http://svn.apache.org/viewvc?rev=734453&view=rev
Log:
Fixing this test, so that it would not fail on Windows

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java?rev=734453&r1=734452&r2=734453&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/query/EJBQLQueryTest.java
Wed Jan 14 09:37:07 2009
@@ -67,7 +67,9 @@
                 .getCacheKey());
     }
 
-    public void testCacheStrategy() {
+    public void testCacheStrategy() throws Exception {
+        deleteTestData();
+        
         insertValue();
         DataContext contex = createDataContext();
         String ejbql = "select a FROM Artist a";
@@ -88,7 +90,9 @@
         assertEquals(artist1.get(0).getArtistName(), artist2.get(0).getArtistName());
     }
 
-    public void testDataRows() {
+    public void testDataRows() throws Exception {
+        deleteTestData();
+        
         insertValue();
         String ejbql = "select a FROM Artist a";
         EJBQLQuery query = new EJBQLQuery(ejbql);
@@ -178,12 +182,14 @@
         StringWriter w = new StringWriter();
         XMLEncoder e = new XMLEncoder(new PrintWriter(w));
         
+        String separator = System.getProperty("line.separator");
+        
         StringBuffer s = new StringBuffer("<query name=\"");
         s.append(name);
         s.append("\" factory=\"");
         s.append("org.apache.cayenne.map.EjbqlBuilder");
         s.append("\">");
-        s.append("\n");
+        s.append(separator);
       
         EJBQLQuery query = new EJBQLQuery(ejbql);
         
@@ -192,11 +198,12 @@
             s.append(query.getEjbqlStatement());
             s.append("]]></ejbql>");
         }
-        s.append("\n");
+        s.append(separator);
         s.append("</query>");     
-        s.append("\n");
+        s.append(separator);
         query.setName(name);
-        query.encodeAsXML(e);       
-        assertTrue(w.getBuffer().toString().equals(s.toString()));
+        query.encodeAsXML(e);
+        
+        assertEquals(w.getBuffer().toString(), s.toString());
     }
 }



Mime
View raw message