mirror of https://github.com/apache/openjpa.git
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
This commit is contained in:
parent
f3dbb5acad
commit
ec836bec3b
|
@ -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 =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||
+ "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" " +
|
||||
+ "<" + 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 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("/>", "></" + projectStr + ">").trim();
|
||||
return xml;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue