geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r344944 - in /geronimo/trunk/modules: j2ee-schema/src/java/org/apache/geronimo/schema/ web-builder/src/test-resources/plans/ web-builder/src/test/org/apache/geronimo/web/deployment/
Date Wed, 16 Nov 2005 08:03:27 GMT
Author: djencks
Date: Wed Nov 16 00:03:20 2005
New Revision: 344944

URL: http://svn.apache.org/viewcvs?rev=344944&view=rev
Log:
Yet another GERONIMO-1175 problem

Added:
    geronimo/trunk/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml
Modified:
    geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/GBeanElementConverter.java
    geronimo/trunk/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java

Modified: geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/GBeanElementConverter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/GBeanElementConverter.java?rev=344944&r1=344943&r2=344944&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/GBeanElementConverter.java
(original)
+++ geronimo/trunk/modules/j2ee-schema/src/java/org/apache/geronimo/schema/GBeanElementConverter.java
Wed Nov 16 00:03:20 2005
@@ -33,12 +33,10 @@
         end.toEndToken();
         while (cursor.hasNextToken() && cursor.isLeftOf(end)) {
             if (cursor.isStart()) {
-                if (GERONIMO_SERVICE_NAMESPACE.equals(cursor.getName().getNamespaceURI()))
{
-                    //already has correct schema, exit
-                    return;
-                }
                 String localPart = cursor.getName().getLocalPart();
-                cursor.setName(new QName(GERONIMO_SERVICE_NAMESPACE, localPart));
+                if (!GERONIMO_SERVICE_NAMESPACE.equals(cursor.getName().getNamespaceURI()))
{
+                    cursor.setName(new QName(GERONIMO_SERVICE_NAMESPACE, localPart));
+                }
                 if (localPart.equals("xml-attribute") || localPart.equals("xml-reference"))
{
                     cursor.toEndToken();
                 }

Added: geronimo/trunk/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml?rev=344944&view=auto
==============================================================================
--- geronimo/trunk/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml (added)
+++ geronimo/trunk/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml Wed Nov 16
00:03:20 2005
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" configId="org/apache/jetspeed/web">
+    <context-priority-classloader>false</context-priority-classloader>
+    <container-config>
+        <tomcat xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat/config-1.0">
+            <cross-context/>
+            <tomcat-realm>TomcatJAASRealm</tomcat-realm>
+        </tomcat>
+    </container-config>
+    <resource-ref>
+      <ref-name>jdbc/DB1</ref-name>
+      <target-name>DefaultDatabase</target-name>
+    </resource-ref>
+    <security-realm-name>jetspeed-realm</security-realm-name>
+    <security>
+        <default-principal>
+            <principal class="org.apache.jetspeed.security.impl.UserPrincipalImpl" name="guest"/>
+        </default-principal>
+        <role-mappings>
+            <role role-name="admin">
+                <principal class="org.apache.jetspeed.security.impl.RolePrincipalImpl"
name="admin" designated-run-as="true"/>
+            </role>
+        </role-mappings>
+    </security>
+    <gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"
xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0">
+        <attribute name="realmName">jetspeed-realm</attribute>
+        <xml-reference name="LoginModuleConfiguration">
+            <lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.0">
+                <lc:login-module control-flag="REQUIRED" server-side="true">
+                    <lc:login-domain-name>jetspeed-realm</lc:login-domain-name>
+                    <lc:login-module-class>org.apache.jetspeed.security.impl.DefaultLoginModule</lc:login-module-class>
+                </lc:login-module>
+            </lc:login-config>
+        </xml-reference>
+        <reference name="ServerInfo">
+            <module>org/apache/geronimo/System</module>
+            <name>ServerInfo</name>
+        </reference>
+        <reference name="LoginService">
+            <name>JaasLoginService</name>
+        </reference>
+    </gbean>
+</web-app>

Modified: geronimo/trunk/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java?rev=344944&r1=344943&r2=344944&view=diff
==============================================================================
--- geronimo/trunk/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java
(original)
+++ geronimo/trunk/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java
Wed Nov 16 00:03:20 2005
@@ -20,6 +20,8 @@
 import java.util.List;
 import java.util.ArrayList;
 
+import javax.xml.namespace.QName;
+
 import junit.framework.TestCase;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlCursor;
@@ -45,6 +47,21 @@
         assertTrue("Differences: " + problems, ok);
     }
 
+    public void testConvertPlan2() throws Exception {
+        URL srcXml = classLoader.getResource("plans/tomcat-pre2.xml");
+        URL expectedOutputXml = classLoader.getResource("plans/tomcat-post.xml");
+        XmlObject rawPlan = XmlObject.Factory.parse(srcXml);
+        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
+        XmlObject webPlan = new GenericToSpecificPlanConverter("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat/config-1.0",
+                "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0", "tomcat").convertToSpecificPlan(rawPlan);
+
+        System.out.println(webPlan.toString());
+//        System.out.println(expected.toString());
+        List problems = new ArrayList();
+        boolean ok = compareXmlObjects(webPlan, expected, problems);
+        assertTrue("Differences: " + problems, ok);
+    }
+
 
     private boolean compareXmlObjects(XmlObject xmlObject, XmlObject expectedObject, List
problems) {
         XmlCursor test = xmlObject.newCursor();
@@ -57,8 +74,8 @@
                 problems.add("test longer than expected at element: " + elementCount);
                 return false;
             }
-            String actualChars = test.getName().getLocalPart();
-            String expectedChars = expected.getName().getLocalPart();
+            QName actualChars = test.getName();
+            QName expectedChars = expected.getName();
             if (!actualChars.equals(expectedChars)) {
                 problems.add("Different elements at elementCount: " + elementCount + ", test:
" + actualChars + ", expected: " + expectedChars);
                 similar = false;



Mime
View raw message