From ec836bec3b85d557a8c0bb175eac720a0f6ba868 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Mon, 2 Apr 2012 20:58:02 +0000 Subject: [PATCH] OPENJPA-2169 - Test case update for Oracle 11.2. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1308558 13f79535-47bb-0310-9956-ffa450edef68 --- .../jdbc/oracle/TestOracleXmlColumn.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java index 45e6b90a5..3aca47085 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/jdbc/oracle/TestOracleXmlColumn.java @@ -34,13 +34,14 @@ import org.apache.openjpa.persistence.test.AbstractPersistenceTestCase; public class TestOracleXmlColumn extends AbstractPersistenceTestCase { + private static String projectStr = "project"; private static String xmlData = - " " - + "" + + "<" + 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\">" - + ""; + + ""; private boolean skipTest(DBDictionary dict) { return !(dict instanceof OracleDictionary); @@ -114,7 +115,7 @@ public class TestOracleXmlColumn extends AbstractPersistenceTestCase { 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 AbstractPersistenceTestCase { } 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("/>", ">").trim(); + return xml; + } }