geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r646905 - in /geronimo/devtools/eclipse-plugin/trunk: ./ plugins/org.apache.geronimo.deployment.v21.jaxbmodel/ plugins/org.apache.geronimo.deployment.v21.jaxbmodel/META-INF/ plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/ plu...
Date Thu, 10 Apr 2008 18:06:05 GMT
Author: mcconne
Date: Thu Apr 10 11:05:44 2008
New Revision: 646905

URL: http://svn.apache.org/viewvc?rev=646905&view=rev
Log:
GERONIMODEVTOOLS-311 Initial set of junit testcases for v21 JAXB model

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-3.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-3.xml   (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/.classpath
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/pom.xml

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/.classpath
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/.classpath?rev=646905&r1=646904&r2=646905&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/.classpath (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/.classpath Thu Apr 10 11:05:44 2008
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="var" path="M2_REPO/xmlunit/xmlunit/1.1/xmlunit-1.1.jar"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/META-INF/MANIFEST.MF?rev=646905&r1=646904&r2=646905&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/META-INF/MANIFEST.MF Thu Apr 10 11:05:44 2008
@@ -18,3 +18,4 @@
  org.apache.geronimo.jee.persistence,
  org.apache.geronimo.jee.security,
  org.apache.geronimo.jee.web
+Import-Package: junit.framework;version="3.8.2"

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/pom.xml?rev=646905&r1=646904&r2=646905&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/pom.xml Thu Apr 10 11:05:44 2008
@@ -44,6 +44,21 @@
             <groupId>com.sun.xml.bind</groupId>
             <artifactId>jaxb-impl</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java Thu Apr 10 11:05:44 2008
@@ -0,0 +1,128 @@
+/*
+ * 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.jee.application;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.apache.geronimo.jee.deployment.Module;
+import org.custommonkey.xmlunit.Diff;
+import org.xml.sax.InputSource;
+
+/**
+ * <strong>GeronimoApplicationTest</strong> is used to test various JAXB 
+ * operations on the following Geronimo-specific XML file supported by the GEP:
+ * 
+ * <ul>
+ *      <li>geronimo-application.xml
+ * </ul>
+ * 
+ * <p>The following JAXB operations are performed: 
+ * <ol>
+ *      <li>Unmarshalling and marshalling sequence
+ * </ol>
+ * 
+ * 
+ * @version $Rev$ $Date$  
+ */
+public class GeronimoApplicationTest extends TestCase {
+
+    public void testUnmarshallMarshall() throws Exception {
+
+    	unmarshallAndMarshall("application/geronimo-application-example-1.xml", 
+                              "application/geronimo-application-expected-1.xml");
+    	
+    	unmarshallAndMarshall("application/geronimo-application-example-2.xml", 
+                           	  "application/geronimo-application-expected-2.xml");
+    	
+    	unmarshallAndMarshall("application/geronimo-application-example-3.xml", 
+                           	  "application/geronimo-application-expected-3.xml");
+    }
+
+    private void unmarshallAndMarshall(String fileExample, String fileExpected) throws Exception {
+
+        // 
+        // Create unmarshaller and marshaller
+        // 
+        JAXBContext jAXBContext = JAXBContext.newInstance(Application.class,Module.class);
+        Unmarshaller unmarshaller = jAXBContext.createUnmarshaller();
+        Marshaller marshaller = jAXBContext.createMarshaller();
+        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+
+        // 
+        // 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
+        // 
+        // Note: Use InputSource (instead of InputStream) to prevent 
+        //       "org.xml.sax.SAXParseException: Premature end of file." exceptions
+        // 
+        Object jAXBElement = unmarshaller.unmarshal(new InputSource(new ByteArrayInputStream(example.getBytes())));
+
+        // 
+        // 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] " + '\n' + example + '\n');
+            System.out.println("[Expected XML] " + '\n' + expected + '\n');
+            System.out.println("[Actual XML] " + '\n' + actual + '\n');
+            throw e;            
+        }
+    }
+
+    private String readContent(InputStream in) throws IOException {
+        StringBuffer sb = new StringBuffer();
+        in = new BufferedInputStream(in);
+        int i = in.read();
+        while (i != -1) {
+            sb.append((char) i);
+            i = in.read();
+        }
+        String content = sb.toString();
+        return content;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml Thu Apr 10 11:05:44 2008
@@ -0,0 +1,31 @@
+<?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$ -->
+
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
+             xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+    <dep:environment>
+        <dep:moduleId>
+            <dep:groupId>org.apache.geronimo.testsuite</dep:groupId>
+            <dep:artifactId>corba-mytime-ear</dep:artifactId>
+            <dep:version>2.2-SNAPSHOT</dep:version>
+            <dep:type>car</dep:type>
+        </dep:moduleId>
+    </dep:environment>
+</application>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-1.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml Thu Apr 10 11:05:44 2008
@@ -0,0 +1,38 @@
+<?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$ -->
+
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+        <moduleId>
+            <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+            <artifactId>agent-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+                <artifactId>agent-ds</artifactId>
+                <version>2.2-SNAPSHOT</version>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+</application>

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-3.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-3.xml?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-3.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-example-3.xml Thu Apr 10 11:05:44 2008
@@ -0,0 +1,177 @@
+<?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$ -->
+
+<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+
+    <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
+        <moduleId>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>jca-cms-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.configs</groupId>
+                <artifactId>system-database</artifactId>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+
+    <module>
+        <connector>tranql.rar</connector>
+        <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
+            <resourceadapter>
+                <outbound-resourceadapter>
+                    <connection-definition>
+                        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+                        <connectiondefinition-instance>
+                            <name>cmsds</name>
+                            <!--<config-property-setting name="UserName"></config-property-setting>-->
+                            <!--<config-property-setting name="Password"></config-property-setting>-->
+                            <config-property-setting name="DatabaseName">TestDatabase</config-property-setting>
+                            <config-property-setting name="CreateDatabase">false</config-property-setting>
+                            <connectionmanager>
+                                <container-managed-security/>
+                                <xa-transaction>
+                                    <transaction-caching/>
+                                </xa-transaction>
+                                <single-pool>
+                                    <max-size>10</max-size>
+                                    <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                                    <select-one-assume-match/>
+                                </single-pool>
+                            </connectionmanager>
+                        </connectiondefinition-instance>
+                        <connectiondefinition-instance>
+                            <name>configuredsecurityds</name>
+                            <config-property-setting name="UserName">system</config-property-setting>
+                            <config-property-setting name="Password">manager</config-property-setting>
+                            <config-property-setting name="DatabaseName">TestDatabase</config-property-setting>
+                            <config-property-setting name="CreateDatabase">true</config-property-setting>
+                            <connectionmanager>
+                                <xa-transaction>
+                                    <transaction-caching/>
+                                </xa-transaction>
+                                <single-pool>
+                                    <max-size>10</max-size>
+                                    <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                                    <select-one-assume-match/>
+                                </single-pool>
+                            </connectionmanager>
+                        </connectiondefinition-instance>
+                    </connection-definition>
+                </outbound-resourceadapter>
+            </resourceadapter>
+            <gbean name="test-cms-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
+                <attribute name="realmName">test-cms-realm</attribute>
+                <xml-reference name="LoginModuleConfiguration" xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
+                    <lc:login-config>
+                        <lc:login-module-ref control-flag="REQUIRED">
+                            <lc:pattern>
+                                <name xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">test-cms-credentials
+                                </name>
+                            </lc:pattern>
+                        </lc:login-module-ref>
+                        <lc:login-module control-flag="REQUIRED" wrap-principals="false">
+                            <lc:login-domain-name>test-app-credentials</lc:login-domain-name>
+                            <lc:login-module-class>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule</lc:login-module-class>
+                            <lc:option name="usersURI">var/security/demo_users.properties</lc:option>
+                            <lc:option name="groupsURI">var/security/demo_groups.properties</lc:option>
+                        </lc:login-module>
+                    </lc:login-config>
+                </xml-reference>
+                <reference name="ServerInfo">
+                    <name>ServerInfo</name>
+                </reference>
+            </gbean>
+            <gbean name="test-cms-credentials"
+                   class="org.apache.geronimo.connector.outbound.security.PasswordCredentialLoginModuleWrapperGBean">
+                <attribute name="loginModuleClass">
+                    org.apache.geronimo.connector.outbound.security.CallerIdentityPasswordCredentialLoginModule
+                </attribute>
+                <reference name="ManagedConnectionFactoryWrapper">
+                    <name>cmsds</name>
+                </reference>
+                <attribute name="loginDomainName">test-cms-credentials</attribute>
+            </gbean>
+        </connector>
+    </module>
+    <module>
+        <web>web.war</web>
+        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0">
+            <security-realm-name>test-cms-realm</security-realm-name>
+            <security xmlns="http://geronimo.apache.org/xml/ns/security-2.0">
+                <credential-store-ref>
+                    <name xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">test-credential-store</name>
+                </credential-store-ref>
+                <default-subject>
+                    <realm>test-cms-realm</realm>
+                    <id>test</id>
+                </default-subject>
+                <role-mappings>
+                    <role role-name="test">
+                        <principal class="org.apache.geronimo.connector.outbound.security.ResourcePrincipal" name="george"/>
+                    </role>
+                    <role role-name="fail">
+                        <run-as-subject>
+                            <realm>test-cms-realm</realm>
+                            <id>fail</id>
+                        </run-as-subject>
+                    </role>
+                </role-mappings>
+            </security>
+        </web-app>
+    </module>
+    <gbean name="test-credential-store" class="org.apache.geronimo.security.credentialstore.SimpleCredentialStoreImpl">
+        <xml-attribute name="credentialStore">
+            <credential-store xmlns="http://geronimo.apache.org/xml/ns/credentialstore-1.0">
+                <realm name="test-cms-realm">
+                    <subject>
+                        <id>test</id>
+                        <credential>
+                            <type>org.apache.geronimo.security.credentialstore.NameCallbackHandler</type>
+                            <value>george</value>
+                        </credential>
+                        <credential>
+                            <type>org.apache.geronimo.security.credentialstore.PasswordCallbackHandler</type>
+                            <value>bone</value>
+                        </credential>
+                    </subject>
+                    <subject>
+                        <id>fail</id>
+                        <credential>
+                            <type>org.apache.geronimo.security.credentialstore.NameCallbackHandler</type>
+                            <value>gracie</value>
+                        </credential>
+                        <credential>
+                            <type>org.apache.geronimo.security.credentialstore.PasswordCallbackHandler</type>
+                            <value>biscuit</value>
+                        </credential>
+                    </subject>
+                </realm>
+            </credential-store>
+        </xml-attribute>
+        <dependency>
+            <name>test-cms-realm</name>
+        </dependency>
+    </gbean>
+</application>

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml Thu Apr 10 11:05:44 2008
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+    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$ -->
+
+<ns2:application xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>corba-mytime-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>car</type>
+        </moduleId>
+    </environment>
+</ns2:application>
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-1.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml Thu Apr 10 11:05:44 2008
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!--
+    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$ -->
+<ns2:application xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+            <artifactId>agent-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+                <artifactId>agent-ds</artifactId>
+                <version>2.2-SNAPSHOT</version>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+</ns2:application>
\ No newline at end of file

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-3.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-3.xml?rev=646905&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-3.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.deployment.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-3.xml Thu Apr 10 11:05:44 2008
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!--
+    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$ -->
+<ns2:application xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>jca-cms-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.configs</groupId>
+                <artifactId>system-database</artifactId>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+    <ns2:module>
+        <ns2:connector>tranql.rar</ns2:connector>
+        <connector:connector xmlns:connector="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
+            <connector:resourceadapter>
+                <connector:outbound-resourceadapter>
+                    <connector:connection-definition>
+                        <connector:connectionfactory-interface>javax.sql.DataSource</connector:connectionfactory-interface>
+                        <connector:connectiondefinition-instance>
+                            <connector:name>cmsds</connector:name>
+                            <connector:config-property-setting xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" name="DatabaseName">TestDatabase</connector:config-property-setting>
+                            <connector:config-property-setting xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" name="CreateDatabase">false</connector:config-property-setting>
+                            <connector:connectionmanager>
+                                <connector:container-managed-security/>
+                                <connector:xa-transaction>
+                                    <connector:transaction-caching/>
+                                </connector:xa-transaction>
+                                <connector:single-pool>
+                                    <connector:max-size>10</connector:max-size>
+                                    <connector:blocking-timeout-milliseconds>5000</connector:blocking-timeout-milliseconds>
+                                    <connector:select-one-assume-match/>
+                                </connector:single-pool>
+                            </connector:connectionmanager>
+                        </connector:connectiondefinition-instance>
+                        <connector:connectiondefinition-instance>
+                            <connector:name>configuredsecurityds</connector:name>
+                            <connector:config-property-setting xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" name="UserName">system</connector:config-property-setting>
+                            <connector:config-property-setting xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" name="Password">manager</connector:config-property-setting>
+                            <connector:config-property-setting xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" name="DatabaseName">TestDatabase</connector:config-property-setting>
+                            <connector:config-property-setting xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" name="CreateDatabase">true</connector:config-property-setting>
+                            <connector:connectionmanager>
+                                <connector:xa-transaction>
+                                    <connector:transaction-caching/>
+                                </connector:xa-transaction>
+                                <connector:single-pool>
+                                    <connector:max-size>10</connector:max-size>
+                                    <connector:blocking-timeout-milliseconds>5000</connector:blocking-timeout-milliseconds>
+                                    <connector:select-one-assume-match/>
+                                </connector:single-pool>
+                            </connector:connectionmanager>
+                        </connector:connectiondefinition-instance>
+                    </connector:connection-definition>
+                </connector:outbound-resourceadapter>
+            </connector:resourceadapter>
+            <connector:gbean xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" class="org.apache.geronimo.security.realm.GenericSecurityRealm" name="test-cms-realm">
+                <connector:attribute name="realmName">test-cms-realm</connector:attribute>
+                <connector:xml-reference xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.1" name="LoginModuleConfiguration">
+                    <lc:login-config>
+                        <lc:login-module-ref control-flag="REQUIRED">
+                            <lc:pattern>
+                                <ns4:name>test-cms-credentials
+                                </ns4:name>
+                            </lc:pattern>
+                        </lc:login-module-ref>
+                        <lc:login-module control-flag="REQUIRED" wrap-principals="false">
+                            <lc:login-domain-name>test-app-credentials</lc:login-domain-name>
+                            <lc:login-module-class>org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule</lc:login-module-class>
+                            <lc:option name="usersURI">var/security/demo_users.properties</lc:option>
+                            <lc:option name="groupsURI">var/security/demo_groups.properties</lc:option>
+                        </lc:login-module>
+                    </lc:login-config>
+                </connector:xml-reference>
+                <connector:reference name="ServerInfo">
+                    <connector:name>ServerInfo</connector:name>
+                </connector:reference>
+            </connector:gbean>
+            <connector:gbean xmlns:ns4="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" class="org.apache.geronimo.connector.outbound.security.PasswordCredentialLoginModuleWrapperGBean" name="test-cms-credentials">
+                <connector:attribute name="loginModuleClass">
+                    org.apache.geronimo.connector.outbound.security.CallerIdentityPasswordCredentialLoginModule
+                </connector:attribute>
+                <connector:reference name="ManagedConnectionFactoryWrapper">
+                    <connector:name>cmsds</connector:name>
+                </connector:reference>
+                <connector:attribute name="loginDomainName">test-cms-credentials</connector:attribute>
+            </connector:gbean>
+        </connector:connector>
+    </ns2:module>
+    <ns2:module>
+        <ns2:web>web.war</ns2:web>
+        <web-app:web-app xmlns:web-app="http://geronimo.apache.org/xml/ns/j2ee/web-2.0">
+            <web-app:security-realm-name>test-cms-realm</web-app:security-realm-name>
+            <security:security xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0">
+                <security:credential-store-ref>
+                    <name>test-credential-store</name>
+                </security:credential-store-ref>
+                <security:default-subject>
+                    <security:realm>test-cms-realm</security:realm>
+                    <security:id>test</security:id>
+                </security:default-subject>
+                <security:role-mappings>
+                    <security:role xmlns:ns5="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" role-name="test">
+                        <security:principal class="org.apache.geronimo.connector.outbound.security.ResourcePrincipal" name="george"/>
+                    </security:role>
+                    <security:role xmlns:ns5="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns="" role-name="fail">
+                        <security:run-as-subject>
+                            <security:realm>test-cms-realm</security:realm>
+                            <security:id>fail</security:id>
+                        </security:run-as-subject>
+                    </security:role>
+                </security:role-mappings>
+            </security:security>
+        </web-app:web-app>
+    </ns2:module>
+</ns2:application>

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

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

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

Modified: geronimo/devtools/eclipse-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/pom.xml?rev=646905&r1=646904&r2=646905&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/pom.xml Thu Apr 10 11:05:44 2008
@@ -111,6 +111,7 @@
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
                 <version>3.8.1</version>
+                <scope>compile</scope>
             </dependency>
                         
             <dependency>
@@ -189,12 +190,19 @@
                 <version>1.0.1</version>
             </dependency>
 
+            <dependency>
+                <groupId>xmlunit</groupId>
+                <artifactId>xmlunit</artifactId>
+                <version>1.1</version>
+                <scope>test</scope>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
                         
     <build>
         <defaultGoal>install</defaultGoal>
-        <sourceDirectory>src/</sourceDirectory>
+        <sourceDirectory>src/main/</sourceDirectory>
                         
         <pluginManagement>
             <plugins>
@@ -248,6 +256,15 @@
                    <version>1.1</version>
                 </plugin>
                 
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.3</version>
+                    <configuration>
+                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    </configuration>
+                </plugin>
+
             </plugins>
         </pluginManagement>
                 



Mime
View raw message