Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 65384 invoked from network); 15 Jan 2007 13:03:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jan 2007 13:03:01 -0000 Received: (qmail 40881 invoked by uid 500); 15 Jan 2007 13:03:07 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 40872 invoked by uid 500); 15 Jan 2007 13:03:07 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 40861 invoked by uid 99); 15 Jan 2007 13:03:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jan 2007 05:03:07 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jan 2007 05:03:00 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 6A2981A981D; Mon, 15 Jan 2007 05:01:57 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r496305 - in /geronimo/server/trunk/modules/geronimo-client-builder/src: main/java/org/apache/geronimo/client/builder/ test/java/org/apache/geronimo/client/builder/ test/resources/j2ee_1_3dtd/ Date: Mon, 15 Jan 2007 13:01:57 -0000 To: scm@geronimo.apache.org From: akulshreshtha@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070115130157.6A2981A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: akulshreshtha Date: Mon Jan 15 05:01:56 2007 New Revision: 496305 URL: http://svn.apache.org/viewvc?view=rev&rev=496305 Log: GERONIMO-2723 Upgrade client-builder to use javaee 5 schemas Added: geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml (with props) Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/SchemaConversionTest.java Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&rev=496305&r1=496304&r2=496305 ============================================================================== --- geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original) +++ geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Mon Jan 15 05:01:56 2007 @@ -81,8 +81,8 @@ import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientType; import org.apache.geronimo.xbeans.geronimo.client.GerResourceType; import org.apache.geronimo.xbeans.geronimo.naming.GerAbstractNamingEntryDocument; -import org.apache.geronimo.xbeans.j2ee.ApplicationClientDocument; -import org.apache.geronimo.xbeans.j2ee.ApplicationClientType; +import org.apache.geronimo.xbeans.javaee.ApplicationClientDocument; +import org.apache.geronimo.xbeans.javaee.ApplicationClientType; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; import org.apache.xmlbeans.XmlCursor; @@ -377,14 +377,24 @@ } XmlCursor cursor = xmlObject.newCursor(); XmlCursor moveable = xmlObject.newCursor(); - String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application-client_1_4.xsd"; - String version = "1.4"; + String schemaLocationURL = "http://java.sun.com/xml/ns/javaee/application-client_5.xsd"; + String version = "5"; try { - SchemaConversionUtils.convertToSchema(cursor, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version); cursor.toStartDoc(); - cursor.toChild(SchemaConversionUtils.J2EE_NAMESPACE, "application-client"); cursor.toFirstChild(); - SchemaConversionUtils.convertToDescriptionGroup(SchemaConversionUtils.J2EE_NAMESPACE, cursor, moveable); + if ("http://java.sun.com/xml/ns/j2ee".equals(cursor.getName().getNamespaceURI())) { + SchemaConversionUtils.convertSchemaVersion(cursor, SchemaConversionUtils.JAVAEE_NAMESPACE, schemaLocationURL, version); + XmlObject result = xmlObject.changeType(ApplicationClientDocument.type); + XmlBeansUtil.validateDD(result); + return (ApplicationClientDocument) result; + } + + // otherwise assume DTD + SchemaConversionUtils.convertToSchema(cursor, SchemaConversionUtils.JAVAEE_NAMESPACE, schemaLocationURL, version); + cursor.toStartDoc(); + cursor.toChild(SchemaConversionUtils.JAVAEE_NAMESPACE, "application-client"); + cursor.toFirstChild(); + SchemaConversionUtils.convertToDescriptionGroup(SchemaConversionUtils.JAVAEE_NAMESPACE, cursor, moveable); } finally { cursor.dispose(); moveable.dispose(); @@ -484,7 +494,7 @@ } String classPath = manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH); if (module.isStandAlone() && classPath != null) { - throw new DeploymentException("Manifest class path entry is not allowed in a standalone jar (J2EE 1.4 Section 8.2)"); + throw new DeploymentException("Manifest class path entry is not allowed in a standalone jar (JAVAEE 5 Section 8.2)"); } } catch (IOException e) { throw new DeploymentException("Could not get manifest from app client module: " + moduleFile.getName()); @@ -656,10 +666,10 @@ } if (!pathUri.getPath().endsWith(".jar")) { - throw new DeploymentException("Manifest class path entries must end with the .jar extension (J2EE 1.4 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path); + throw new DeploymentException("Manifest class path entries must end with the .jar extension (JAVAEE 5 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path); } if (pathUri.isAbsolute()) { - throw new DeploymentException("Manifest class path entries must be relative (J2EE 1.4 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path); + throw new DeploymentException("Manifest class path entries must be relative (JAVAEE 5 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path); } // determine the target file @@ -686,7 +696,7 @@ try { classPathJarFile = new JarFile(classPathFile); } catch (IOException e) { - throw new DeploymentException("Manifest class path entries must be a valid jar file (J2EE 1.4 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path, e); + throw new DeploymentException("Manifest class path entries must be a valid jar file (JAVAEE 5 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path, e); } // add the client jars of this class path jar Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/SchemaConversionTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/SchemaConversionTest.java?view=diff&rev=496305&r1=496304&r2=496305 ============================================================================== --- geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/SchemaConversionTest.java (original) +++ geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/SchemaConversionTest.java Mon Jan 15 05:01:56 2007 @@ -39,9 +39,9 @@ private ClassLoader classLoader = this.getClass().getClassLoader(); - public void testApplicationClient13ToApplicationClient14Transform() throws Exception { + public void testApplicationClient13ToApplicationClient5Transform() throws Exception { URL srcXml = classLoader.getResource("j2ee_1_3dtd/application-client-13.xml"); - URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/application-client-14.xml"); + URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/application-client-5.xml"); XmlObject xmlObject = XmlObject.Factory.parse(srcXml); XmlObject expected = XmlObject.Factory.parse(expectedOutputXml); XmlBeansUtil.validateDD(expected); @@ -54,9 +54,9 @@ //make sure trying to convert twice has no bad effects XmlCursor cursor2 = xmlObject.newCursor(); try { - String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"; - String version = "1.4"; - assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version)); + String schemaLocationURL = "http://java.sun.com/xml/ns/javaee/application_5.xsd"; + String version = "5"; + assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.JAVAEE_NAMESPACE, schemaLocationURL, version)); } finally { cursor2.dispose(); } @@ -68,4 +68,32 @@ assertTrue("Differences after reconverting to application client schema: " + problems, ok3); } + public void testApplicationClient14ToApplicationClient5Transform() throws Exception { + URL srcXml = classLoader.getResource("j2ee_1_3dtd/application-client-14.xml"); + URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/application-client-5.xml"); + XmlObject xmlObject = XmlObject.Factory.parse(srcXml); + XmlObject expected = XmlObject.Factory.parse(expectedOutputXml); + XmlBeansUtil.validateDD(expected); + xmlObject = AppClientModuleBuilder.convertToApplicationClientSchema(xmlObject); +// log.debug(xmlObject.toString()); +// log.debug(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/javaee/application_5.xsd"; + String version = "5"; + assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.JAVAEE_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 = AppClientModuleBuilder.convertToApplicationClientSchema(xmlObject); + boolean ok3 = compareXmlObjects(xmlObject, expected, problems); + assertTrue("Differences after reconverting to application client schema: " + problems, ok3); + } } Added: geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml?view=auto&rev=496305 ============================================================================== --- geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml (added) +++ geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml Mon Jan 15 05:01:56 2007 @@ -0,0 +1,39 @@ + + + + + + it's like this, see? + display me! + + jdbc/DefaultDatasource + javax.sql.DataSource + Container + Shareable + + + jms/JMSConnectionFactory + javax.jms.ConnectionFactory + Container + Shareable + + + jms/Queue + javax.jms.Queue + + Propchange: geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml ------------------------------------------------------------------------------ svn:keywords = Date Revision Propchange: geronimo/server/trunk/modules/geronimo-client-builder/src/test/resources/j2ee_1_3dtd/application-client-5.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml