geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsis...@apache.org
Subject svn commit: r381215 - in /geronimo/trunk/modules/j2ee-schema/src: test-data/j2ee_1_3dtd/mdb-ejb-jar-20-GERONIMO-1649.xml test-data/j2ee_1_3dtd/mdb-ejb-jar-21-GERONIMO-1649.xml test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
Date Mon, 27 Feb 2006 01:49:14 GMT
Author: jsisson
Date: Sun Feb 26 17:49:11 2006
New Revision: 381215

URL: http://svn.apache.org/viewcvs?rev=381215&view=rev
Log:
GERONIMO-1649 - Test case for Invalid deployment descriptor error when deploying an EJB 2.0
MDB (merged from 1.0 branch)

Added:
    geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_3dtd/mdb-ejb-jar-20-GERONIMO-1649.xml
      - copied unchanged from r380600, geronimo/branches/1.0/modules/j2ee-schema/src/test-data/j2ee_1_3dtd/mdb-ejb-jar-20-GERONIMO-1649.xml
    geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_3dtd/mdb-ejb-jar-21-GERONIMO-1649.xml
      - copied unchanged from r380600, geronimo/branches/1.0/modules/j2ee-schema/src/test-data/j2ee_1_3dtd/mdb-ejb-jar-21-GERONIMO-1649.xml
Modified:
    geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java

Modified: geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java?rev=381215&r1=381214&r2=381215&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
(original)
+++ geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
Sun Feb 26 17:49:11 2006
@@ -17,7 +17,6 @@
 
 package org.apache.geronimo.schema;
 
-import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.net.URL;
@@ -179,6 +178,35 @@
     public void testEJB20ToEJB21Transform() throws Exception {
         URL srcXml = classLoader.getResource("j2ee_1_3dtd/ejb-jar.xml");
         URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/ejb-jar-21.xml");
+        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
+        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
+        SchemaConversionUtils.validateDD(expected);
+        xmlObject = SchemaConversionUtils.convertToEJBSchema(xmlObject);
+//        System.out.println(xmlObject.toString());
+//        System.out.println(expected.toString());
+        List problems = new ArrayList();
+        boolean ok = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences: " + problems, ok);
+        //make sure trying to convert twice has no bad effects
+        XmlCursor cursor2 = xmlObject.newCursor();
+        try {
+            String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd";
+            String version = "2.1";
+            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.J2EE_NAMESPACE,
schemaLocationURL, version));
+        } finally {
+            cursor2.dispose();
+        }
+        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences after reconverting to schema: " + problems, ok2);
+        //do the whole transform twice...
+        xmlObject = SchemaConversionUtils.convertToEJBSchema(xmlObject);
+        boolean ok3 = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences after reconverting to ejb schema: " + problems, ok3);
+    }
+
+    public void testMDB20ToEJB21TransformBugGERONIMO_1649() throws Exception {
+        URL srcXml = classLoader.getResource("j2ee_1_3dtd/mdb-ejb-jar-20-GERONIMO-1649.xml");
+        URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/mdb-ejb-jar-21-GERONIMO-1649.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         SchemaConversionUtils.validateDD(expected);



Mime
View raw message