geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r671363 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/common/ org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/ org.apach...
Date Tue, 24 Jun 2008 22:02:37 GMT
Author: mcconne
Date: Tue Jun 24 15:02:37 2008
New Revision: 671363

URL: http://svn.apache.org/viewvc?rev=671363&view=rev
Log:
GERONIMODEVTOOLS-405 Convert openejb-jar namespaces correctly

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/common/NamespaceFilter.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/OpenEjbJarTest.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/NamespaceFilter.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/common/NamespaceFilter.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/common/NamespaceFilter.java?rev=671363&r1=671362&r2=671363&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/common/NamespaceFilter.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/common/NamespaceFilter.java
Tue Jun 24 15:02:37 2008
@@ -39,35 +39,95 @@
     private static Map<String, String> namespace = new HashMap<String, String>();
 
     static {
+        // 
+        // Convert old deployment namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/deployment", 
+                      "http://geronimo.apache.org/xml/ns/deployment-1.2");
+        namespace.put("http://geronimo.apache.org/xml/ns/deployment-1.0", 
+                      "http://geronimo.apache.org/xml/ns/deployment-1.2");
         namespace.put("http://geronimo.apache.org/xml/ns/deployment-1.1", 
                       "http://geronimo.apache.org/xml/ns/deployment-1.2");
 
+        // 
+        // Convert old application namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-2.0");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-1.1", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-2.0");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-1.2", 
                       "http://geronimo.apache.org/xml/ns/j2ee/application-2.0");
 
+        // 
+        // Convert old application-client namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-client", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-client-1.2", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1", 
                       "http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0");
 
+        // 
+        // Convert old connector namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/connector", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/connector-1.0", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/connector-1.1", 
                       "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
 
+        // 
+        // Convert old web namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.0", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.1", 
                       "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.2", 
                       "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-2.0", 
                       "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
 
+        // 
+        // Convert old naming namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/naming", 
+                      "http://geronimo.apache.org/xml/ns/naming-1.2");
+        namespace.put("http://geronimo.apache.org/xml/ns/naming-1.0", 
+                      "http://geronimo.apache.org/xml/ns/naming-1.2");
         namespace.put("http://geronimo.apache.org/xml/ns/naming-1.1", 
                       "http://geronimo.apache.org/xml/ns/naming-1.2");
 
+        // 
+        // Convert old security namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/security", 
+                      "http://geronimo.apache.org/xml/ns/security-2.0");
         namespace.put("http://geronimo.apache.org/xml/ns/security-1.1", 
                       "http://geronimo.apache.org/xml/ns/security-2.0");
-
         namespace.put("http://geronimo.apache.org/xml/ns/security-1.2", 
                       "http://geronimo.apache.org/xml/ns/security-2.0");
+
+        // 
+        // Convert old openejb-jar namespaces 
+        // 
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar-2.1", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar-2.2", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar-2.3", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/pkgen", 
+                      "http://openejb.apache.org/xml/ns/pkgen-2.1");
+        namespace.put("http://www.openejb.org/xml/ns/pkgen-2.0",
+                      "http://openejb.apache.org/xml/ns/pkgen-2.1");
     }
 
     public NamespaceFilter(XMLReader xmlReader) {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/OpenEjbJarTest.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/OpenEjbJarTest.java?rev=671363&r1=671362&r2=671363&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/OpenEjbJarTest.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/OpenEjbJarTest.java
Tue Jun 24 15:02:37 2008
@@ -27,10 +27,14 @@
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.sax.SAXSource;
 
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
+import org.apache.geronimo.jee.common.NamespaceFilter;
 import org.apache.geronimo.jee.common.NamespacePrefixMapperImpl;
 import org.apache.geronimo.jee.deployment.Artifact;
 import org.apache.geronimo.jee.deployment.Dependencies;
@@ -93,6 +97,13 @@
                               "openejb/openejb-jar-expected-2.xml");
     }
 
+    public void testConvertNamespace() throws Exception {
+        convertNamespace("openejb/openejb-jar-example-3.xml", 
+                         "openejb/openejb-jar-expected-3.xml");
+        convertNamespace("openejb/openejb-jar-example-4.xml", 
+                         "openejb/openejb-jar-expected-3.xml");
+    }
+
     public void testCompleteXML() throws Exception {
         buildFullXMLFromScratch("openejb/openejb-jar-expected-11.xml");
     }
@@ -159,6 +170,72 @@
 
     }
 
+    private void convertNamespace(String fileExample, String fileExpected) throws Exception
{
+
+        // 
+        // Create unmarshaller and marshaller
+        // 
+        JAXBContext jaxbContext = JAXBContext.newInstance( 
+                                    "org.apache.geronimo.jee.openejb:" +
+                                    "org.apache.geronimo.jee.application:" +
+                                    "org.apache.geronimo.jee.deployment:" +
+                                    "org.apache.geronimo.jee.naming", getClass().getClassLoader()
);
+        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+        Marshaller marshaller = jaxbContext.createMarshaller();
+        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+        marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapperImpl());
+
+        // 
+        // Create SAXParser
+        // 
+        SAXParserFactory factory = SAXParserFactory.newInstance();
+        factory.setNamespaceAware(true);
+        factory.setValidating(false);
+        SAXParser parser = factory.newSAXParser();
+
+        // 
+        // Create NamespaceFilter to filter for v1.1 namespaces
+        // 
+        NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
+
+        // 
+        // Read example and expected XML files
+        // 
+        InputStream exampleInputStream = this.getClass().getClassLoader().getResourceAsStream(fileExample);
+        InputStream expectedInputStream = this.getClass().getClassLoader().getResourceAsStream(fileExpected);
+        String example = readContent(exampleInputStream);
+        String expected = readContent(expectedInputStream);
+
+        // 
+        // Unmarshall the example file
+        // 
+        SAXSource source = new SAXSource(xmlFilter, new InputSource(new ByteArrayInputStream(example.getBytes())));
+        Object jaxbElement = unmarshaller.unmarshal(source);
+
+        // 
+        // Marshall the output of the unmarshall
+        // 
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        marshaller.marshal(jaxbElement, baos);
+        byte[] bytes = baos.toByteArray();
+        String actual = new String(bytes);
+
+        // 
+        // Compare actual and expected
+        // 
+        try {
+            Diff myDiff = new Diff(expected, actual);
+            assertTrue("Files are similar " + myDiff, myDiff.similar());
+        }
+        catch (AssertionFailedError e) {
+            System.out.println("[Example XML: " + fileExample + "] " + '\n' + example + '\n');
+            System.out.println("[Expected XML: " + fileExpected + "] " + '\n' + expected
+ '\n');
+            System.out.println("[Actual XML] " + '\n' + actual + '\n');
+            throw e;            
+        }
+    }
+
     private void buildFullXMLFromScratch (String fileExpected) throws Exception {
 
         org.apache.geronimo.jee.openejb.ObjectFactory openejbFactory = new org.apache.geronimo.jee.openejb.ObjectFactory();

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml?rev=671363&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
Tue Jun 24 15:02:37 2008
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<!-- @version $Rev$ $Date$ -->
+
+<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
+             xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2"
+             xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.2"
+             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+             
+    <sys:environment>
+        <sys:moduleId>
+            <sys:groupId>com.ibm.wasce.samples</sys:groupId>
+            <sys:artifactId>MDBDemo</sys:artifactId>
+            <sys:version>2.1.0.0</sys:version>
+            <sys:type>car</sys:type>
+        </sys:moduleId>
+        <sys:dependencies>
+            <sys:dependency>
+                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
+                <sys:artifactId>activemq-ra</sys:artifactId>
+                <sys:type>car</sys:type>
+            </sys:dependency>
+        </sys:dependencies>
+        <sys:hidden-classes/>
+        <sys:non-overridable-classes/>
+    </sys:environment>
+
+    <enterprise-beans>
+        <message-driven>
+            <ejb-name>SampleMDB</ejb-name>
+            <nam:resource-adapter>
+                <nam:resource-link>ActiveMQ RA</nam:resource-link>
+            </nam:resource-adapter>
+            <activation-config>
+                <activation-config-property>
+                    <activation-config-property-name>destination</activation-config-property-name>
+                    <activation-config-property-value>SendReceiveQueue</activation-config-property-value>
+                </activation-config-property>
+                <activation-config-property>
+                    <activation-config-property-name>destinationType</activation-config-property-name>
+                    <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
+                </activation-config-property>
+            </activation-config>
+            <nam:ejb-ref>
+                <nam:ref-name>CustomerHomeRemote</nam:ref-name>
+                <nam:ejb-link>CustomerEJB</nam:ejb-link>
+            </nam:ejb-ref>
+        </message-driven>
+    
+        <entity>
+            <ejb-name>CustomerEJB</ejb-name>
+            <jndi-name>CustomerHomeRemote</jndi-name>
+            <local-jndi-name/>
+            <nam:resource-ref>
+                <nam:ref-name>jdbc/ibm-demo</nam:ref-name>
+                <nam:resource-link>SystemDatasource</nam:resource-link>
+            </nam:resource-ref>
+        </entity>
+    </enterprise-beans>
+
+</openejb-jar>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-3.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml?rev=671363&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
Tue Jun 24 15:02:37 2008
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<!-- @version $Rev$ $Date$ -->
+
+<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"
+             xmlns:nam="http://geronimo.apache.org/xml/ns/naming"
+             xmlns:sec="http://geronimo.apache.org/xml/ns/security"
+             xmlns:sys="http://geronimo.apache.org/xml/ns/deployment">
+             
+    <sys:environment>
+        <sys:moduleId>
+            <sys:groupId>com.ibm.wasce.samples</sys:groupId>
+            <sys:artifactId>MDBDemo</sys:artifactId>
+            <sys:version>2.1.0.0</sys:version>
+            <sys:type>car</sys:type>
+        </sys:moduleId>
+        <sys:dependencies>
+            <sys:dependency>
+                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
+                <sys:artifactId>activemq-ra</sys:artifactId>
+                <sys:type>car</sys:type>
+            </sys:dependency>
+        </sys:dependencies>
+        <sys:hidden-classes/>
+        <sys:non-overridable-classes/>
+    </sys:environment>
+
+    <enterprise-beans>
+        <message-driven>
+            <ejb-name>SampleMDB</ejb-name>
+            <nam:resource-adapter>
+                <nam:resource-link>ActiveMQ RA</nam:resource-link>
+            </nam:resource-adapter>
+            <activation-config>
+                <activation-config-property>
+                    <activation-config-property-name>destination</activation-config-property-name>
+                    <activation-config-property-value>SendReceiveQueue</activation-config-property-value>
+                </activation-config-property>
+                <activation-config-property>
+                    <activation-config-property-name>destinationType</activation-config-property-name>
+                    <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
+                </activation-config-property>
+            </activation-config>
+            <nam:ejb-ref>
+                <nam:ref-name>CustomerHomeRemote</nam:ref-name>
+                <nam:ejb-link>CustomerEJB</nam:ejb-link>
+            </nam:ejb-ref>
+        </message-driven>
+    
+        <entity>
+            <ejb-name>CustomerEJB</ejb-name>
+            <jndi-name>CustomerHomeRemote</jndi-name>
+            <local-jndi-name/>
+            <nam:resource-ref>
+                <nam:ref-name>jdbc/ibm-demo</nam:ref-name>
+                <nam:resource-link>SystemDatasource</nam:resource-link>
+            </nam:resource-ref>
+        </entity>
+    </enterprise-beans>
+
+</openejb-jar>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-example-4.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml?rev=671363&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
Tue Jun 24 15:02:37 2008
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<!-- @version $Rev$ $Date$ -->
+
+<ejb:openejb-jar xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2" xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+    <dep:environment>
+        <dep:moduleId>
+            <dep:groupId>com.ibm.wasce.samples</dep:groupId>
+            <dep:artifactId>MDBDemo</dep:artifactId>
+            <dep:version>2.1.0.0</dep:version>
+            <dep:type>car</dep:type>
+        </dep:moduleId>
+        <dep:dependencies>
+            <dep:dependency>
+                <dep:groupId>org.apache.geronimo.configs</dep:groupId>
+                <dep:artifactId>activemq-ra</dep:artifactId>
+                <dep:type>car</dep:type>
+            </dep:dependency>
+        </dep:dependencies>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+    </dep:environment>
+    <ejb:enterprise-beans>
+        <ejb:message-driven>
+            <ejb:ejb-name>SampleMDB</ejb:ejb-name>
+            <name:resource-adapter>
+                <name:resource-link>ActiveMQ RA</name:resource-link>
+            </name:resource-adapter>
+            <ejb:activation-config>
+                <ejb:activation-config-property>
+                    <ejb:activation-config-property-name>destination</ejb:activation-config-property-name>
+                    <ejb:activation-config-property-value>SendReceiveQueue</ejb:activation-config-property-value>
+                </ejb:activation-config-property>
+                <ejb:activation-config-property>
+                    <ejb:activation-config-property-name>destinationType</ejb:activation-config-property-name>
+                    <ejb:activation-config-property-value>javax.jms.Queue</ejb:activation-config-property-value>
+                </ejb:activation-config-property>
+            </ejb:activation-config>
+            <name:ejb-ref>
+                <name:ref-name>CustomerHomeRemote</name:ref-name>
+                <name:ejb-link>CustomerEJB</name:ejb-link>
+            </name:ejb-ref>
+        </ejb:message-driven>
+        <ejb:entity>
+            <ejb:ejb-name>CustomerEJB</ejb:ejb-name>
+            <ejb:jndi-name>CustomerHomeRemote</ejb:jndi-name>
+            <ejb:local-jndi-name></ejb:local-jndi-name>
+            <name:resource-ref>
+                <name:ref-name>jdbc/ibm-demo</name:ref-name>
+                <name:resource-link>SystemDatasource</name:resource-link>
+            </name:resource-ref>
+        </ejb:entity>
+    </ejb:enterprise-beans>
+</ejb:openejb-jar>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/openejb-jar-expected-3.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/NamespaceFilter.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/NamespaceFilter.java?rev=671363&r1=671362&r2=671363&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/NamespaceFilter.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/jaxb/NamespaceFilter.java
Tue Jun 24 15:02:37 2008
@@ -41,35 +41,95 @@
     private static Map<String, String> namespace = new HashMap<String, String>();
 
     static {
+        // 
+        // Convert old deployment namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/deployment", 
+                      "http://geronimo.apache.org/xml/ns/deployment-1.2");
+        namespace.put("http://geronimo.apache.org/xml/ns/deployment-1.0", 
+                      "http://geronimo.apache.org/xml/ns/deployment-1.2");
         namespace.put("http://geronimo.apache.org/xml/ns/deployment-1.1", 
                       "http://geronimo.apache.org/xml/ns/deployment-1.2");
 
+        // 
+        // Convert old application namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-2.0");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-1.1", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-2.0");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-1.2", 
                       "http://geronimo.apache.org/xml/ns/j2ee/application-2.0");
 
+        // 
+        // Convert old application-client namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-client", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-client-1.2", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1", 
                       "http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0");
 
+        // 
+        // Convert old connector namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/connector", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/connector-1.0", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/connector-1.1", 
                       "http://geronimo.apache.org/xml/ns/j2ee/connector-1.2");
 
+        // 
+        // Convert old web namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
+        namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.0", 
+                      "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.1", 
                       "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.2", 
                       "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-
         namespace.put("http://geronimo.apache.org/xml/ns/j2ee/web-2.0", 
                       "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
 
+        // 
+        // Convert old naming namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/naming", 
+                      "http://geronimo.apache.org/xml/ns/naming-1.2");
+        namespace.put("http://geronimo.apache.org/xml/ns/naming-1.0", 
+                      "http://geronimo.apache.org/xml/ns/naming-1.2");
         namespace.put("http://geronimo.apache.org/xml/ns/naming-1.1", 
                       "http://geronimo.apache.org/xml/ns/naming-1.2");
 
+        // 
+        // Convert old security namespaces
+        // 
+        namespace.put("http://geronimo.apache.org/xml/ns/security", 
+                      "http://geronimo.apache.org/xml/ns/security-2.0");
         namespace.put("http://geronimo.apache.org/xml/ns/security-1.1", 
                       "http://geronimo.apache.org/xml/ns/security-2.0");
-
         namespace.put("http://geronimo.apache.org/xml/ns/security-1.2", 
                       "http://geronimo.apache.org/xml/ns/security-2.0");
+
+        // 
+        // Convert old openejb-jar namespaces 
+        // 
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar-2.1", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar-2.2", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/openejb-jar-2.3", 
+                      "http://openejb.apache.org/xml/ns/openejb-jar-2.2");
+        namespace.put("http://www.openejb.org/xml/ns/pkgen", 
+                      "http://openejb.apache.org/xml/ns/pkgen-2.1");
+        namespace.put("http://www.openejb.org/xml/ns/pkgen-2.0",
+                      "http://openejb.apache.org/xml/ns/pkgen-2.1");
     }
 
     public NamespaceFilter(XMLReader xmlReader) {



Mime
View raw message