Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 14908 invoked from network); 28 Sep 2004 07:03:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Sep 2004 07:03:39 -0000 Received: (qmail 94321 invoked by uid 500); 28 Sep 2004 07:03:38 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 94265 invoked by uid 500); 28 Sep 2004 07:03:37 -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 Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 94245 invoked by uid 99); 28 Sep 2004 07:03:37 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 28 Sep 2004 00:03:33 -0700 Received: (qmail 14851 invoked by uid 65534); 28 Sep 2004 07:03:30 -0000 Date: 28 Sep 2004 07:03:30 -0000 Message-ID: <20040928070330.14844.qmail@minotaur.apache.org> From: djencks@apache.org To: scm@geronimo.apache.org Subject: svn commit: rev 47393 - in geronimo/trunk/modules: client-builder client-builder/src/java/org/apache/geronimo/client/builder client-builder/src/schema client-builder/src/test client-builder/src/test-resources client-builder/src/test-resources/plans client-builder/src/test/org client-builder/src/test/org/apache client-builder/src/test/org/apache/geronimo client-builder/src/test/org/apache/geronimo/client client-builder/src/test/org/apache/geronimo/client/builder connector/src/schema jetty/src/java/org/apache/geronimo/jetty/deployment jetty/src/schema jetty/src/test-resources/deployables/war1/WEB-INF jetty/src/test-resources/plans jetty/src/test/org/apache/geronimo/jetty/deployment naming/src/schema X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: djencks Date: Tue Sep 28 00:03:28 2004 New Revision: 47393 Added: geronimo/trunk/modules/client-builder/src/test/ geronimo/trunk/modules/client-builder/src/test-resources/ geronimo/trunk/modules/client-builder/src/test-resources/plans/ geronimo/trunk/modules/client-builder/src/test-resources/plans/plan1.xml geronimo/trunk/modules/client-builder/src/test/org/ geronimo/trunk/modules/client-builder/src/test/org/apache/ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java geronimo/trunk/modules/jetty/src/test-resources/plans/ geronimo/trunk/modules/jetty/src/test-resources/plans/plan1.xml geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Modified: geronimo/trunk/modules/client-builder/project.xml geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml geronimo/trunk/modules/connector/src/schema/geronimo-connector_1_5.xsd geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd geronimo/trunk/modules/jetty/src/schema/xmlconfig.xml geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd Log: don't make duplicate xmlbeans-generated classes. Work around problem with xmlbeans imported group refs Modified: geronimo/trunk/modules/client-builder/project.xml ============================================================================== --- geronimo/trunk/modules/client-builder/project.xml (original) +++ geronimo/trunk/modules/client-builder/project.xml Tue Sep 28 00:03:28 2004 @@ -72,6 +72,9 @@ geronimo geronimo-connector ${pom.currentVersion} + + true + @@ -108,6 +111,9 @@ geronimo geronimo-naming ${pom.currentVersion} + + true + Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java ============================================================================== --- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original) +++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Tue Sep 28 00:03:28 2004 @@ -116,6 +116,41 @@ } GerApplicationClientType gerAppClient = null; + gerAppClient = getApplicationClientType(plan, moduleFile, name, appClient); + + // get the ids from either the application plan or for a stand alone module from the specific deployer + URI configId = null; + try { + configId = new URI(gerAppClient.getConfigId()); + } catch (URISyntaxException e) { + throw new DeploymentException("Invalid configId " + gerAppClient.getConfigId(), e); + } + + URI parentId = null; + if (gerAppClient.isSetParentId()) { + try { + parentId = new URI(gerAppClient.getParentId()); + } catch (URISyntaxException e) { + throw new DeploymentException("Invalid parentId " + gerAppClient.getParentId(), e); + } + } + + URI moduleURI; + if (targetPath != null) { + moduleURI = URI.create(targetPath); + if (targetPath.endsWith("/")) { + throw new DeploymentException("targetPath must not end with a '/'"); + } + } else { + targetPath = "app-client"; + moduleURI = URI.create(""); + } + + return new AppClientModule(name, configId, parentId, moduleURI, moduleFile, targetPath, appClient, gerAppClient, specDD); + } + + GerApplicationClientType getApplicationClientType(Object plan, JarFile moduleFile, String name, ApplicationClientType appClient) throws DeploymentException { + GerApplicationClientType gerAppClient = null; try { // load the geronimo-application-client.xml from either the supplied plan or from the earFile try { @@ -149,36 +184,7 @@ } catch (XmlException e) { throw new DeploymentException(e); } - - // get the ids from either the application plan or for a stand alone module from the specific deployer - URI configId = null; - try { - configId = new URI(gerAppClient.getConfigId()); - } catch (URISyntaxException e) { - throw new DeploymentException("Invalid configId " + gerAppClient.getConfigId(), e); - } - - URI parentId = null; - if (gerAppClient.isSetParentId()) { - try { - parentId = new URI(gerAppClient.getParentId()); - } catch (URISyntaxException e) { - throw new DeploymentException("Invalid parentId " + gerAppClient.getParentId(), e); - } - } - - URI moduleURI; - if (targetPath != null) { - moduleURI = URI.create(targetPath); - if (targetPath.endsWith("/")) { - throw new DeploymentException("targetPath must not end with a '/'"); - } - } else { - targetPath = "app-client"; - moduleURI = URI.create(""); - } - - return new AppClientModule(name, configId, parentId, moduleURI, moduleFile, targetPath, appClient, gerAppClient, specDD); + return gerAppClient; } private GerApplicationClientType createDefaultPlan(String name, ApplicationClientType appClient) { Modified: geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd ============================================================================== --- geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd (original) +++ geronimo/trunk/modules/client-builder/src/schema/geronimo-application-client.xsd Tue Sep 28 00:03:28 2004 @@ -43,7 +43,14 @@ - + + + + + + + + Modified: geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml ============================================================================== --- geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml (original) +++ geronimo/trunk/modules/client-builder/src/schema/xmlconfig.xml Tue Sep 28 00:03:28 2004 @@ -24,12 +24,13 @@ - org.apache.geronimo.xbeans.geronimo.naming + Ger + + + + org.apache.geronimo.xbeans.geronimo Ger Added: geronimo/trunk/modules/client-builder/src/test-resources/plans/plan1.xml ============================================================================== --- (empty file) +++ geronimo/trunk/modules/client-builder/src/test-resources/plans/plan1.xml Tue Sep 28 00:03:28 2004 @@ -0,0 +1,9 @@ + + + + jdbc/DB1 + DefaultDatabase + + Added: geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java ============================================================================== --- (empty file) +++ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java Tue Sep 28 00:03:28 2004 @@ -0,0 +1,37 @@ +package org.apache.geronimo.client.builder; + +import java.io.File; + +import junit.framework.TestCase; +import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType; +import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientType; +import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientDocument; +import org.apache.geronimo.schema.SchemaConversionUtils; + +/** + */ +public class PlanParsingTest extends TestCase { + + private AppClientModuleBuilder builder = new AppClientModuleBuilder(null, null,null, null, null, null); + File basedir = new File(System.getProperty("basedir", ".")); + + public void testResourceRef() throws Exception { + File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml"); + assertTrue(resourcePlan.exists()); + GerApplicationClientType appClient = builder.getApplicationClientType(resourcePlan, null, null, null); + assertEquals(1, appClient.getResourceRefArray().length); + } + + public void testConstructPlan() throws Exception { + GerApplicationClientDocument appClientDoc = GerApplicationClientDocument.Factory.newInstance(); + GerApplicationClientType appClient = appClientDoc.addNewApplicationClient(); + appClient.setConfigId("configId"); + appClient.setParentId("parentId"); + GerLocalRefType ref = appClient.addNewResourceRef(); + ref.setRefName("ref"); + ref.setTargetName("target"); + + SchemaConversionUtils.validateDD(appClient); + System.out.println(appClient.toString()); + } +} Modified: geronimo/trunk/modules/connector/src/schema/geronimo-connector_1_5.xsd ============================================================================== --- geronimo/trunk/modules/connector/src/schema/geronimo-connector_1_5.xsd (original) +++ geronimo/trunk/modules/connector/src/schema/geronimo-connector_1_5.xsd Tue Sep 28 00:03:28 2004 @@ -24,6 +24,7 @@ elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.5"> + Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java ============================================================================== --- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original) +++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Tue Sep 28 00:03:28 2004 @@ -103,6 +103,43 @@ } + JettyWebAppType jettyWebApp = getJettyWebApp(plan, moduleFile, name, webApp); + + // get the ids from either the application plan or for a stand alone module from the specific deployer + URI configId = null; + try { + configId = new URI(jettyWebApp.getConfigId()); + } catch (URISyntaxException e) { + throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e); + } + + URI parentId = null; + if (jettyWebApp.isSetParentId()) { + try { + parentId = new URI(jettyWebApp.getParentId()); + } catch (URISyntaxException e) { + throw new DeploymentException("Invalid parentId " + jettyWebApp.getParentId(), e); + } + } + + URI moduleURI; + if (targetPath != null) { + moduleURI = URI.create(targetPath); + if (targetPath.endsWith("/")) { + throw new DeploymentException("targetPath must not end with a '/'"); + } + targetPath += "/"; + } else { + targetPath = "war/"; + moduleURI = URI.create(""); + } + + WebModule module = new WebModule(name, configId, parentId, moduleURI, moduleFile, targetPath, webApp, jettyWebApp, specDD); + module.setContextRoot(jettyWebApp.getContextRoot()); + return module; + } + + JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, String name, WebAppType webApp) throws DeploymentException { JettyWebAppType jettyWebApp = null; try { // load the geronimo-jetty.xml from either the supplied plan or from the earFile @@ -137,39 +174,7 @@ } catch (XmlException e) { throw new DeploymentException(e); } - - // get the ids from either the application plan or for a stand alone module from the specific deployer - URI configId = null; - try { - configId = new URI(jettyWebApp.getConfigId()); - } catch (URISyntaxException e) { - throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e); - } - - URI parentId = null; - if (jettyWebApp.isSetParentId()) { - try { - parentId = new URI(jettyWebApp.getParentId()); - } catch (URISyntaxException e) { - throw new DeploymentException("Invalid parentId " + jettyWebApp.getParentId(), e); - } - } - - URI moduleURI; - if (targetPath != null) { - moduleURI = URI.create(targetPath); - if (targetPath.endsWith("/")) { - throw new DeploymentException("targetPath must not end with a '/'"); - } - targetPath += "/"; - } else { - targetPath = "war/"; - moduleURI = URI.create(""); - } - - WebModule module = new WebModule(name, configId, parentId, moduleURI, moduleFile, targetPath, webApp, jettyWebApp, specDD); - module.setContextRoot(jettyWebApp.getContextRoot()); - return module; + return jettyWebApp; } private JettyWebAppType createDefaultPlan(String name, WebAppType webApp) { Modified: geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd ============================================================================== --- geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd (original) +++ geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd Tue Sep 28 00:03:28 2004 @@ -18,9 +18,9 @@ - @@ -43,27 +40,20 @@ - - - - - + + + + + + + + + + + Modified: geronimo/trunk/modules/jetty/src/schema/xmlconfig.xml ============================================================================== --- geronimo/trunk/modules/jetty/src/schema/xmlconfig.xml (original) +++ geronimo/trunk/modules/jetty/src/schema/xmlconfig.xml Tue Sep 28 00:03:28 2004 @@ -24,8 +24,8 @@ - - org.apache.geronimo.xbeans.geronimo + + org.apache.geronimo.xbeans.geronimo.naming Ger Modified: geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml ============================================================================== --- geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml (original) +++ geronimo/trunk/modules/jetty/src/test-resources/deployables/war1/WEB-INF/geronimo-web.xml Tue Sep 28 00:03:28 2004 @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + + + false + + jdbc/DB1 + DefaultDatabase + + Added: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java ============================================================================== --- (empty file) +++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Tue Sep 28 00:03:28 2004 @@ -0,0 +1,38 @@ +package org.apache.geronimo.jetty.deployment; + +import java.io.File; + +import junit.framework.TestCase; +import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType; +import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppDocument; +import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType; +import org.apache.geronimo.schema.SchemaConversionUtils; + +/** + */ +public class PlanParsingTest extends TestCase { + + private JettyModuleBuilder builder = new JettyModuleBuilder(); + File basedir = new File(System.getProperty("basedir", ".")); + + public void testResourceRef() throws Exception { + File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml"); + assertTrue(resourcePlan.exists()); + JettyWebAppType jettyWebApp = builder.getJettyWebApp(resourcePlan, null, null, null); + assertEquals(1, jettyWebApp.getResourceRefArray().length); + } + + public void testConstructPlan() throws Exception { + JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance(); + JettyWebAppType jettyWebAppType = jettyWebAppDoc.addNewWebApp(); + jettyWebAppType.setConfigId("configId"); + jettyWebAppType.setParentId("parentId"); + jettyWebAppType.setContextPriorityClassloader(false); + GerLocalRefType ref = jettyWebAppType.addNewResourceRef(); + ref.setRefName("ref"); + ref.setTargetName("target"); + + SchemaConversionUtils.validateDD(jettyWebAppType); + System.out.println(jettyWebAppType.toString()); + } +} Modified: geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd ============================================================================== --- geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd (original) +++ geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd Tue Sep 28 00:03:28 2004 @@ -34,8 +34,21 @@ - + + + + + + + + @@ -46,9 +59,6 @@ -