openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r1308558 - in /openjpa: branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
Date Mon, 02 Apr 2012 20:58:02 GMT
Author: allee8285
Date: Mon Apr  2 20:58:02 2012
New Revision: 1308558

URL: http://svn.apache.org/viewvc?rev=1308558&view=rev
Log:
OPENJPA-2169 - Test case update for Oracle 11.2.

Modified:
    openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java

Modified: openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java?rev=1308558&r1=1308557&r2=1308558&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
(original)
+++ openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
Mon Apr  2 20:58:02 2012
@@ -34,13 +34,14 @@ import org.apache.openjpa.persistence.te
 
 public class TestOracleXmlColumn extends AbstractPersistenceTestCase {
 
+    private static String projectStr = "project";
     private static String xmlData =
-        "<?xml version=\"1.0\" encoding=\"UTF-8\"?> "
-            + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" " +
+        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + "<" + projectStr + " xmlns=\"http://maven.apache.org/POM/4.0.0\" " +
             		"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
             		"xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 " +
             		"http://maven.apache.org/maven-v4_0_0.xsd\">"
-            + "</project>";
+            + "</" + projectStr + ">";
 
     private boolean skipTest(DBDictionary dict) {
         return !(dict instanceof OracleDictionary);
@@ -114,7 +115,7 @@ public class TestOracleXmlColumn extends
         em = emf.createEntityManager();
         xce = em.find(XmlColEntity.class, 1);
         assertNotNull(xce);
-        assertEquals(xmlData, xce.getXmlColumn());
+        assertEquals(xmlData, xmlResult(xce.getXmlColumn()));
 
         em.close();
         emf.close();
@@ -137,13 +138,17 @@ public class TestOracleXmlColumn extends
         }
 
         EntityManager em = emf.createEntityManager();
-        EntityTransaction tran = em.getTransaction();
 
         XmlColEntity xce = em.find(XmlColEntity.class, 42); 
         assertNotNull(xce);
         assertNotNull(xce.getXmlColumn());
-        assertEquals(xmlData, xce.getXmlColumn());
+        assertEquals(xmlData, xmlResult(xce.getXmlColumn()));
         em.close();
         emf.close();
     }
+
+    private String xmlResult(String xml) {
+        xml = xml.replace("\r", " ").replace("\n", " ").replace("/>", "></" + projectStr
+ ">").trim();
+        return xml;
+    }
 }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java?rev=1308558&r1=1308557&r2=1308558&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java
Mon Apr  2 20:58:02 2012
@@ -34,13 +34,14 @@ import org.apache.openjpa.persistence.te
 
 public class TestOracleXmlColumn extends AbstractPersistenceTestCase {
 
+    private static String projectStr = "project";
     private static String xmlData =
-        "<?xml version=\"1.0\" encoding=\"UTF-8\"?> "
-            + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" " +
+        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+            + "<" + projectStr + " xmlns=\"http://maven.apache.org/POM/4.0.0\" " +
             		"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
             		"xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 " +
             		"http://maven.apache.org/maven-v4_0_0.xsd\">"
-            + "</project>";
+            + "</" + projectStr + ">";
 
     private boolean skipTest(DBDictionary dict) {
         return !(dict instanceof OracleDictionary);
@@ -114,7 +115,7 @@ public class TestOracleXmlColumn extends
         em = emf.createEntityManager();
         xce = em.find(XmlColEntity.class, 1);
         assertNotNull(xce);
-        assertEquals(xmlData, xce.getXmlColumn());
+        assertEquals(xmlData, xmlResult(xce.getXmlColumn()));
 
         em.close();
         emf.close();
@@ -137,13 +138,17 @@ public class TestOracleXmlColumn extends
         }
 
         EntityManager em = emf.createEntityManager();
-        EntityTransaction tran = em.getTransaction();
 
         XmlColEntity xce = em.find(XmlColEntity.class, 42); 
         assertNotNull(xce);
         assertNotNull(xce.getXmlColumn());
-        assertEquals(xmlData, xce.getXmlColumn());
+        assertEquals(xmlData, xmlResult(xce.getXmlColumn()));
         em.close();
         emf.close();
     }
+
+    private String xmlResult(String xml) {
+        xml = xml.replace("\r", "").replace("\n", "").replace("/>", "></" + projectStr
+ ">").trim();
+        return xml;
+    }
 }



Mime
View raw message