You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2008/04/21 23:09:44 UTC

svn commit: r650270 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test: java/org/apache/geronimo/jee/application/ java/org/apache/geronimo/jee/connector/ java/org/apache/geronimo/jee/openejb/ java/org/ap...

Author: mcconne
Date: Mon Apr 21 14:09:42 2008
New Revision: 650270

URL: http://svn.apache.org/viewvc?rev=650270&view=rev
Log:
GERONIMODEVTOOLS-266 More JAXB junit testcases from BJ Reed !!

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/connector/geronimo-ra-expected-11.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/geronimo-openejb-expected-11.xml   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/web/geronimo-web-expected-11.xml   (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/connector/GeronimoRaTest.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/GeronimoOpenejbTest.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/web/GeronimoWebTest.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-11.xml

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.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.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java?rev=650270&r1=650269&r2=650270&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/application/GeronimoApplicationTest.java Mon Apr 21 14:09:42 2008
@@ -236,16 +236,15 @@
         application.setApplicationName("test-app-name");
 
         // set the Environment
-        Environment environment = new Environment ();
-        Artifact artifact = new Artifact ();
+        Environment environment = deploymentFactory.createEnvironment();
+        Artifact artifact = deploymentFactory.createArtifact();
         artifact.setGroupId("org.apache.geronimo.testsuite");
         artifact.setArtifactId("agent-ear");
         artifact.setVersion("2.2-SNAPSHOT");
         artifact.setType("ear");
         environment.setModuleId(artifact);
-
-        Dependencies dependencies = new Dependencies ();
-        Dependency dependency = new Dependency ();
+        Dependencies dependencies = deploymentFactory.createDependencies();
+        Dependency dependency = deploymentFactory.createDependency();
         dependency.setGroupId("org.apache.geronimo.testsuite");
         dependency.setArtifactId("agent-ds");
         dependency.setVersion("2.2-SNAPSHOT");
@@ -254,6 +253,7 @@
         environment.setDependencies(dependencies);
         application.setEnvironment(environment);
 
+        // set the Module
         Module module = applicationFactory.createModule();
         Path path = applicationFactory.createPath();
         path.setId("module-altdd-path-id");
@@ -278,6 +278,7 @@
         module.setWeb(path);
         application.getModule().add(module);
 
+        // set the Ext Module
         ExtModule extModule = applicationFactory.createExtModule();
         extModule.setInternalPath("extmodule-internalpath");
 //        module.setAny("module-any"); //TODO
@@ -307,15 +308,13 @@
         extModule.setExternalPath(pattern);
         application.getExtModule().add(extModule);
 
+        // set the Service
         Gbean gbean = deploymentFactory.createGbean();
         gbean.setClazz("gbean-class");
         gbean.setName("gbean-name");
         application.getService().add(deploymentFactory.createGbean(gbean));
 
         // set the Security
-        // TODO: this whole block just gets us <ns2:security/> which can't be correct
-        // also, when adding the security to the application, the marshalling
-        // gives that the types aren't compatible.
         Security security = securityFactory.createSecurity();
         security.setDefaultRole ("security-role");
         security.setDoasCurrentCaller(true);
@@ -378,7 +377,7 @@
         role.getRealmPrincipal().add(realmPrincipal);
         roleMappings.getRole().add(role);
         security.setRoleMappings(roleMappings);
-//        application.setSecurity(securityFactory.createSecurity(security));
+        application.setSecurity(applicationFactory.createSecurity(security));
  
         JAXBElement<Application> jaxbElement = applicationFactory.createApplication(application);
         
@@ -387,6 +386,7 @@
         // 
         JAXBContext jaxbContext = JAXBContext.newInstance( 
                 "org.apache.geronimo.jee.application:" +
+                "org.apache.geronimo.jee.security:" +
                 "org.apache.geronimo.jee.deployment", getClass().getClassLoader() );
         Marshaller marshaller = jaxbContext.createMarshaller();
         marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/connector/GeronimoRaTest.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/connector/GeronimoRaTest.java?rev=650270&r1=650269&r2=650270&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/connector/GeronimoRaTest.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/connector/GeronimoRaTest.java Mon Apr 21 14:09:42 2008
@@ -24,6 +24,7 @@
 import java.io.InputStream;
 
 import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.parsers.SAXParser;
@@ -33,6 +34,13 @@
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.deployment.Gbean;
+import org.apache.geronimo.jee.naming.GbeanLocator;
+import org.apache.geronimo.jee.naming.Pattern;
 import org.custommonkey.xmlunit.Diff;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -53,7 +61,7 @@
  *      <li>Unmarshalling and marshalling sequence
  *      <li>Namespace conversion
  *      <li>Element conversion (TODO)
- *      <li>Create a file (TODO)
+ *      <li>Create XML with all fields
  * </ol>
  * 
  * 
@@ -84,6 +92,9 @@
                          "connector/geronimo-ra-expected-3.xml");
     }
 
+    public void testCompleteXML() throws Exception {
+        buildFullXMLFromScratch("connector/geronimo-ra-expected-11.xml");
+    }
 
     /*------------------------------------------------------------------------*\
     |                                                                          |
@@ -207,6 +218,144 @@
         }
     }
 
+    private void buildFullXMLFromScratch (String fileExpected) throws Exception {
+        org.apache.geronimo.jee.connector.ObjectFactory connectorFactory = new org.apache.geronimo.jee.connector.ObjectFactory();
+        org.apache.geronimo.jee.deployment.ObjectFactory deploymentFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+        org.apache.geronimo.jee.naming.ObjectFactory namingFactory = new org.apache.geronimo.jee.naming.ObjectFactory();
+        Connector connector = connectorFactory.createConnector();
+ 
+        // set the Environment
+        Environment environment = deploymentFactory.createEnvironment();
+        Artifact artifact = deploymentFactory.createArtifact();
+        artifact.setGroupId("org.apache.geronimo.testsuite");
+        artifact.setArtifactId("agent-ear");
+        artifact.setVersion("2.2-SNAPSHOT");
+        artifact.setType("ear");
+        environment.setModuleId(artifact);
+        Dependencies dependencies = deploymentFactory.createDependencies();
+        Dependency dependency = deploymentFactory.createDependency();
+        dependency.setGroupId("org.apache.geronimo.testsuite");
+        dependency.setArtifactId("agent-ds");
+        dependency.setVersion("2.2-SNAPSHOT");
+        dependency.setType("car");
+        dependencies.getDependency().add(dependency);
+        environment.setDependencies(dependencies);
+        connector.setEnvironment (environment);
+
+        // set the Admin Object
+        Adminobject adminobject = connectorFactory.createAdminobject();
+        adminobject.setAdminobjectClass("adminobject-adminobjectclass");
+        adminobject.setAdminobjectInterface("adminobject-adminobjectinterface");
+        AdminobjectInstance adminobjectInstance = connectorFactory.createAdminobjectInstance();
+        adminobjectInstance.setMessageDestinationName("adminobject-instance-messagedestinationname");
+        ConfigPropertySetting configPropertySetting = connectorFactory.createConfigPropertySetting();
+        configPropertySetting.setName("adminobject-instance-name");
+        configPropertySetting.setValue("adminobject-instance-value");
+        adminobjectInstance.getConfigPropertySetting().add(configPropertySetting);
+        adminobject.getAdminobjectInstance().add(adminobjectInstance);
+        connector.getAdminobject().add(adminobject);
+
+        // set the Resource Adapter
+        Resourceadapter resourceadapter = connectorFactory.createResourceadapter();
+        ResourceadapterInstance resourceadapterInstance = connectorFactory.createResourceadapterInstance();
+        resourceadapterInstance.setResourceadapterName("resourceadapter-name");
+        GbeanLocator gbeanLocator = namingFactory.createGbeanLocator();
+        gbeanLocator.setGbeanLink("connector-resourceadapter-workmanager-gbeanlink");
+        Pattern namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("connector-resourceadapter-workmanager-pattern-artifactid");
+        namingPattern.setGroupId("connector-resourceadapter-workmanager-pattern-groupid");
+        namingPattern.setModule("connector-resourceadapter-workmanager-pattern-module");
+        namingPattern.setName("connector-resourceadapter-workmanager-pattern-name");
+        namingPattern.setVersion("connector-resourceadapter-workmanager-pattern-version");
+        gbeanLocator.setPattern(namingPattern);
+        resourceadapterInstance.setWorkmanager(gbeanLocator);
+        configPropertySetting = connectorFactory.createConfigPropertySetting();
+        configPropertySetting.setName("resourceadapter-instance-name");
+        configPropertySetting.setValue("resourceadapter-instance-value");        
+        resourceadapterInstance.getConfigPropertySetting().add(configPropertySetting);
+        resourceadapter.setResourceadapterInstance(resourceadapterInstance);
+        OutboundResourceadapter outboundResourceadapter = connectorFactory.createOutboundResourceadapter();
+        ConnectionDefinition connectionDefinition = connectorFactory.createConnectionDefinition();
+        connectionDefinition.setConnectionfactoryInterface("resourceadapter-outbound-connectiondefinition-interface");
+        ConnectiondefinitionInstance connectionDefinitionInstance = connectorFactory.createConnectiondefinitionInstance();
+        connectionDefinitionInstance.setName("resourceadapter-outbound-connectiondefinition-instance-name");
+        connectionDefinitionInstance.getImplementedInterface().add("resourceadapter-outbound-connectiondefinition-instance-implementedinterface");
+        Connectionmanager connectionManager = connectorFactory.createConnectionmanager();
+        Empty empty = connectorFactory.createEmpty();
+        connectionManager.setContainerManagedSecurity(empty);
+        connectionManager.setLocalTransaction(empty);
+        connectionManager.setNoPool(empty);
+        connectionManager.setNoTransaction(empty);
+        connectionManager.setTransactionLog(empty);
+        Partitionedpool partitionedPool = connectorFactory.createPartitionedpool();
+        partitionedPool.setBlockingTimeoutMilliseconds(new Integer(0));
+        partitionedPool.setIdleTimeoutMinutes(new Integer(0));
+        partitionedPool.setMatchAll(empty);
+        partitionedPool.setMatchOne(empty);
+        partitionedPool.setMaxSize(new Integer(0));
+        partitionedPool.setMinSize(new Integer(0));
+        partitionedPool.setPartitionByConnectionrequestinfo(empty);
+        partitionedPool.setPartitionBySubject(empty);
+        partitionedPool.setSelectOneAssumeMatch(empty);
+        connectionManager.setPartitionedPool(partitionedPool);
+        Singlepool singlePool = connectorFactory.createSinglepool();
+        singlePool.setBlockingTimeoutMilliseconds(new Integer(0));
+        singlePool.setIdleTimeoutMinutes(new Integer(0));
+        singlePool.setMatchAll(empty);
+        singlePool.setMatchOne(empty);
+        singlePool.setMaxSize(new Integer(0));
+        singlePool.setMinSize(new Integer(0));
+        singlePool.setSelectOneAssumeMatch(empty);
+        connectionManager.setPartitionedPool(partitionedPool);
+        connectionManager.setSinglePool(singlePool);
+        Xatransaction xaTransaction = connectorFactory.createXatransaction();
+        xaTransaction.setThreadCaching(empty);
+        xaTransaction.setTransactionCaching(empty);
+        connectionManager.setXaTransaction(xaTransaction);
+        connectionDefinitionInstance.setConnectionmanager(connectionManager);
+        configPropertySetting = connectorFactory.createConfigPropertySetting();
+        configPropertySetting.setName("resourceadapter-outbound-connectiondefinition-instance-name");
+        configPropertySetting.setValue("resourceadapter-outbound-connectiondefinition-instance-value");
+        connectionDefinitionInstance.getConfigPropertySetting().add(configPropertySetting);
+        connectionDefinition.getConnectiondefinitionInstance().add(connectionDefinitionInstance);
+        outboundResourceadapter.getConnectionDefinition().add(connectionDefinition);
+        resourceadapter.setOutboundResourceadapter(outboundResourceadapter);
+        connector.getResourceadapter().add(resourceadapter);
+
+        // set the Service
+        Gbean gbean = deploymentFactory.createGbean();
+        gbean.setClazz("gbean-class");
+        gbean.setName("gbean-name");
+        connector.getService().add(deploymentFactory.createGbean(gbean));
+
+        JAXBElement<Connector> jaxbElement = connectorFactory.createConnector(connector);
+        
+        // 
+        // Marshall the output of the unmarshall
+        // 
+        JAXBContext jaxbContext = JAXBContext.newInstance( 
+                "org.apache.geronimo.jee.connector:" +
+                "org.apache.geronimo.jee.deployment:", getClass().getClassLoader() );
+        Marshaller marshaller = jaxbContext.createMarshaller();
+        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        marshaller.marshal(jaxbElement, baos);
+        String actual = new String(baos.toByteArray());
+
+        InputStream expectedInputStream = this.getClass().getClassLoader().getResourceAsStream(fileExpected);
+        String expected = readContent(expectedInputStream);
+
+        try {
+            Diff myDiff = new Diff(expected, actual);
+            assertTrue("Files are similar " + myDiff, myDiff.similar());
+        }
+        catch (AssertionFailedError e) {
+            System.out.println("Actual XML:\n" + actual + '\n');
+            System.out.println("[Expected XML: " + fileExpected + "]\n" + expected + '\n');
+            throw e;            
+        }
+    }
 
     private String readContent(InputStream in) throws IOException {
         StringBuffer sb = new StringBuffer();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/GeronimoOpenejbTest.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/GeronimoOpenejbTest.java?rev=650270&r1=650269&r2=650270&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/GeronimoOpenejbTest.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/openejb/GeronimoOpenejbTest.java Mon Apr 21 14:09:42 2008
@@ -24,12 +24,30 @@
 import java.io.InputStream;
 
 import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.naming.MessageDestination;
+import org.apache.geronimo.jee.naming.PersistenceUnitRef;
+import org.apache.geronimo.jee.persistence.Persistence;
+import org.apache.geronimo.jee.persistence.PersistenceUnitTransaction;
+import org.apache.geronimo.jee.security.Description;
+import org.apache.geronimo.jee.security.DistinguishedName;
+import org.apache.geronimo.jee.security.LoginDomainPrincipal;
+import org.apache.geronimo.jee.security.Principal;
+import org.apache.geronimo.jee.security.RealmPrincipal;
+import org.apache.geronimo.jee.security.Role;
+import org.apache.geronimo.jee.security.RoleMappings;
+import org.apache.geronimo.jee.security.Security;
+import org.apache.geronimo.jee.security.SubjectInfo;
 import org.custommonkey.xmlunit.Diff;
 import org.xml.sax.InputSource;
 
@@ -46,7 +64,7 @@
  *      <li>Unmarshalling and marshalling sequence
  *      <li>Namespace conversion (TODO)
  *      <li>Element conversion (TODO)
- *      <li>Create a file (TODO)
+ *      <li>Create XML with all fields
  *      <li>openejb-jar.xml testcases (TODO)
  * </ol>
  * 
@@ -67,6 +85,10 @@
                               "openejb/geronimo-openejb-expected-2.xml");
     }
 
+    public void testCompleteXML() throws Exception {
+        buildFullXMLFromScratch("openejb/geronimo-openejb-expected-11.xml");
+    }
+
 
     /*------------------------------------------------------------------------*\
     |                                                                          |
@@ -128,6 +150,203 @@
 
     }
 
+    private void buildFullXMLFromScratch (String fileExpected) throws Exception {
+        org.apache.geronimo.jee.openejb.ObjectFactory openejbFactory = new org.apache.geronimo.jee.openejb.ObjectFactory();
+        org.apache.geronimo.jee.deployment.ObjectFactory deploymentFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+        org.apache.geronimo.jee.naming.ObjectFactory namingFactory = new org.apache.geronimo.jee.naming.ObjectFactory();
+        org.apache.geronimo.jee.persistence.ObjectFactory persistenceFactory = new org.apache.geronimo.jee.persistence.ObjectFactory();
+        org.apache.geronimo.jee.security.ObjectFactory securityFactory = new org.apache.geronimo.jee.security.ObjectFactory();
+        GeronimoEjbJar geronimoEjbJar = openejbFactory.createGeronimoEjbJar();
+
+        // set the Environment
+        Environment environment = deploymentFactory.createEnvironment();
+        Artifact artifact = deploymentFactory.createArtifact();
+        artifact.setGroupId("org.apache.geronimo.testsuite");
+        artifact.setArtifactId("agent-ear");
+        artifact.setVersion("2.2-SNAPSHOT");
+        artifact.setType("ear");
+        environment.setModuleId(artifact);
+        Dependencies dependencies = deploymentFactory.createDependencies();
+        Dependency dependency = deploymentFactory.createDependency();
+        dependency.setGroupId("org.apache.geronimo.testsuite");
+        dependency.setArtifactId("agent-ds");
+        dependency.setVersion("2.2-SNAPSHOT");
+        dependency.setType("car");
+        dependencies.getDependency().add(dependency);
+        environment.setDependencies(dependencies);
+        geronimoEjbJar.setEnvironment (environment);
+        
+        // set the Open EJB Jar TODO
+        //OpenejbJar openejbJar = openejbFactory.createOpenejbJar();
+        //openejbJar.setAny("openejbjar-any");
+        //geronimoEjbJar.setOpenejbJar(openejbJar);
+
+        // set the JNDI Environment Refs Group
+        PersistenceUnitRef persistenceUnitRef = namingFactory.createPersistenceUnitRef();
+        persistenceUnitRef.setPersistenceUnitName("jndienvironmentrefsgroup-persistenceunitref-unitname");
+        persistenceUnitRef.setPersistenceUnitRefName("jndienvironmentrefsgroup-persistenceunitref-unitrefname");
+        org.apache.geronimo.jee.naming.Pattern namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("jndienvironmentrefsgroup-persistenceunitref-pattern-artifactid");
+        namingPattern.setGroupId("jndienvironmentrefsgroup-persistenceunitref-pattern-groupid");
+        namingPattern.setModule("jndienvironmentrefsgroup-persistenceunitref-pattern-module");
+        namingPattern.setName("jndienvironmentrefsgroup-persistenceunitref-pattern-name");
+        namingPattern.setVersion("jndienvironmentrefsgroup-persistenceunitref-pattern-version");
+        persistenceUnitRef.setPattern(namingPattern);
+        geronimoEjbJar.getJndiEnvironmentRefsGroup().add(namingFactory.createAbstractNamingEntry(persistenceUnitRef));
+
+        // set the Message Destination
+        MessageDestination messageDestination = namingFactory.createMessageDestination();
+        messageDestination.setAdminObjectLink("messagedestination-adminobjectlink");
+        messageDestination.setAdminObjectModule("messagedestination-adminobjectmodule");
+        messageDestination.setMessageDestinationName("messagedestination-name");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("messagedestination-pattern-artifactid");
+        namingPattern.setGroupId("messagedestination-pattern-groupid");
+        namingPattern.setModule("messagedestination-pattern-module");
+        namingPattern.setName("messagedestination-pattern-name");
+        namingPattern.setVersion("messagedestination-pattern-version");
+        messageDestination.setPattern(namingPattern);
+        geronimoEjbJar.getMessageDestination().add(messageDestination);
+
+        // set the Service or Persistence
+        Persistence persistence = persistenceFactory.createPersistence();
+        persistence.setVersion("persistence-version");
+        Persistence.PersistenceUnit persistenceUnit = persistenceFactory.createPersistencePersistenceUnit();
+        persistenceUnit.setName("persistence-name");
+        persistenceUnit.setDescription("persistence-description");
+        persistenceUnit.setExcludeUnlistedClasses(true);
+        persistenceUnit.setJtaDataSource("persistence-jtadatasource");
+        persistenceUnit.setNonJtaDataSource("persistence-nonjtadatasource");
+        persistenceUnit.setProvider("persistence-provider");
+        Persistence.PersistenceUnit.Properties properties = persistenceFactory.createPersistencePersistenceUnitProperties();
+        Persistence.PersistenceUnit.Properties.Property property = persistenceFactory.createPersistencePersistenceUnitPropertiesProperty();
+        property.setName("persistence-property-name");
+        property.setValue("persistence-property-value");
+        properties.getProperty().add(property);
+        persistenceUnit.setProperties(properties);
+        persistenceUnit.setTransactionType(PersistenceUnitTransaction.RESOURCE_LOCAL);
+        persistenceUnit.getClazz().add("persistence-clazz");
+        persistenceUnit.getJarFile().add("persistence-jarfile");
+        persistenceUnit.getMappingFile().add("persistence-mappingfile");
+        persistence.getPersistenceUnit().add(persistenceUnit);
+        geronimoEjbJar.getServiceOrPersistence().add(persistence);
+
+        // set the TSS Link
+        TssLink tssLink = openejbFactory.createTssLink();
+        tssLink.setEjbName("tsslink-ejbname");
+        tssLink.setTssName("tsslink-tssname");
+        tssLink.getJndiName().add("tssname-jndiname");
+        geronimoEjbJar.getTssLink().add(tssLink);
+
+        // set the Web Service Binding
+        WebServiceBinding webServiceBinding = openejbFactory.createWebServiceBinding();
+        webServiceBinding.setEjbName("webservicebinding-ejbname");
+        webServiceBinding.setWebServiceAddress("webservicebinding-webserviceaddress");
+        webServiceBinding.getWebServiceVirtualHost().add("webservicebinding-webservicevirtualhost");
+        WebServiceSecurity webServiceSecurity = openejbFactory.createWebServiceSecurity();
+        webServiceSecurity.setRealmName("webservicebinding-webservicesecurity-realmname");
+        webServiceSecurity.setSecurityRealmName("webservicebinding-webservicesecurity-securityrealmname");
+        webServiceSecurity.setAuthMethod(AuthMethod.BASIC);
+        webServiceSecurity.setTransportGuarantee(TransportGuarantee.INTEGRAL);
+        webServiceBinding.setWebServiceSecurity(webServiceSecurity);
+        geronimoEjbJar.getWebServiceBinding().add(webServiceBinding);
+
+        // set the Security
+        Security security = securityFactory.createSecurity();
+        security.setDefaultRole ("security-role");
+        security.setDoasCurrentCaller(true);
+        security.setUseContextHandler(true);
+        org.apache.geronimo.jee.deployment.Pattern pattern = deploymentFactory.createPattern();
+        pattern.setArtifactId("security-credentialstoreref-artifactid");
+        pattern.setCustomFoo("security-credentialstoreref-customfoo");
+        pattern.setGroupId("security-credentialstoreref-groupid");
+        pattern.setModule("security-credentialstoreref-module");
+        pattern.setType("security-credentialstoreref-type");
+        pattern.setVersion("security-credentialstoreref-version");
+        security.setCredentialStoreRef(pattern);
+        SubjectInfo subject = securityFactory.createSubjectInfo();
+        subject.setId("security-subjectinfo-id");
+        subject.setRealm("security-subjectinfo-realm");
+        Description description = securityFactory.createDescription();
+        description.setValue("security-subjectinfo-description");
+        subject.getDescription().add(description);
+        security.setDefaultSubject(subject);
+        RoleMappings roleMappings = securityFactory.createRoleMappings();
+        Role role = securityFactory.createRole();
+        role.setRoleName("security-role");
+        SubjectInfo subjectInfo = securityFactory.createSubjectInfo();
+        subjectInfo.setId("security-role-subjectinfo-id");
+        subjectInfo.setRealm("security-role-subjectinfo-realm");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-subjectinfo-description");
+        subjectInfo.getDescription().add(description);
+        role.setRunAsSubject(subjectInfo);
+        description = securityFactory.createDescription();
+        description.setValue("security-role-description");
+        role.getDescription().add(description);
+        DistinguishedName distinguishedName = securityFactory.createDistinguishedName();
+        distinguishedName.setName("security-role-distinguishedname");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-distinguished-name-description");
+        distinguishedName.getDescription().add(description);
+        role.getDistinguishedName().add(distinguishedName);
+        LoginDomainPrincipal loginDomainPrincipal = securityFactory.createLoginDomainPrincipal();
+        loginDomainPrincipal.setDomainName("security-role-logindomainprincipal-domainname");
+        loginDomainPrincipal.setName("security-role-logindomainprincipal-name");
+        loginDomainPrincipal.setClazz("security-role-logindomainprincipal-class");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-logindomainprincipal-description");
+        loginDomainPrincipal.getDescription().add(description);
+        role.getLoginDomainPrincipal().add(loginDomainPrincipal);
+        Principal principal = securityFactory.createPrincipal();
+        principal.setName("security-role-principal-name");
+        principal.setClazz("security-role-principal-class");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-principal-description");
+        principal.getDescription().add(description);
+        role.getPrincipal().add(principal);
+        RealmPrincipal realmPrincipal = securityFactory.createRealmPrincipal();
+        realmPrincipal.setName("security-role-realmprincipal-name");
+        realmPrincipal.setClazz("security-role-realmprincipal-class");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-realmprincipal-description");
+        realmPrincipal.getDescription().add(description);
+        role.getRealmPrincipal().add(realmPrincipal);
+        roleMappings.getRole().add(role);
+        security.setRoleMappings(roleMappings);
+        geronimoEjbJar.setSecurity(securityFactory.createSecurity(security));
+
+        JAXBElement<GeronimoEjbJar> jaxbElement = openejbFactory.createEjbJar(geronimoEjbJar);
+        
+        // 
+        // Marshall the output of the unmarshall
+        // 
+        JAXBContext jaxbContext = JAXBContext.newInstance( 
+                "org.apache.geronimo.jee.openejb:" +
+                "org.apache.geronimo.jee.application:" +
+                "org.apache.geronimo.jee.deployment:" +
+                "org.apache.geronimo.jee.security:" +
+                "org.apache.geronimo.jee.naming", getClass().getClassLoader() );
+        Marshaller marshaller = jaxbContext.createMarshaller();
+        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        marshaller.marshal(jaxbElement, baos);
+        String actual = new String(baos.toByteArray());
+
+        InputStream expectedInputStream = this.getClass().getClassLoader().getResourceAsStream(fileExpected);
+        String expected = readContent(expectedInputStream);
+
+        try {
+            Diff myDiff = new Diff(expected, actual);
+            assertTrue("Files are similar " + myDiff, myDiff.similar());
+        }
+        catch (AssertionFailedError e) {
+            System.out.println("Actual XML:\n" + actual + '\n');
+            System.out.println("[Expected XML: " + fileExpected + "]\n" + expected + '\n');
+            throw e;            
+        }
+    }
 
     private String readContent(InputStream in) throws IOException {
         StringBuffer sb = new StringBuffer();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/web/GeronimoWebTest.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/web/GeronimoWebTest.java?rev=650270&r1=650269&r2=650270&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/web/GeronimoWebTest.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/java/org/apache/geronimo/jee/web/GeronimoWebTest.java Mon Apr 21 14:09:42 2008
@@ -24,6 +24,7 @@
 import java.io.InputStream;
 
 import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.parsers.SAXParser;
@@ -33,6 +34,32 @@
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.naming.EjbLocalRef;
+import org.apache.geronimo.jee.naming.EjbRef;
+import org.apache.geronimo.jee.naming.GbeanLocator;
+import org.apache.geronimo.jee.naming.MessageDestination;
+import org.apache.geronimo.jee.naming.PersistenceUnitRef;
+import org.apache.geronimo.jee.naming.Port;
+import org.apache.geronimo.jee.naming.PortCompletion;
+import org.apache.geronimo.jee.naming.ResourceEnvRef;
+import org.apache.geronimo.jee.naming.ResourceRef;
+import org.apache.geronimo.jee.naming.ServiceCompletion;
+import org.apache.geronimo.jee.naming.ServiceRef;
+import org.apache.geronimo.jee.persistence.Persistence;
+import org.apache.geronimo.jee.persistence.PersistenceUnitTransaction;
+import org.apache.geronimo.jee.security.Description;
+import org.apache.geronimo.jee.security.DistinguishedName;
+import org.apache.geronimo.jee.security.LoginDomainPrincipal;
+import org.apache.geronimo.jee.security.Principal;
+import org.apache.geronimo.jee.security.RealmPrincipal;
+import org.apache.geronimo.jee.security.Role;
+import org.apache.geronimo.jee.security.RoleMappings;
+import org.apache.geronimo.jee.security.Security;
+import org.apache.geronimo.jee.security.SubjectInfo;
 import org.custommonkey.xmlunit.Diff;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -53,7 +80,7 @@
  *      <li>Unmarshalling and marshalling sequence
  *      <li>Namespace conversion
  *      <li>Element conversion (TODO)
- *      <li>Create a file (TODO)
+ *      <li>Create XML with all fields
  * </ol>
  * 
  * 
@@ -84,6 +111,10 @@
                          "web/geronimo-web-expected-6.xml");
     }
 
+    public void testCompleteXML() throws Exception {
+        buildFullXMLFromScratch("web/geronimo-web-expected-11.xml");
+    }
+
 
     /*------------------------------------------------------------------------*\
     |                                                                          |
@@ -213,6 +244,291 @@
         }
     }
 
+    private void buildFullXMLFromScratch (String fileExpected) throws Exception {
+        org.apache.geronimo.jee.web.ObjectFactory webFactory = new org.apache.geronimo.jee.web.ObjectFactory();
+        org.apache.geronimo.jee.deployment.ObjectFactory deploymentFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+        org.apache.geronimo.jee.naming.ObjectFactory namingFactory = new org.apache.geronimo.jee.naming.ObjectFactory();
+        org.apache.geronimo.jee.persistence.ObjectFactory persistenceFactory = new org.apache.geronimo.jee.persistence.ObjectFactory();
+        org.apache.geronimo.jee.security.ObjectFactory securityFactory = new org.apache.geronimo.jee.security.ObjectFactory();
+        WebApp webApp = webFactory.createWebApp();
+
+        webApp.setContextRoot("contextroot");
+        webApp.setSecurityRealmName("securityrealmname");
+        webApp.setWorkDir("workdir");
+
+        // set the Environment
+        Environment environment = deploymentFactory.createEnvironment();
+        Artifact artifact = deploymentFactory.createArtifact();
+        artifact.setGroupId("org.apache.geronimo.testsuite");
+        artifact.setArtifactId("agent-ear");
+        artifact.setVersion("2.2-SNAPSHOT");
+        artifact.setType("ear");
+        environment.setModuleId(artifact);
+        Dependencies dependencies = deploymentFactory.createDependencies();
+        Dependency dependency = deploymentFactory.createDependency();
+        dependency.setGroupId("org.apache.geronimo.testsuite");
+        dependency.setArtifactId("agent-ds");
+        dependency.setVersion("2.2-SNAPSHOT");
+        dependency.setType("car");
+        dependencies.getDependency().add(dependency);
+        environment.setDependencies(dependencies);
+        webApp.setEnvironment(environment);
+
+        // set the Container Config TODO
+        //ContainerConfig containerConfig = webFactory.createContainerConfig();
+        //containerConfig.getAny().add("containerconfig-any");
+        //webApp.setContainerConfig(containerConfig);
+
+        // set the GBean Locator
+        GbeanLocator gbeanLocator = namingFactory.createGbeanLocator();
+        gbeanLocator.setGbeanLink("gbeanlocator-gbeanlink");
+        org.apache.geronimo.jee.naming.Pattern namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("gbeanlocator-pattern-artifactid");
+        namingPattern.setGroupId("gbeanlocator-pattern-groupid");
+        namingPattern.setModule("gbeanlocator-pattern-module");
+        namingPattern.setName("gbeanlocator-pattern-name");
+        namingPattern.setVersion("gbeanlocator-pattern-version");
+        gbeanLocator.setPattern(namingPattern);
+        webApp.setWebContainer(gbeanLocator);
+
+        // set the Abstract Naming Entry
+        PersistenceUnitRef persistenceUnitRef = namingFactory.createPersistenceUnitRef();
+        persistenceUnitRef.setPersistenceUnitName("persistenceunitref-unitname");
+        persistenceUnitRef.setPersistenceUnitRefName("persistenceunitref-unitrefname");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("persistenceunitref-pattern-artifactid");
+        namingPattern.setGroupId("persistenceunitref-pattern-groupid");
+        namingPattern.setModule("persistenceunitref-pattern-module");
+        namingPattern.setName("persistenceunitref-pattern-name");
+        namingPattern.setVersion("persistenceunitref-pattern-version");
+        persistenceUnitRef.setPattern(namingPattern);
+        webApp.getAbstractNamingEntry().add(namingFactory.createAbstractNamingEntry(persistenceUnitRef));
+
+        // set the EJB Local Ref
+        EjbLocalRef ejbLocalRef = namingFactory.createEjbLocalRef();
+        ejbLocalRef.setRefName("ejblocalref-refname");
+        ejbLocalRef.setEjbLink("ejblocalref-ejblink");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("ejblocalref-pattern-artifactid");
+        namingPattern.setGroupId("ejblocalref-pattern-groupid");
+        namingPattern.setModule("ejblocalref-pattern-module");
+        namingPattern.setName("ejblocalref-pattern-name");
+        namingPattern.setVersion("ejblocalref-pattern-version");
+        ejbLocalRef.setPattern(namingPattern);
+        webApp.getEjbLocalRef().add(ejbLocalRef);
+
+        // set the EJB Ref
+        EjbRef ejbRef = namingFactory.createEjbRef();
+        ejbRef.setName("ejbref-name");
+        ejbRef.setRefName("ejbref-refname");
+        ejbRef.setCssLink("ejbref-csslink");
+        ejbRef.setEjbLink("ejbref-ejblink");
+        ejbRef.setNsCorbaloc("ejbref-nscorbaloc");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("ejbref-css-artifactid");
+        namingPattern.setGroupId("ejbref-css-groupid");
+        namingPattern.setModule("ejbref-css-module");
+        namingPattern.setName("ejbref-css-name");
+        namingPattern.setVersion("ejbref-css-version");
+        ejbRef.setCss(namingPattern);
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("ejbref-pattern-artifactid");
+        namingPattern.setGroupId("ejbref-pattern-groupid");
+        namingPattern.setModule("ejbref-pattern-module");
+        namingPattern.setName("ejbref-pattern-name");
+        namingPattern.setVersion("ejbref-pattern-version");
+        ejbRef.setPattern(namingPattern);
+        webApp.getEjbRef().add(ejbRef);
+        
+        // set the Message Destination
+        MessageDestination messageDestination = namingFactory.createMessageDestination();
+        messageDestination.setAdminObjectLink("messagedestination-adminobjectlink");
+        messageDestination.setAdminObjectModule("messagedestination-adminobjectmodule");
+        messageDestination.setMessageDestinationName("messagedestination-name");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("messagedestination-pattern-artifactid");
+        namingPattern.setGroupId("messagedestination-pattern-groupid");
+        namingPattern.setModule("messagedestination-pattern-module");
+        namingPattern.setName("messagedestination-pattern-name");
+        namingPattern.setVersion("messagedestination-pattern-version");
+        messageDestination.setPattern(namingPattern);
+        webApp.getMessageDestination().add(messageDestination);
+
+        // set the Resource Env Ref
+        ResourceEnvRef resourceEnvRef = namingFactory.createResourceEnvRef();
+        resourceEnvRef.setAdminObjectLink("resourceenvref-adminobjectlink");
+        resourceEnvRef.setAdminObjectModule("resourceenvref-adminobjectmodule");
+        resourceEnvRef.setMessageDestinationLink("resourceenvref-messagedestinationlink");
+        resourceEnvRef.setRefName("resourceenvref-refname");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("resourceenvref-pattern-artifactid");
+        namingPattern.setGroupId("resourceenvref-pattern-groupid");
+        namingPattern.setModule("resourceenvref-pattern-module");
+        namingPattern.setName("resourceenvref-pattern-name");
+        namingPattern.setVersion("resourceenvref-pattern-version");
+        resourceEnvRef.setPattern(namingPattern);
+        webApp.getResourceEnvRef().add(resourceEnvRef);
+
+        // set the Resource Ref
+        ResourceRef resourceRef = namingFactory.createResourceRef();
+        resourceRef.setRefName("resourceref-refname");
+        resourceRef.setResourceLink("resourceref-resourcelink");
+        resourceRef.setUrl("resourceref-url");
+        namingPattern = namingFactory.createPattern();
+        namingPattern.setArtifactId("resourceref-pattern-artifactid");
+        namingPattern.setGroupId("resourceref-pattern-groupid");
+        namingPattern.setModule("resourcref-pattern-module");
+        namingPattern.setName("resourceref-pattern-name");
+        namingPattern.setVersion("resourceref-pattern-version");
+        resourceRef.setPattern(namingPattern);
+        webApp.getResourceRef().add(resourceRef);
+
+        // set the Service or Persistence
+        Persistence persistence = persistenceFactory.createPersistence();
+        persistence.setVersion("persistence-version");
+        Persistence.PersistenceUnit persistenceUnit = persistenceFactory.createPersistencePersistenceUnit();
+        persistenceUnit.setName("persistence-name");
+        persistenceUnit.setDescription("persistence-description");
+        persistenceUnit.setExcludeUnlistedClasses(true);
+        persistenceUnit.setJtaDataSource("persistence-jtadatasource");
+        persistenceUnit.setNonJtaDataSource("persistence-nonjtadatasource");
+        persistenceUnit.setProvider("persistence-provider");
+        Persistence.PersistenceUnit.Properties properties = persistenceFactory.createPersistencePersistenceUnitProperties();
+        Persistence.PersistenceUnit.Properties.Property property = persistenceFactory.createPersistencePersistenceUnitPropertiesProperty();
+        property.setName("persistence-property-name");
+        property.setValue("persistence-property-value");
+        properties.getProperty().add(property);
+        persistenceUnit.setProperties(properties);
+        persistenceUnit.setTransactionType(PersistenceUnitTransaction.RESOURCE_LOCAL);
+        persistenceUnit.getClazz().add("persistence-clazz");
+        persistenceUnit.getJarFile().add("persistence-jarfile");
+        persistenceUnit.getMappingFile().add("persistence-mappingfile");
+        persistence.getPersistenceUnit().add(persistenceUnit);
+        webApp.getServiceOrPersistence().add(persistence);
+
+        // set the Service Ref
+        ServiceRef serviceRef = namingFactory.createServiceRef();
+        serviceRef.setServiceRefName("serviceref-refname");
+        ServiceCompletion serviceCompletion = namingFactory.createServiceCompletion();
+        serviceCompletion.setServiceName("serviceref-servicecompletion-servicename");
+        PortCompletion portCompletion = namingFactory.createPortCompletion();
+        portCompletion.setBindingName("serviceref-servicecompletion-portcompletion-bindingname");
+        Port port = namingFactory.createPort();
+        port.setCredentialsName("serviceref-servicecompletion-portcompletion-port-credentialsname");
+        port.setHost("serviceref-servicecompletion-portcompletion-port-host");
+        port.setPort(new Integer(0));
+        port.setPortName("serviceref-servicecompletion-portcompletion-port-portname");
+        port.setProtocol("serviceref-servicecompletion-portcompletion-port-protocol");
+        port.setUri("serviceref-servicecompletion-portcompletion-port-uri");
+        portCompletion.setPort(port);
+        serviceCompletion.getPortCompletion().add(portCompletion);
+        serviceRef.setServiceCompletion(serviceCompletion);
+        port = namingFactory.createPort();
+        port.setCredentialsName("serviceref-port-credentialsname");
+        port.setHost("serviceref-port-host");
+        port.setPort(new Integer(0));
+        port.setPortName("serviceref-port-portname");
+        port.setProtocol("serviceref-port-protocol");
+        port.setUri("serviceref-port-uri");
+        serviceRef.getPort().add(port);
+        webApp.getServiceRef().add(serviceRef);
+
+        // set the Security
+        Security security = securityFactory.createSecurity();
+        security.setDefaultRole ("security-role");
+        security.setDoasCurrentCaller(true);
+        security.setUseContextHandler(true);
+        org.apache.geronimo.jee.deployment.Pattern pattern = deploymentFactory.createPattern();
+        pattern.setArtifactId("security-credentialstoreref-artifactid");
+        pattern.setCustomFoo("security-credentialstoreref-customfoo");
+        pattern.setGroupId("security-credentialstoreref-groupid");
+        pattern.setModule("security-credentialstoreref-module");
+        pattern.setType("security-credentialstoreref-type");
+        pattern.setVersion("security-credentialstoreref-version");
+        security.setCredentialStoreRef(pattern);
+        SubjectInfo subject = securityFactory.createSubjectInfo();
+        subject.setId("security-subjectinfo-id");
+        subject.setRealm("security-subjectinfo-realm");
+        Description description = securityFactory.createDescription();
+        description.setValue("security-subjectinfo-description");
+        subject.getDescription().add(description);
+        security.setDefaultSubject(subject);
+        RoleMappings roleMappings = securityFactory.createRoleMappings();
+        Role role = securityFactory.createRole();
+        role.setRoleName("security-role");
+        SubjectInfo subjectInfo = securityFactory.createSubjectInfo();
+        subjectInfo.setId("security-role-subjectinfo-id");
+        subjectInfo.setRealm("security-role-subjectinfo-realm");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-subjectinfo-description");
+        subjectInfo.getDescription().add(description);
+        role.setRunAsSubject(subjectInfo);
+        description = securityFactory.createDescription();
+        description.setValue("security-role-description");
+        role.getDescription().add(description);
+        DistinguishedName distinguishedName = securityFactory.createDistinguishedName();
+        distinguishedName.setName("security-role-distinguishedname");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-distinguished-name-description");
+        distinguishedName.getDescription().add(description);
+        role.getDistinguishedName().add(distinguishedName);
+        LoginDomainPrincipal loginDomainPrincipal = securityFactory.createLoginDomainPrincipal();
+        loginDomainPrincipal.setDomainName("security-role-logindomainprincipal-domainname");
+        loginDomainPrincipal.setName("security-role-logindomainprincipal-name");
+        loginDomainPrincipal.setClazz("security-role-logindomainprincipal-class");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-logindomainprincipal-description");
+        loginDomainPrincipal.getDescription().add(description);
+        role.getLoginDomainPrincipal().add(loginDomainPrincipal);
+        Principal principal = securityFactory.createPrincipal();
+        principal.setName("security-role-principal-name");
+        principal.setClazz("security-role-principal-class");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-principal-description");
+        principal.getDescription().add(description);
+        role.getPrincipal().add(principal);
+        RealmPrincipal realmPrincipal = securityFactory.createRealmPrincipal();
+        realmPrincipal.setName("security-role-realmprincipal-name");
+        realmPrincipal.setClazz("security-role-realmprincipal-class");
+        description = securityFactory.createDescription();
+        description.setValue("security-role-realmprincipal-description");
+        realmPrincipal.getDescription().add(description);
+        role.getRealmPrincipal().add(realmPrincipal);
+        roleMappings.getRole().add(role);
+        security.setRoleMappings(roleMappings);
+        webApp.setSecurity(securityFactory.createSecurity(security));
+
+        JAXBElement<WebApp> jaxbElement = webFactory.createWebApp(webApp);
+        
+        // 
+        // Marshall the output of the unmarshall
+        // 
+        JAXBContext jaxbContext = JAXBContext.newInstance( 
+                "org.apache.geronimo.jee.web:" +
+                "org.apache.geronimo.jee.application:" +
+                "org.apache.geronimo.jee.deployment:" +
+                "org.apache.geronimo.jee.naming:" + 
+                "org.apache.geronimo.jee.security", getClass().getClassLoader() );
+        Marshaller marshaller = jaxbContext.createMarshaller();
+        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        marshaller.marshal(jaxbElement, baos);
+        String actual = new String(baos.toByteArray());
+
+        InputStream expectedInputStream = this.getClass().getClassLoader().getResourceAsStream(fileExpected);
+        String expected = readContent(expectedInputStream);
+
+        try {
+            Diff myDiff = new Diff(expected, actual);
+            assertTrue("Files are similar " + myDiff, myDiff.similar());
+        }
+        catch (AssertionFailedError e) {
+            System.out.println("Actual XML:\n" + actual + '\n');
+            System.out.println("[Expected XML: " + fileExpected + "]\n" + expected + '\n');
+            throw e;            
+        }
+    }
 
     private String readContent(InputStream in) throws IOException {
         StringBuffer sb = new StringBuffer();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-11.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-11.xml?rev=650270&r1=650269&r2=650270&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-11.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/application/geronimo-application-expected-11.xml Mon Apr 21 14:09:42 2008
@@ -18,7 +18,7 @@
 
 <!-- @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" application-name="test-app-name">
+<ns2:application xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:ns3="http://geronimo.apache.org/xml/ns/security-2.0" application-name="test-app-name">
     <environment>
         <moduleId>
             <groupId>org.apache.geronimo.testsuite</groupId>
@@ -57,5 +57,42 @@
             <name>extmodule-externalpath-customfoo</name>
         </ns2:external-path>
     </ns2:ext-module>
+    <ns2:security xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:securityType" use-context-handler="true" doas-current-caller="true" default-role="security-role">
+        <ns3:credential-store-ref>
+            <groupId>security-credentialstoreref-groupid</groupId>
+            <artifactId>security-credentialstoreref-artifactid</artifactId>
+            <version>security-credentialstoreref-version</version>
+            <module>security-credentialstoreref-module</module>
+            <type>security-credentialstoreref-type</type>
+            <name>security-credentialstoreref-customfoo</name>
+        </ns3:credential-store-ref>
+        <ns3:default-subject>
+            <ns3:description>security-subjectinfo-description</ns3:description>
+            <ns3:realm>security-subjectinfo-realm</ns3:realm>
+            <ns3:id>security-subjectinfo-id</ns3:id>
+        </ns3:default-subject>
+        <ns3:role-mappings>
+            <ns3:role role-name="security-role">
+                <ns3:description>security-role-description</ns3:description>
+                <ns3:run-as-subject>
+                    <ns3:description>security-role-subjectinfo-description</ns3:description>
+                    <ns3:realm>security-role-subjectinfo-realm</ns3:realm>
+                    <ns3:id>security-role-subjectinfo-id</ns3:id>
+                </ns3:run-as-subject>
+                <ns3:realm-principal name="security-role-realmprincipal-name" class="security-role-realmprincipal-class">
+                    <ns3:description>security-role-realmprincipal-description</ns3:description>
+                </ns3:realm-principal>
+                <ns3:login-domain-principal domain-name="security-role-logindomainprincipal-domainname" name="security-role-logindomainprincipal-name" class="security-role-logindomainprincipal-class">
+                    <ns3:description>security-role-logindomainprincipal-description</ns3:description>
+                </ns3:login-domain-principal>
+                <ns3:principal name="security-role-principal-name" class="security-role-principal-class">
+                    <ns3:description>security-role-principal-description</ns3:description>
+                </ns3:principal>
+                <ns3:distinguished-name name="security-role-distinguishedname">
+                    <ns3:description>security-role-distinguished-name-description</ns3:description>
+                </ns3:distinguished-name>
+            </ns3:role>
+        </ns3:role-mappings>
+    </ns2:security>
     <gbean name="gbean-name" class="gbean-class"/>
 </ns2:application>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/connector/geronimo-ra-expected-11.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/connector/geronimo-ra-expected-11.xml?rev=650270&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/connector/geronimo-ra-expected-11.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/connector/geronimo-ra-expected-11.xml Mon Apr 21 14:09:42 2008
@@ -0,0 +1,104 @@
+<?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:connector xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2" xmlns:ns3="http://geronimo.apache.org/xml/ns/naming-1.2">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>agent-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.testsuite</groupId>
+                <artifactId>agent-ds</artifactId>
+                <version>2.2-SNAPSHOT</version>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+    <ns2:resourceadapter>
+        <ns2:resourceadapter-instance>
+            <ns2:resourceadapter-name>resourceadapter-name</ns2:resourceadapter-name>
+            <ns2:config-property-setting name="resourceadapter-instance-name">resourceadapter-instance-value</ns2:config-property-setting>
+            <ns3:workmanager>
+                <ns3:pattern>
+                    <ns3:groupId>connector-resourceadapter-workmanager-pattern-groupid</ns3:groupId>
+                    <ns3:artifactId>connector-resourceadapter-workmanager-pattern-artifactid</ns3:artifactId>
+                    <ns3:version>connector-resourceadapter-workmanager-pattern-version</ns3:version>
+                    <ns3:module>connector-resourceadapter-workmanager-pattern-module</ns3:module>
+                    <ns3:name>connector-resourceadapter-workmanager-pattern-name</ns3:name>
+                </ns3:pattern>
+                <ns3:gbean-link>connector-resourceadapter-workmanager-gbeanlink</ns3:gbean-link>
+            </ns3:workmanager>
+        </ns2:resourceadapter-instance>
+        <ns2:outbound-resourceadapter>
+            <ns2:connection-definition>
+                <ns2:connectionfactory-interface>resourceadapter-outbound-connectiondefinition-interface</ns2:connectionfactory-interface>
+                <ns2:connectiondefinition-instance>
+                    <ns2:name>resourceadapter-outbound-connectiondefinition-instance-name</ns2:name>
+                    <ns2:implemented-interface>resourceadapter-outbound-connectiondefinition-instance-implementedinterface</ns2:implemented-interface>
+                    <ns2:config-property-setting name="resourceadapter-outbound-connectiondefinition-instance-name">resourceadapter-outbound-connectiondefinition-instance-value</ns2:config-property-setting>
+                    <ns2:connectionmanager>
+                        <ns2:container-managed-security/>
+                        <ns2:no-transaction/>
+                        <ns2:local-transaction/>
+                        <ns2:xa-transaction>
+                            <ns2:transaction-caching/>
+                            <ns2:thread-caching/>
+                        </ns2:xa-transaction>
+                        <ns2:transaction-log/>
+                        <ns2:no-pool/>
+                        <ns2:single-pool>
+                            <ns2:max-size>0</ns2:max-size>
+                            <ns2:min-size>0</ns2:min-size>
+                            <ns2:blocking-timeout-milliseconds>0</ns2:blocking-timeout-milliseconds>
+                            <ns2:idle-timeout-minutes>0</ns2:idle-timeout-minutes>
+                            <ns2:match-one/>
+                            <ns2:match-all/>
+                            <ns2:select-one-assume-match/>
+                        </ns2:single-pool>
+                        <ns2:partitioned-pool>
+                            <ns2:max-size>0</ns2:max-size>
+                            <ns2:min-size>0</ns2:min-size>
+                            <ns2:blocking-timeout-milliseconds>0</ns2:blocking-timeout-milliseconds>
+                            <ns2:idle-timeout-minutes>0</ns2:idle-timeout-minutes>
+                            <ns2:match-one/>
+                            <ns2:match-all/>
+                            <ns2:select-one-assume-match/>
+                            <ns2:partition-by-subject/>
+                            <ns2:partition-by-connectionrequestinfo/>
+                        </ns2:partitioned-pool>
+                    </ns2:connectionmanager>
+                </ns2:connectiondefinition-instance>
+            </ns2:connection-definition>
+        </ns2:outbound-resourceadapter>
+    </ns2:resourceadapter>
+    <ns2:adminobject>
+        <ns2:adminobject-interface>adminobject-adminobjectinterface</ns2:adminobject-interface>
+        <ns2:adminobject-class>adminobject-adminobjectclass</ns2:adminobject-class>
+        <ns2:adminobject-instance>
+            <ns2:message-destination-name>adminobject-instance-messagedestinationname</ns2:message-destination-name>
+            <ns2:config-property-setting name="adminobject-instance-name">adminobject-instance-value</ns2:config-property-setting>
+        </ns2:adminobject-instance>
+    </ns2:adminobject>
+    <gbean name="gbean-name" class="gbean-class"/>
+</ns2:connector>

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/geronimo-openejb-expected-11.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/geronimo-openejb-expected-11.xml?rev=650270&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/geronimo-openejb-expected-11.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/openejb/geronimo-openejb-expected-11.xml Mon Apr 21 14:09:42 2008
@@ -0,0 +1,129 @@
+<?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$ -->
+           
+<ns2:ejb-jar xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0" xmlns:ns3="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:ns4="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:ns5="http://geronimo.apache.org/xml/ns/security-2.0" xmlns:ns6="http://java.sun.com/xml/ns/persistence">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>agent-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.testsuite</groupId>
+                <artifactId>agent-ds</artifactId>
+                <version>2.2-SNAPSHOT</version>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+    <ns3:abstract-naming-entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:persistence-unit-refType">
+        <ns3:persistence-unit-ref-name>jndienvironmentrefsgroup-persistenceunitref-unitrefname</ns3:persistence-unit-ref-name>
+        <ns3:persistence-unit-name>jndienvironmentrefsgroup-persistenceunitref-unitname</ns3:persistence-unit-name>
+        <ns3:pattern>
+            <ns3:groupId>jndienvironmentrefsgroup-persistenceunitref-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>jndienvironmentrefsgroup-persistenceunitref-pattern-artifactid</ns3:artifactId>
+            <ns3:version>jndienvironmentrefsgroup-persistenceunitref-pattern-version</ns3:version>
+            <ns3:module>jndienvironmentrefsgroup-persistenceunitref-pattern-module</ns3:module>
+            <ns3:name>jndienvironmentrefsgroup-persistenceunitref-pattern-name</ns3:name>
+        </ns3:pattern>
+    </ns3:abstract-naming-entry>
+    <ns3:message-destination>
+        <ns3:message-destination-name>messagedestination-name</ns3:message-destination-name>
+        <ns3:pattern>
+            <ns3:groupId>messagedestination-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>messagedestination-pattern-artifactid</ns3:artifactId>
+            <ns3:version>messagedestination-pattern-version</ns3:version>
+            <ns3:module>messagedestination-pattern-module</ns3:module>
+            <ns3:name>messagedestination-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:admin-object-module>messagedestination-adminobjectmodule</ns3:admin-object-module>
+        <ns3:admin-object-link>messagedestination-adminobjectlink</ns3:admin-object-link>
+    </ns3:message-destination>
+    <ns2:tss-link>
+        <ns2:ejb-name>tsslink-ejbname</ns2:ejb-name>
+        <ns2:tss-name>tsslink-tssname</ns2:tss-name>
+        <ns2:jndi-name>tssname-jndiname</ns2:jndi-name>
+    </ns2:tss-link>
+    <ns2:web-service-binding>
+        <ns2:ejb-name>webservicebinding-ejbname</ns2:ejb-name>
+        <ns2:web-service-address>webservicebinding-webserviceaddress</ns2:web-service-address>
+        <ns2:web-service-virtual-host>webservicebinding-webservicevirtualhost</ns2:web-service-virtual-host>
+        <ns2:web-service-security>
+            <ns2:security-realm-name>webservicebinding-webservicesecurity-securityrealmname</ns2:security-realm-name>
+            <ns2:realm-name>webservicebinding-webservicesecurity-realmname</ns2:realm-name>
+            <ns2:transport-guarantee>INTEGRAL</ns2:transport-guarantee>
+            <ns2:auth-method>BASIC</ns2:auth-method>
+        </ns2:web-service-security>
+    </ns2:web-service-binding>
+    <ns5:security use-context-handler="true" doas-current-caller="true" default-role="security-role">
+        <ns5:credential-store-ref>
+            <groupId>security-credentialstoreref-groupid</groupId>
+            <artifactId>security-credentialstoreref-artifactid</artifactId>
+            <version>security-credentialstoreref-version</version>
+            <module>security-credentialstoreref-module</module>
+            <type>security-credentialstoreref-type</type>
+            <name>security-credentialstoreref-customfoo</name>
+        </ns5:credential-store-ref>
+        <ns5:default-subject>
+            <ns5:description>security-subjectinfo-description</ns5:description>
+            <ns5:realm>security-subjectinfo-realm</ns5:realm>
+            <ns5:id>security-subjectinfo-id</ns5:id>
+        </ns5:default-subject>
+        <ns5:role-mappings>
+            <ns5:role role-name="security-role">
+                <ns5:description>security-role-description</ns5:description>
+                <ns5:run-as-subject>
+                    <ns5:description>security-role-subjectinfo-description</ns5:description>
+                    <ns5:realm>security-role-subjectinfo-realm</ns5:realm>
+                    <ns5:id>security-role-subjectinfo-id</ns5:id>
+                </ns5:run-as-subject>
+                <ns5:realm-principal name="security-role-realmprincipal-name" class="security-role-realmprincipal-class">
+                    <ns5:description>security-role-realmprincipal-description</ns5:description>
+                </ns5:realm-principal>
+                <ns5:login-domain-principal domain-name="security-role-logindomainprincipal-domainname" name="security-role-logindomainprincipal-name" class="security-role-logindomainprincipal-class">
+                    <ns5:description>security-role-logindomainprincipal-description</ns5:description>
+                </ns5:login-domain-principal>
+                <ns5:principal name="security-role-principal-name" class="security-role-principal-class">
+                    <ns5:description>security-role-principal-description</ns5:description>
+                </ns5:principal>
+                <ns5:distinguished-name name="security-role-distinguishedname">
+                    <ns5:description>security-role-distinguished-name-description</ns5:description>
+                </ns5:distinguished-name>
+            </ns5:role>
+        </ns5:role-mappings>
+    </ns5:security>
+    <ns6:persistence version="persistence-version">
+        <ns6:persistence-unit transaction-type="RESOURCE_LOCAL" name="persistence-name">
+            <ns6:description>persistence-description</ns6:description>
+            <ns6:provider>persistence-provider</ns6:provider>
+            <ns6:jta-data-source>persistence-jtadatasource</ns6:jta-data-source>
+            <ns6:non-jta-data-source>persistence-nonjtadatasource</ns6:non-jta-data-source>
+            <ns6:mapping-file>persistence-mappingfile</ns6:mapping-file>
+            <ns6:jar-file>persistence-jarfile</ns6:jar-file>
+            <ns6:class>persistence-clazz</ns6:class>
+            <ns6:exclude-unlisted-classes>true</ns6:exclude-unlisted-classes>
+            <ns6:properties>
+                <ns6:property value="persistence-property-value" name="persistence-property-name"/>
+            </ns6:properties>
+        </ns6:persistence-unit>
+    </ns6:persistence>
+</ns2:ejb-jar>

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

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

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

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/web/geronimo-web-expected-11.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/web/geronimo-web-expected-11.xml?rev=650270&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/web/geronimo-web-expected-11.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v21.jaxbmodel/src/test/resources/web/geronimo-web-expected-11.xml Mon Apr 21 14:09:42 2008
@@ -0,0 +1,208 @@
+<?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:web-app xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ns2="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" xmlns:ns3="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:ns4="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:ns5="http://geronimo.apache.org/xml/ns/security-2.0" xmlns:ns6="http://java.sun.com/xml/ns/persistence">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.geronimo.testsuite</groupId>
+            <artifactId>agent-ear</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <type>ear</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.geronimo.testsuite</groupId>
+                <artifactId>agent-ds</artifactId>
+                <version>2.2-SNAPSHOT</version>
+                <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+    <ns2:context-root>contextroot</ns2:context-root>
+    <ns2:work-dir>workdir</ns2:work-dir>
+    <ns3:web-container>
+        <ns3:pattern>
+            <ns3:groupId>gbeanlocator-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>gbeanlocator-pattern-artifactid</ns3:artifactId>
+            <ns3:version>gbeanlocator-pattern-version</ns3:version>
+            <ns3:module>gbeanlocator-pattern-module</ns3:module>
+            <ns3:name>gbeanlocator-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:gbean-link>gbeanlocator-gbeanlink</ns3:gbean-link>
+    </ns3:web-container>
+    <ns3:abstract-naming-entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:persistence-unit-refType">
+        <ns3:persistence-unit-ref-name>persistenceunitref-unitrefname</ns3:persistence-unit-ref-name>
+        <ns3:persistence-unit-name>persistenceunitref-unitname</ns3:persistence-unit-name>
+        <ns3:pattern>
+            <ns3:groupId>persistenceunitref-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>persistenceunitref-pattern-artifactid</ns3:artifactId>
+            <ns3:version>persistenceunitref-pattern-version</ns3:version>
+            <ns3:module>persistenceunitref-pattern-module</ns3:module>
+            <ns3:name>persistenceunitref-pattern-name</ns3:name>
+        </ns3:pattern>
+    </ns3:abstract-naming-entry>
+    <ns3:ejb-ref>
+        <ns3:ref-name>ejbref-refname</ns3:ref-name>
+        <ns3:pattern>
+            <ns3:groupId>ejbref-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>ejbref-pattern-artifactid</ns3:artifactId>
+            <ns3:version>ejbref-pattern-version</ns3:version>
+            <ns3:module>ejbref-pattern-module</ns3:module>
+            <ns3:name>ejbref-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:ns-corbaloc>ejbref-nscorbaloc</ns3:ns-corbaloc>
+        <ns3:name>ejbref-name</ns3:name>
+        <ns3:css>
+            <ns3:groupId>ejbref-css-groupid</ns3:groupId>
+            <ns3:artifactId>ejbref-css-artifactid</ns3:artifactId>
+            <ns3:version>ejbref-css-version</ns3:version>
+            <ns3:module>ejbref-css-module</ns3:module>
+            <ns3:name>ejbref-css-name</ns3:name>
+        </ns3:css>
+        <ns3:css-link>ejbref-csslink</ns3:css-link>
+        <ns3:ejb-link>ejbref-ejblink</ns3:ejb-link>
+    </ns3:ejb-ref>
+    <ns3:ejb-local-ref>
+        <ns3:ref-name>ejblocalref-refname</ns3:ref-name>
+        <ns3:pattern>
+            <ns3:groupId>ejblocalref-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>ejblocalref-pattern-artifactid</ns3:artifactId>
+            <ns3:version>ejblocalref-pattern-version</ns3:version>
+            <ns3:module>ejblocalref-pattern-module</ns3:module>
+            <ns3:name>ejblocalref-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:ejb-link>ejblocalref-ejblink</ns3:ejb-link>
+    </ns3:ejb-local-ref>
+    <ns3:service-ref>
+        <ns3:service-ref-name>serviceref-refname</ns3:service-ref-name>
+        <ns3:service-completion>
+            <ns3:service-name>serviceref-servicecompletion-servicename</ns3:service-name>
+            <ns3:port-completion>
+                <ns3:port>
+                    <ns3:port-name>serviceref-servicecompletion-portcompletion-port-portname</ns3:port-name>
+                    <ns3:protocol>serviceref-servicecompletion-portcompletion-port-protocol</ns3:protocol>
+                    <ns3:host>serviceref-servicecompletion-portcompletion-port-host</ns3:host>
+                    <ns3:port>0</ns3:port>
+                    <ns3:uri>serviceref-servicecompletion-portcompletion-port-uri</ns3:uri>
+                    <ns3:credentials-name>serviceref-servicecompletion-portcompletion-port-credentialsname</ns3:credentials-name>
+                </ns3:port>
+                <ns3:binding-name>serviceref-servicecompletion-portcompletion-bindingname</ns3:binding-name>
+            </ns3:port-completion>
+        </ns3:service-completion>
+        <ns3:port>
+            <ns3:port-name>serviceref-port-portname</ns3:port-name>
+            <ns3:protocol>serviceref-port-protocol</ns3:protocol>
+            <ns3:host>serviceref-port-host</ns3:host>
+            <ns3:port>0</ns3:port>
+            <ns3:uri>serviceref-port-uri</ns3:uri>
+            <ns3:credentials-name>serviceref-port-credentialsname</ns3:credentials-name>
+        </ns3:port>
+    </ns3:service-ref>
+    <ns3:resource-ref>
+        <ns3:ref-name>resourceref-refname</ns3:ref-name>
+        <ns3:pattern>
+            <ns3:groupId>resourceref-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>resourceref-pattern-artifactid</ns3:artifactId>
+            <ns3:version>resourceref-pattern-version</ns3:version>
+            <ns3:module>resourcref-pattern-module</ns3:module>
+            <ns3:name>resourceref-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:resource-link>resourceref-resourcelink</ns3:resource-link>
+        <ns3:url>resourceref-url</ns3:url>
+    </ns3:resource-ref>
+    <ns3:resource-env-ref>
+        <ns3:ref-name>resourceenvref-refname</ns3:ref-name>
+        <ns3:pattern>
+            <ns3:groupId>resourceenvref-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>resourceenvref-pattern-artifactid</ns3:artifactId>
+            <ns3:version>resourceenvref-pattern-version</ns3:version>
+            <ns3:module>resourceenvref-pattern-module</ns3:module>
+            <ns3:name>resourceenvref-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:message-destination-link>resourceenvref-messagedestinationlink</ns3:message-destination-link>
+        <ns3:admin-object-module>resourceenvref-adminobjectmodule</ns3:admin-object-module>
+        <ns3:admin-object-link>resourceenvref-adminobjectlink</ns3:admin-object-link>
+    </ns3:resource-env-ref>
+    <ns3:message-destination>
+        <ns3:message-destination-name>messagedestination-name</ns3:message-destination-name>
+        <ns3:pattern>
+            <ns3:groupId>messagedestination-pattern-groupid</ns3:groupId>
+            <ns3:artifactId>messagedestination-pattern-artifactid</ns3:artifactId>
+            <ns3:version>messagedestination-pattern-version</ns3:version>
+            <ns3:module>messagedestination-pattern-module</ns3:module>
+            <ns3:name>messagedestination-pattern-name</ns3:name>
+        </ns3:pattern>
+        <ns3:admin-object-module>messagedestination-adminobjectmodule</ns3:admin-object-module>
+        <ns3:admin-object-link>messagedestination-adminobjectlink</ns3:admin-object-link>
+    </ns3:message-destination>
+    <ns2:security-realm-name>securityrealmname</ns2:security-realm-name>
+    <ns5:security use-context-handler="true" doas-current-caller="true" default-role="security-role">
+        <ns5:credential-store-ref>
+            <groupId>security-credentialstoreref-groupid</groupId>
+            <artifactId>security-credentialstoreref-artifactid</artifactId>
+            <version>security-credentialstoreref-version</version>
+            <module>security-credentialstoreref-module</module>
+            <type>security-credentialstoreref-type</type>
+            <name>security-credentialstoreref-customfoo</name>
+        </ns5:credential-store-ref>
+        <ns5:default-subject>
+            <ns5:description>security-subjectinfo-description</ns5:description>
+            <ns5:realm>security-subjectinfo-realm</ns5:realm>
+            <ns5:id>security-subjectinfo-id</ns5:id>
+        </ns5:default-subject>
+        <ns5:role-mappings>
+            <ns5:role role-name="security-role">
+                <ns5:description>security-role-description</ns5:description>
+                <ns5:run-as-subject>
+                    <ns5:description>security-role-subjectinfo-description</ns5:description>
+                    <ns5:realm>security-role-subjectinfo-realm</ns5:realm>
+                    <ns5:id>security-role-subjectinfo-id</ns5:id>
+                </ns5:run-as-subject>
+                <ns5:realm-principal name="security-role-realmprincipal-name" class="security-role-realmprincipal-class">
+                    <ns5:description>security-role-realmprincipal-description</ns5:description>
+                </ns5:realm-principal>
+                <ns5:login-domain-principal domain-name="security-role-logindomainprincipal-domainname" name="security-role-logindomainprincipal-name" class="security-role-logindomainprincipal-class">
+                    <ns5:description>security-role-logindomainprincipal-description</ns5:description>
+                </ns5:login-domain-principal>
+                <ns5:principal name="security-role-principal-name" class="security-role-principal-class">
+                    <ns5:description>security-role-principal-description</ns5:description>
+                </ns5:principal>
+                <ns5:distinguished-name name="security-role-distinguishedname">
+                    <ns5:description>security-role-distinguished-name-description</ns5:description>
+                </ns5:distinguished-name>
+            </ns5:role>
+        </ns5:role-mappings>
+    </ns5:security>
+    <ns6:persistence version="persistence-version">
+        <ns6:persistence-unit transaction-type="RESOURCE_LOCAL" name="persistence-name">
+            <ns6:description>persistence-description</ns6:description>
+            <ns6:provider>persistence-provider</ns6:provider>
+            <ns6:jta-data-source>persistence-jtadatasource</ns6:jta-data-source>
+            <ns6:non-jta-data-source>persistence-nonjtadatasource</ns6:non-jta-data-source>
+            <ns6:mapping-file>persistence-mappingfile</ns6:mapping-file>
+            <ns6:jar-file>persistence-jarfile</ns6:jar-file>
+            <ns6:class>persistence-clazz</ns6:class>
+            <ns6:exclude-unlisted-classes>true</ns6:exclude-unlisted-classes>
+            <ns6:properties>
+                <ns6:property value="persistence-property-value" name="persistence-property-name"/>
+            </ns6:properties>
+        </ns6:persistence-unit>
+    </ns6:persistence>
+</ns2:web-app>

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

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

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