geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r555871 - in /geronimo/server/trunk/modules/geronimo-web-2.5-builder/src: main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
Date Fri, 13 Jul 2007 04:35:47 GMT
Author: djencks
Date: Thu Jul 12 21:35:46 2007
New Revision: 555871

URL: http://svn.apache.org/viewvc?view=rev&rev=555871
Log:
GERONIMO-3307, rest of commit. Fix manifest classpath resolution some more

Added:
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
  (with props)
Modified:
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?view=diff&rev=555871&r1=555870&r2=555871
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Thu Jul 12 21:35:46 2007
@@ -328,7 +328,8 @@
         ClassPathList manifestcp = (ClassPathList) moduleContext.getGeneralData().get(ClassPathList.class);
         ModuleList moduleLocations = (ModuleList) module.getRootEarContext().getGeneralData().get(ModuleList.class);
         URI baseUri = URI.create(module.getTargetPath());
-        moduleContext.getCompleteManifestClassPath(module.getModuleFile(), baseUri, baseUri.resolve(RELATIVE_MODULE_BASE_URI),
manifestcp, moduleLocations);
+        URI resolutionUri = invertURI(baseUri);
+        moduleContext.getCompleteManifestClassPath(module.getModuleFile(), baseUri, resolutionUri,
manifestcp, moduleLocations);
 
 
         WebAppType webApp = (WebAppType) module.getSpecDD();
@@ -354,6 +355,14 @@
         }
         securityBuilders.build(gerWebApp, earContext, module.getEarContext());
         serviceBuilders.build(gerWebApp, earContext, module.getEarContext());
+    }
+
+    static URI invertURI(URI baseUri) {
+        URI resolutionUri = URI.create(".");
+        for (URI test = baseUri; !test.equals(RELATIVE_MODULE_BASE_URI); test = test.resolve(RELATIVE_MODULE_BASE_URI))
{
+            resolutionUri = resolutionUri.resolve(RELATIVE_MODULE_BASE_URI);
+        }
+        return resolutionUri;
     }
 
     protected WebAppDocument convertToServletSchema(XmlObject xmlObject) throws XmlException
{

Added: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java?view=auto&rev=555871
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
(added)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
Thu Jul 12 21:35:46 2007
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.web25.deployment;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class AbstractWebModuleBuilderTest extends TestCase {
+    
+    public void testInvertUri() throws Exception {
+        assertEquals(URI.create("../"), AbstractWebModuleBuilder.invertURI(URI.create("web.war")));
+        assertEquals(URI.create("../../"), AbstractWebModuleBuilder.invertURI(URI.create("web/web.war")));
+        assertEquals(URI.create("../../../"), AbstractWebModuleBuilder.invertURI(URI.create("web/web/web.war")));
+    }
+
+}

Propchange: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilderTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message