geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r394359 - in /geronimo/branches/1.1/modules/upgrade/src: java/org/apache/geronimo/upgrade/ test-data/ test/org/apache/geronimo/upgrade/
Date Sat, 15 Apr 2006 19:32:36 GMT
Author: djencks
Date: Sat Apr 15 12:32:34 2006
New Revision: 394359

URL: http://svn.apache.org/viewcvs?rev=394359&view=rev
Log:
upgrade dependencies, improve tests

Added:
    geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1.xml
    geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1_result.xml
    geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_ejb_1_result.xml
Modified:
    geronimo/branches/1.1/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
    geronimo/branches/1.1/modules/upgrade/src/test/org/apache/geronimo/upgrade/Upgrade1_0To1_1Test.java

Modified: geronimo/branches/1.1/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java?rev=394359&r1=394358&r2=394359&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
(original)
+++ geronimo/branches/1.1/modules/upgrade/src/java/org/apache/geronimo/upgrade/Upgrade1_0To1_1.java
Sat Apr 15 12:32:34 2006
@@ -102,6 +102,7 @@
 
                     insertEnvironment(configId, parentId, cursor, ENVIRONMENT_QNAME, suppressDefaultEnvironment);
                 }
+
             }
         }
 
@@ -119,6 +120,7 @@
             environment.addDependency(parentId, ImportType.ALL);
         }
         environment.setSuppressDefaultEnvironment(suppressDefaultEnvironment);
+        extractDependencies(cursor, environment);
         EnvironmentType environmentType = EnvironmentBuilder.buildEnvironmentType(environment);
         cursor.beginElement(environmentQname);
         XmlCursor element = environmentType.newCursor();
@@ -129,6 +131,56 @@
         }
     }
 
+    private static void extractDependencies(XmlCursor cursor, Environment environment) {
+        if (cursor.getName() == null) {
+            //no dependencies, do nothing
+            return;
+        }
+        cursor.push();
+        do {
+            if (cursor.getName().getLocalPart().equals("dependency")) {
+                extractDependency(cursor, environment);
+            } else {
+                break;
+            }
+        } while (cursor.toNextSibling());
+        cursor.pop();
+    }
+
+    private static void extractDependency(XmlCursor cursor, Environment environment) {
+        cursor.push();
+        cursor.toFirstChild();
+        Artifact artifact;
+        if (cursor.getName().getLocalPart().equals("uri")) {
+            String uri = cursor.getTextValue();
+            artifact = Artifact.create(uri);
+        } else {
+            checkName(cursor, "groupId");
+            String groupId = cursor.getTextValue();
+            cursor.toNextSibling();
+            String type = "jar";
+            if (cursor.getName().getLocalPart().equals("type")) {
+                type = cursor.getTextValue();
+                cursor.toNextSibling();
+            }
+            checkName(cursor, "artifactId");
+            String artifactId = cursor.getTextValue();
+            cursor.toNextSibling();
+            checkName(cursor, "version");
+            String version = cursor.getTextValue();
+            artifact = new Artifact(groupId, artifactId, version, type);
+        }
+        environment.addDependency(artifact, ImportType.ALL);
+        cursor.pop();
+        cursor.removeXml();
+    }
+
+    private static void checkName(XmlCursor cursor, String localName) {
+        if (!cursor.getName().getLocalPart().equals(localName)) {
+            throw new IllegalArgumentException("Expected element: " + localName + " but actually:
" + cursor.getName().getLocalPart());
+        }
+
+    }
     private static void positionEnvironment(XmlCursor cursor) {
         XmlCursor.TokenType token;
         while ((token = cursor.toNextToken()) != XmlCursor.TokenType.START && token
!= XmlCursor.TokenType.END) {

Added: geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1.xml?rev=394359&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1.xml (added)
+++ geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1.xml Sat Apr 15 12:32:34
2006
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+    configId="appclient_dep"
+    parentId="${pom.groupId}/server-security/${pom.currentVersion}/car">
+
+    <module>
+        <java>appclient_dep_resref_single_client.jar</java>
+        <application-client xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
+            configId="bar"
+            clientConfigId="appclient_dep/appclient_dep_client"
+            clientParentId="${pom.groupId}/client-database/${pom.currentVersion}/car">
+
+            <dependency>
+                <uri>geronimo/geronimo-common/${geronimo_version}/jar</uri>
+            </dependency>
+
+            <dependency>
+                <uri>geronimo/geronimo-mail/${geronimo_version}/jar</uri>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.geronimo.specs</groupId>
+                <type>jar</type>
+                <artifactId>geronimo-activation_1.0.2_spec</artifactId>
+                <version>${geronimo_spec_javamail_version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.geronimo.specs</groupId>
+                <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+                <version>${geronimo_spec_javamail_version}</version>
+            </dependency>
+
+            <resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming">
+                <ref-name>url/URL</ref-name>
+                <url>http://${webserverHost}:${webserverPort}/appclient_dep/test.jsp</url>
+            </resource-ref>
+            <resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming">
+                <ref-name>jms/myQueueConnectionFactory</ref-name>
+                <resource-link>DefaultActiveMQConnectionFactory</resource-link>
+            </resource-ref>
+            <resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming">
+                <ref-name>jms/myTopicConnectionFactory</ref-name>
+                <resource-link>DefaultActiveMQConnectionFactory</resource-link>
+            </resource-ref>
+            <resource>
+                <external-rar>activemq/activemq-ra/${activemq_version}/rar</external-rar>
+                <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector"
+                    configId="org.codehaus.activemq.ra/default"
+                    suppressDefaultParentId="true"
+                    >
+                    <resourceadapter>
+                        <resourceadapter-instance>
+                            <resourceadapter-name>ActiveMQ RA</resourceadapter-name>
+                            <config-property-setting name="ServerUrl">tcp://localhost:61616</config-property-setting>
+                            <config-property-setting name="UserName">geronimo</config-property-setting>
+                            <config-property-setting name="Password">geronimo</config-property-setting>
+                            <workmanager>
+                                <gbean-link>DefaultWorkManager</gbean-link>
+                            </workmanager>
+                        </resourceadapter-instance>
+                        <outbound-resourceadapter>
+                            <connection-definition>
+                                <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
+                                <connectiondefinition-instance>
+                                    <name>DefaultActiveMQConnectionFactory</name>
+                                    <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
+                                    <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
+                                    <connectionmanager>
+                                        <xa-transaction>
+                                            <transaction-caching/>
+                                        </xa-transaction>
+                                        <single-pool>
+                                            <max-size>10</max-size>
+                                            <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                                            <match-one/>
+                                        </single-pool>
+                                    </connectionmanager>
+                                </connectiondefinition-instance>
+                            </connection-definition>
+                        </outbound-resourceadapter>
+                    </resourceadapter>
+                    <adminobject>
+                        <adminobject-interface>javax.jms.Queue</adminobject-interface>
+                        <adminobject-class>org.codehaus.activemq.message.ActiveMQQueue</adminobject-class>
+                        <adminobject-instance>
+                            <message-destination-name>Queue</message-destination-name>
+                            <config-property-setting name="PhysicalName">Queue</config-property-setting>
+                        </adminobject-instance>
+                    </adminobject>
+                    <adminobject>
+                        <adminobject-interface>javax.jms.Topic</adminobject-interface>
+                        <adminobject-class>org.codehaus.activemq.message.ActiveMQTopic</adminobject-class>
+                        <adminobject-instance>
+                            <message-destination-name>Topic</message-destination-name>
+                            <config-property-setting name="PhysicalName">Topic</config-property-setting>
+                        </adminobject-instance>
+                    </adminobject>
+                </connector>
+            </resource>
+            <gbean name="mail/MailSession" class="org.apache.geronimo.mail.MailGBean">
+                <attribute name="properties">
+                mail.smtp.host=mail.apache.com
+                </attribute>
+            </gbean>
+
+        </application-client>
+    </module>
+</application>

Added: geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1_result.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1_result.xml?rev=394359&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1_result.xml (added)
+++ geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_dep_1_result.xml Sat Apr
15 12:32:34 2006
@@ -0,0 +1,157 @@
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:configId>
+      <dep:groupId>default</dep:groupId>
+      <dep:artifactId>appclient_dep</dep:artifactId>
+      <dep:version>1-default</dep:version>
+      <dep:type>car</dep:type>
+    </dep:configId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>${pom.groupId}</dep:groupId>
+        <dep:artifactId>server-security</dep:artifactId>
+        <dep:version>${pom.currentVersion}</dep:version>
+        <dep:type>car</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+    <dep:hidden-classes/>
+    <dep:non-overridable-classes/>
+  </dep:environment>
+  <module>
+    <java>appclient_dep_resref_single_client.jar</java>
+    <application-client xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1">
+      <dep:client-environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+          <dep:groupId>default</dep:groupId>
+          <dep:artifactId>appclient_dep_appclient_dep_client</dep:artifactId>
+          <dep:version>1-default</dep:version>
+          <dep:type>car</dep:type>
+        </dep:configId>
+        <dep:dependencies>
+          <dep:dependency>
+            <dep:groupId>${pom.groupId}</dep:groupId>
+            <dep:artifactId>client-database</dep:artifactId>
+            <dep:version>${pom.currentVersion}</dep:version>
+            <dep:type>car</dep:type>
+          </dep:dependency>
+          <dep:dependency>
+            <dep:groupId>geronimo</dep:groupId>
+            <dep:artifactId>geronimo-common</dep:artifactId>
+            <dep:version>${geronimo_version}</dep:version>
+            <dep:type>jar</dep:type>
+          </dep:dependency>
+          <dep:dependency>
+            <dep:groupId>geronimo</dep:groupId>
+            <dep:artifactId>geronimo-mail</dep:artifactId>
+            <dep:version>${geronimo_version}</dep:version>
+            <dep:type>jar</dep:type>
+          </dep:dependency>
+          <dep:dependency>
+            <dep:groupId>org.apache.geronimo.specs</dep:groupId>
+            <dep:artifactId>geronimo-activation_1.0.2_spec</dep:artifactId>
+            <dep:version>${geronimo_spec_activation_version}</dep:version>
+            <dep:type>jar</dep:type>
+          </dep:dependency>
+          <dep:dependency>
+            <dep:groupId>org.apache.geronimo.specs</dep:groupId>
+            <dep:artifactId>geronimo-javamail_1.3.1_spec</dep:artifactId>
+            <dep:version>${geronimo_spec_javamail_version}</dep:version>
+            <dep:type>jar</dep:type>
+          </dep:dependency>
+        </dep:dependencies>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+      </dep:client-environment>
+      <dep:server-environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+          <dep:groupId>default</dep:groupId>
+          <dep:artifactId>bar</dep:artifactId>
+          <dep:version>1-default</dep:version>
+          <dep:type>car</dep:type>
+        </dep:configId>
+        <dep:dependencies/>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+      </dep:server-environment>
+      <resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming-1.1">
+        <ref-name>url/URL</ref-name>
+        <url>http://${webserverHost}:${webserverPort}/appclient_dep/test.jsp</url>
+      </resource-ref>
+      <resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming-1.1">
+        <ref-name>jms/myQueueConnectionFactory</ref-name>
+        <resource-link>DefaultActiveMQConnectionFactory</resource-link>
+      </resource-ref>
+      <resource-ref xmlns="http://geronimo.apache.org/xml/ns/naming-1.1">
+        <ref-name>jms/myTopicConnectionFactory</ref-name>
+        <resource-link>DefaultActiveMQConnectionFactory</resource-link>
+      </resource-ref>
+      <resource>
+        <external-rar>activemq/activemq-ra/${activemq_version}/rar</external-rar>
+        <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+          <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+            <dep:configId>
+              <dep:groupId>default</dep:groupId>
+              <dep:artifactId>org.codehaus.activemq.ra_default</dep:artifactId>
+              <dep:version>1-default</dep:version>
+              <dep:type>car</dep:type>
+            </dep:configId>
+            <dep:dependencies/>
+            <dep:hidden-classes/>
+            <dep:non-overridable-classes/>
+            <dep:suppress-default-environment/>
+          </dep:environment>
+          <resourceadapter>
+            <resourceadapter-instance>
+              <resourceadapter-name>ActiveMQ RA</resourceadapter-name>
+              <config-property-setting name="ServerUrl">tcp://localhost:61616</config-property-setting>
+              <config-property-setting name="UserName">geronimo</config-property-setting>
+              <config-property-setting name="Password">geronimo</config-property-setting>
+              <workmanager>
+                <gbean-link>DefaultWorkManager</gbean-link>
+              </workmanager>
+            </resourceadapter-instance>
+            <outbound-resourceadapter>
+              <connection-definition>
+                <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
+                <connectiondefinition-instance>
+                  <name>DefaultActiveMQConnectionFactory</name>
+                  <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
+                  <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
+                  <connectionmanager>
+                    <xa-transaction>
+                      <transaction-caching/>
+                    </xa-transaction>
+                    <single-pool>
+                      <max-size>10</max-size>
+                      <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                      <match-one/>
+                    </single-pool>
+                  </connectionmanager>
+                </connectiondefinition-instance>
+              </connection-definition>
+            </outbound-resourceadapter>
+          </resourceadapter>
+          <adminobject>
+            <adminobject-interface>javax.jms.Queue</adminobject-interface>
+            <adminobject-class>org.codehaus.activemq.message.ActiveMQQueue</adminobject-class>
+            <adminobject-instance>
+              <message-destination-name>Queue</message-destination-name>
+              <config-property-setting name="PhysicalName">Queue</config-property-setting>
+            </adminobject-instance>
+          </adminobject>
+          <adminobject>
+            <adminobject-interface>javax.jms.Topic</adminobject-interface>
+            <adminobject-class>org.codehaus.activemq.message.ActiveMQTopic</adminobject-class>
+            <adminobject-instance>
+              <message-destination-name>Topic</message-destination-name>
+              <config-property-setting name="PhysicalName">Topic</config-property-setting>
+            </adminobject-instance>
+          </adminobject>
+        </connector>
+      </resource>
+      <gbean name="mail/MailSession" class="org.apache.geronimo.mail.MailGBean">
+        <attribute name="properties">mail.smtp.host=mail.apache.com</attribute>
+      </gbean>
+    </application-client>
+  </module>
+</application>

Added: geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_ejb_1_result.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_ejb_1_result.xml?rev=394359&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_ejb_1_result.xml (added)
+++ geronimo/branches/1.1/modules/upgrade/src/test-data/appclient_ejb_1_result.xml Sat Apr
15 12:32:34 2006
@@ -0,0 +1,91 @@
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:configId>
+      <dep:groupId>default</dep:groupId>
+      <dep:artifactId>appclient_ejb_1</dep:artifactId>
+      <dep:version>1-default</dep:version>
+      <dep:type>car</dep:type>
+    </dep:configId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>${pom.groupId}</dep:groupId>
+        <dep:artifactId>server-security</dep:artifactId>
+        <dep:version>${pom.currentVersion}</dep:version>
+        <dep:type>car</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+    <dep:hidden-classes/>
+    <dep:non-overridable-classes/>
+  </dep:environment>
+  <module>
+    <ejb>appclient_ejb_1_ejb.jar</ejb>
+    <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1">
+      <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+          <dep:groupId>default</dep:groupId>
+          <dep:artifactId>ejb</dep:artifactId>
+          <dep:version>1-default</dep:version>
+          <dep:type>car</dep:type>
+        </dep:configId>
+        <dep:dependencies/>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+      </dep:environment>
+      <cmp-connection-factory>
+        <resource-link>jdbc/DB1</resource-link>
+      </cmp-connection-factory>
+      <enterprise-beans>
+        <entity>
+          <ejb-name>CMP20</ejb-name>
+          <table-name>CMP20_APPCLIENT_TABLE1</table-name>
+          <cmp-field-mapping>
+            <cmp-field-name>id</cmp-field-name>
+            <table-column>ID</table-column>
+          </cmp-field-mapping>
+        </entity>
+        <entity>
+          <ejb-name>CMP11</ejb-name>
+          <table-name>CMP20_APPCLIENT_TABLE2</table-name>
+          <cmp-field-mapping>
+            <cmp-field-name>KEY_ID</cmp-field-name>
+            <table-column>ID</table-column>
+          </cmp-field-mapping>
+        </entity>
+      </enterprise-beans>
+    </openejb-jar>
+  </module>
+  <module>
+    <java>appclient_ejb_1_client.jar</java>
+    <application-client xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1">
+      <dep:client-environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+          <dep:groupId>default</dep:groupId>
+          <dep:artifactId>appclient_ejb_1_appclient_ejb_1_client</dep:artifactId>
+          <dep:version>1-default</dep:version>
+          <dep:type>car</dep:type>
+        </dep:configId>
+        <dep:dependencies>
+          <dep:dependency>
+            <dep:groupId>${pom.groupId}</dep:groupId>
+            <dep:artifactId>client-database</dep:artifactId>
+            <dep:version>${pom.currentVersion}</dep:version>
+            <dep:type>car</dep:type>
+          </dep:dependency>
+        </dep:dependencies>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+      </dep:client-environment>
+      <dep:server-environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+          <dep:groupId>default</dep:groupId>
+          <dep:artifactId>bar</dep:artifactId>
+          <dep:version>1-default</dep:version>
+          <dep:type>car</dep:type>
+        </dep:configId>
+        <dep:dependencies/>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+      </dep:server-environment>
+    </application-client>
+  </module>
+</application>

Modified: geronimo/branches/1.1/modules/upgrade/src/test/org/apache/geronimo/upgrade/Upgrade1_0To1_1Test.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/upgrade/src/test/org/apache/geronimo/upgrade/Upgrade1_0To1_1Test.java?rev=394359&r1=394358&r2=394359&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/upgrade/src/test/org/apache/geronimo/upgrade/Upgrade1_0To1_1Test.java
(original)
+++ geronimo/branches/1.1/modules/upgrade/src/test/org/apache/geronimo/upgrade/Upgrade1_0To1_1Test.java
Sat Apr 15 12:32:34 2006
@@ -41,26 +41,28 @@
     private final ClassLoader classLoader = this.getClass().getClassLoader();
 
     public void test1() throws Exception {
-//        InputStream srcXml = classLoader.getResourceAsStream("jms-plan.xml");
-        InputStream srcXml = classLoader.getResourceAsStream("appclient_ejb_1.xml");
+        test("appclient_ejb_1");
+    }
+
+    public void test2() throws Exception {
+        test("appclient_dep_1");
+    }
+
+    private void test(String testName) throws Exception {
+        InputStream srcXml = classLoader.getResourceAsStream(testName + ".xml");
         Writer targetXml = new StringWriter();
         Upgrade1_0To1_1.upgrade(srcXml, targetXml);
 
         String targetString = targetXml.toString();
-        System.out.println(targetString);
         XmlObject targetXmlObject = XmlObject.Factory.parse(targetString);
-        //uncomment fail to see output
-//        fail();
-//        URL expectedOutputXml = classLoader.getResource("appclient_dep_ejblink_single.ear.xml");
-//        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-//        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
-//        SchemaConversionUtils.validateDD(expected);
-//        xmlObject = SchemaConversionUtils.convertToApplicationClientSchema(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);
+        URL expectedOutputXml = classLoader.getResource(testName + "_result.xml");
+        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
+        List problems = new ArrayList();
+        boolean ok = compareXmlObjects(targetXmlObject, expected, problems);
+        if (!ok) {
+            System.out.println(targetString);
+        }
+        assertTrue("Differences: " + problems, ok);
     }
 
     private boolean compareXmlObjects(XmlObject xmlObject, XmlObject expectedObject, List
problems) {



Mime
View raw message