geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r990337 [2/2] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: ./ org.apache.geronimo.jee.v22.jaxbmodel/ org.apache.geronimo.jee.v22.jaxbmodel/META-INF/ org.apache.geronimo.jee.v22.jaxbmodel/bin/ org.apache.geronimo.jee.v22.jaxbmodel/s...
Date Sat, 28 Aug 2010 10:34:08 GMT
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/ServerAuthContext.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/ServerAuthContext.java?rev=990337&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/ServerAuthContext.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/ServerAuthContext.java
Sat Aug 28 10:34:07 2010
@@ -0,0 +1,164 @@
+/*
+ * 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.jaspi;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for serverAuthContext complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ * 
+ * <pre>
+ * &lt;complexType name="serverAuthContext">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="messageLayer" type="{http://www.w3.org/2001/XMLSchema}string"
minOccurs="0"/>
+ *         &lt;element name="appContext" type="{http://www.w3.org/2001/XMLSchema}string"
minOccurs="0"/>
+ *         &lt;element name="authenticationContextID" type="{http://www.w3.org/2001/XMLSchema}string"
minOccurs="0"/>
+ *         &lt;element name="serverAuthModule" type="{http://geronimo.apache.org/xml/ns/geronimo-jaspi}authModule"
maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "serverAuthContext", propOrder = {
+    "messageLayer",
+    "appContext",
+    "authenticationContextID",
+    "serverAuthModule"
+})
+public class ServerAuthContext {
+
+    protected String messageLayer;
+    protected String appContext;
+    protected String authenticationContextID;
+    protected List<AuthModule> serverAuthModule;
+
+    /**
+     * Gets the value of the messageLayer property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getMessageLayer() {
+        return messageLayer;
+    }
+
+    /**
+     * Sets the value of the messageLayer property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setMessageLayer(String value) {
+        this.messageLayer = value;
+    }
+
+    /**
+     * Gets the value of the appContext property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAppContext() {
+        return appContext;
+    }
+
+    /**
+     * Sets the value of the appContext property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAppContext(String value) {
+        this.appContext = value;
+    }
+
+    /**
+     * Gets the value of the authenticationContextID property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getAuthenticationContextID() {
+        return authenticationContextID;
+    }
+
+    /**
+     * Sets the value of the authenticationContextID property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setAuthenticationContextID(String value) {
+        this.authenticationContextID = value;
+    }
+
+    /**
+     * Gets the value of the serverAuthModule property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the serverAuthModule
property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getServerAuthModule().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link AuthModule }
+     * 
+     * 
+     */
+    public List<AuthModule> getServerAuthModule() {
+        if (serverAuthModule == null) {
+            serverAuthModule = new ArrayList<AuthModule>();
+        }
+        return this.serverAuthModule;
+    }
+
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/Target.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/Target.java?rev=990337&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/Target.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/Target.java
Sat Aug 28 10:34:07 2010
@@ -0,0 +1,77 @@
+/*
+ * 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.jaspi;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for target complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ * 
+ * <pre>
+ * &lt;complexType name="target">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="className" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "target", propOrder = {
+    "className"
+})
+public class Target {
+
+    @XmlElement(required = true)
+    protected String className;
+
+    /**
+     * Gets the value of the className property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getClassName() {
+        return className;
+    }
+
+    /**
+     * Sets the value of the className property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setClassName(String value) {
+        this.className = value;
+    }
+
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/TargetPolicy.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/TargetPolicy.java?rev=990337&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/TargetPolicy.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/TargetPolicy.java
Sat Aug 28 10:34:07 2010
@@ -0,0 +1,110 @@
+/*
+ * 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.jaspi;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for targetPolicy complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ * 
+ * <pre>
+ * &lt;complexType name="targetPolicy">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="protectionPolicy" type="{http://geronimo.apache.org/xml/ns/geronimo-jaspi}protectionPolicy"/>
+ *         &lt;element name="target" type="{http://geronimo.apache.org/xml/ns/geronimo-jaspi}target"
maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;</complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "targetPolicy", propOrder = {
+    "protectionPolicy",
+    "target"
+})
+public class TargetPolicy {
+
+    @XmlElement(required = true)
+    protected ProtectionPolicy protectionPolicy;
+    protected List<Target> target;
+
+    /**
+     * Gets the value of the protectionPolicy property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link ProtectionPolicy }
+     *     
+     */
+    public ProtectionPolicy getProtectionPolicy() {
+        return protectionPolicy;
+    }
+
+    /**
+     * Sets the value of the protectionPolicy property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link ProtectionPolicy }
+     *     
+     */
+    public void setProtectionPolicy(ProtectionPolicy value) {
+        this.protectionPolicy = value;
+    }
+
+    /**
+     * Gets the value of the target property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the target property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getTarget().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Target }
+     * 
+     * 
+     */
+    public List<Target> getTarget() {
+        if (target == null) {
+            target = new ArrayList<Target>();
+        }
+        return this.target;
+    }
+
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/package-info.java?rev=990337&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/package-info.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/main/java/org/apache/geronimo/jee/jaspi/package-info.java
Sat Aug 28 10:34:07 2010
@@ -0,0 +1,18 @@
+/*
+ * 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.
+ */
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.geronimo.jee.jaspi;

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/java/org/apache/geronimo/jee/jaspi/GeronimoJaspiTest.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/java/org/apache/geronimo/jee/jaspi/GeronimoJaspiTest.java?rev=990337&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/java/org/apache/geronimo/jee/jaspi/GeronimoJaspiTest.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/java/org/apache/geronimo/jee/jaspi/GeronimoJaspiTest.java
Sat Aug 28 10:34:07 2010
@@ -0,0 +1,217 @@
+/*
+ * 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.jaspi;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.custommonkey.xmlunit.Diff;
+
+
+/**
+ * <strong>GeronimoJaspiTest</strong> is used to test various JAXB 
+ * operations on the following OSGi-specific XML file supported by the GEP:
+ * 
+ * <ul>
+ *      <li>geronimo-jaspi.xml
+ * </ul>
+ * 
+ * <p>The following JAXB operations are performed: 
+ * <ol>
+ *      <li>Create XML with all fields
+ * </ol>
+ * 
+ */
+public class GeronimoJaspiTest extends TestCase {
+
+    /*----------------------------------------------------------------------------------------------------------------*\
+    |                                                                                   
                              |
+    |  Testcase(s)                                                                      
                              | 
+    |                                                                                   
                              |
+    \*----------------------------------------------------------------------------------------------------------------*/
+    public void testCompleteXML() throws Exception {
+        buildFullXMLFromScratch("jaspi/geronimo-jaspi-expected.xml");
+    }
+
+
+    /*----------------------------------------------------------------------------------------------------------------*\
+    |                                                                                   
                              |
+    |  Private method(s)                                                                
                              | 
+    |                                                                                   
                              |
+    \*----------------------------------------------------------------------------------------------------------------*/
+    private void buildFullXMLFromScratch (String fileExpected) throws Exception {
+
+        // 
+        // Create the jaspi factory
+        // 
+        ObjectFactory jaspiFactory = new ObjectFactory();
+        Jaspi jaspi = jaspiFactory.createJaspi();
+
+        // 
+        // Create numerous objects so they can be used throughout
+        // 
+        AuthModule authModule = jaspiFactory.createAuthModule();
+        ClientAuthConfig clientAuthConfig = jaspiFactory.createClientAuthConfig();
+        ClientAuthContext clientAuthContext = jaspiFactory.createClientAuthContext();
+        ConfigProvider configProvider = jaspiFactory.createConfigProvider();
+        MessagePolicy requestPolicy = jaspiFactory.createMessagePolicy();
+        MessagePolicy responsePolicy = jaspiFactory.createMessagePolicy();
+        ProtectionPolicy protectionPolicy = jaspiFactory.createProtectionPolicy();
+        ServerAuthConfig serverAuthConfig = jaspiFactory.createServerAuthConfig();
+        ServerAuthContext serverAuthContext = jaspiFactory.createServerAuthContext();
+        Target target = jaspiFactory.createTarget();
+        TargetPolicy targetPolicy = jaspiFactory.createTargetPolicy();
+
+        // 
+        // ProtectionPolicy
+        // 
+        protectionPolicy.setClassName("PROTECTION_POLICY_CLASS_NAME");
+
+        // 
+        // Target
+        // 
+        target.setClassName("TARGET_CLASS_NAME");
+
+        // 
+        // TargetPolicy
+        // 
+        targetPolicy.setProtectionPolicy(protectionPolicy);
+        targetPolicy.getTarget().add(target);
+
+        // 
+        // RequestPolicy
+        // 
+        requestPolicy.setMandatory(true);
+        requestPolicy.getTargetPolicy().add(targetPolicy);
+
+        // 
+        // ResponsePolicy
+        // 
+        responsePolicy.setMandatory(true);
+        responsePolicy.getTargetPolicy().add(targetPolicy);
+
+        // 
+        // AuthModule
+        // 
+        authModule.setClassLoaderName("AUTH_MODULE_CLASS_LOADER_NAME");
+        authModule.setClassName("AUTH_MODULE_CLASS_NAME");
+        authModule.setOptions("AUTH_MODULE_OPTIONS");
+        authModule.setRequestPolicy(requestPolicy);
+        authModule.setResponsePolicy(responsePolicy);
+
+
+        // 
+        // ClientAuthContext
+        // 
+        clientAuthContext.setAppContext("CLIENT_AUTH_CONTEXT_APP_CONTEXT");
+        clientAuthContext.setAuthenticationContextID("CLIENT_AUTH_CONTEXT_AUTHENTICATION_CONTEXT_ID");
+        clientAuthContext.setMessageLayer("CLIENT_AUTH_CONTEXT_MESSAGE_LAYER");
+        clientAuthContext.getClientAuthModule().add(authModule);
+
+        // 
+        // ClientAuthConfig
+        // 
+        clientAuthConfig.setAppContext("CLIENT_AUTH_CONFIG_APP_CONTEXT");
+        clientAuthConfig.setAuthenticationContextID("CLIENT_AUTH_CONFIG_AUTHENTICATION_CONTEXT_ID");
+        clientAuthConfig.setMessageLayer("CLIENT_AUTH_CONFIG_MESSAGE_LAYER");
+        clientAuthConfig.setProtected(true);
+        clientAuthConfig.getClientAuthContext().add(clientAuthContext);
+
+        // 
+        // ConfigProvider
+        // 
+        configProvider.setAppContext("CONFIG_PROVIDER_APP_CONTEXT");
+        configProvider.setClassLoaderName("CONFIG_PROVIDER_CLASS_LOADER_NAME");
+        configProvider.setClassName("CONFIG_PROVIDER_CLASS_NAME");
+        configProvider.setDescription("CONFIG_PROVIDER_DESCRIPTION");
+        configProvider.setMessageLayer("CONFIG_PROVIDER_MESSAGE_LAYER");
+        configProvider.setPersistent(true);
+        configProvider.setProperties("CONFIG_PROVIDER_PROPERTIES");
+        configProvider.getClientAuthConfig().add(clientAuthConfig);
+        configProvider.getServerAuthConfig().add(serverAuthConfig);
+        jaspi.getConfigProvider().add(configProvider);
+
+        // 
+        // ServerAuthConfig
+        // 
+        serverAuthConfig.setAppContext("SERVER_AUTH_CONFIG_APP_CONTEXT");
+        serverAuthConfig.setAuthenticationContextID("SERVER_AUTH_CONFIG_AUTHENTICATION_CONTEXT_ID");
+        serverAuthConfig.setMessageLayer("SERVER_AUTH_CONFIG_MESSAGE_LAYER");
+        serverAuthConfig.setProtected(true);
+        serverAuthConfig.getServerAuthContext().add(serverAuthContext);
+
+        // 
+        // ServerAuthContext
+        // 
+        serverAuthContext.setAppContext("SERVER_AUTH_CONTEXT_APP_CONTEXT");
+        serverAuthContext.setAuthenticationContextID("SERVER_AUTH_CONTEXT_AUTHENTICATION_CONTEXT_ID");
+        serverAuthContext.setMessageLayer("SERVER_AUTH_CONTEXT_MESSAGE_LAYER");
+        serverAuthContext.getServerAuthModule().add(authModule);
+
+        //
+        // Finally, create the jaspi XML
+        // 
+        JAXBElement<Jaspi> jaxbElement = jaspiFactory.createJaspi(jaspi);
+        
+        //
+        // Marshall the Jaspi so that it can be compared with the expected file
+        // 
+        JAXBContext jaxbContext = JAXBContext.newInstance( 
+                                    "org.apache.geronimo.jee.jaspi", 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();
+        in = new BufferedInputStream(in);
+        int i = in.read();
+        while (i != -1) {
+            sb.append((char) i);
+            i = in.read();
+        }
+        String content = sb.toString();
+        return content;
+    }
+}

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/resources/jaspi/geronimo-jaspi-expected.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/resources/jaspi/geronimo-jaspi-expected.xml?rev=990337&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/resources/jaspi/geronimo-jaspi-expected.xml
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.jee.v22.jaxbmodel/src/test/resources/jaspi/geronimo-jaspi-expected.xml
Sat Aug 28 10:34:07 2010
@@ -0,0 +1,100 @@
+<?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.
+-->
+<jaspi xmlns="http://geronimo.apache.org/xml/ns/geronimo-jaspi">
+    <configProvider>
+        <messageLayer>CONFIG_PROVIDER_MESSAGE_LAYER</messageLayer>
+        <appContext>CONFIG_PROVIDER_APP_CONTEXT</appContext>
+        <description>CONFIG_PROVIDER_DESCRIPTION</description>
+        <className>CONFIG_PROVIDER_CLASS_NAME</className>
+        <properties>CONFIG_PROVIDER_PROPERTIES</properties>
+        <clientAuthConfig>
+            <messageLayer>CLIENT_AUTH_CONFIG_MESSAGE_LAYER</messageLayer>
+            <appContext>CLIENT_AUTH_CONFIG_APP_CONTEXT</appContext>
+            <authenticationContextID>CLIENT_AUTH_CONFIG_AUTHENTICATION_CONTEXT_ID</authenticationContextID>
+            <protected>true</protected>
+            <clientAuthContext>
+                <messageLayer>CLIENT_AUTH_CONTEXT_MESSAGE_LAYER</messageLayer>
+                <appContext>CLIENT_AUTH_CONTEXT_APP_CONTEXT</appContext>
+                <authenticationContextID>CLIENT_AUTH_CONTEXT_AUTHENTICATION_CONTEXT_ID</authenticationContextID>
+                <clientAuthModule>
+                    <className>AUTH_MODULE_CLASS_NAME</className>
+                    <classLoaderName>AUTH_MODULE_CLASS_LOADER_NAME</classLoaderName>
+                    <requestPolicy mandatory="true">
+                        <targetPolicy>
+                            <protectionPolicy>
+<className>PROTECTION_POLICY_CLASS_NAME</className>
+                            </protectionPolicy>
+                            <target>
+<className>TARGET_CLASS_NAME</className>
+                            </target>
+                        </targetPolicy>
+                    </requestPolicy>
+                    <responsePolicy mandatory="true">
+                        <targetPolicy>
+                            <protectionPolicy>
+<className>PROTECTION_POLICY_CLASS_NAME</className>
+                            </protectionPolicy>
+                            <target>
+<className>TARGET_CLASS_NAME</className>
+                            </target>
+                        </targetPolicy>
+                    </responsePolicy>
+                    <options>AUTH_MODULE_OPTIONS</options>
+                </clientAuthModule>
+            </clientAuthContext>
+        </clientAuthConfig>
+        <serverAuthConfig>
+            <messageLayer>SERVER_AUTH_CONFIG_MESSAGE_LAYER</messageLayer>
+            <appContext>SERVER_AUTH_CONFIG_APP_CONTEXT</appContext>
+            <authenticationContextID>SERVER_AUTH_CONFIG_AUTHENTICATION_CONTEXT_ID</authenticationContextID>
+            <protected>true</protected>
+            <serverAuthContext>
+                <messageLayer>SERVER_AUTH_CONTEXT_MESSAGE_LAYER</messageLayer>
+                <appContext>SERVER_AUTH_CONTEXT_APP_CONTEXT</appContext>
+                <authenticationContextID>SERVER_AUTH_CONTEXT_AUTHENTICATION_CONTEXT_ID</authenticationContextID>
+                <serverAuthModule>
+                    <className>AUTH_MODULE_CLASS_NAME</className>
+                    <classLoaderName>AUTH_MODULE_CLASS_LOADER_NAME</classLoaderName>
+                    <requestPolicy mandatory="true">
+                        <targetPolicy>
+                            <protectionPolicy>
+<className>PROTECTION_POLICY_CLASS_NAME</className>
+                            </protectionPolicy>
+                            <target>
+<className>TARGET_CLASS_NAME</className>
+                            </target>
+                        </targetPolicy>
+                    </requestPolicy>
+                    <responsePolicy mandatory="true">
+                        <targetPolicy>
+                            <protectionPolicy>
+<className>PROTECTION_POLICY_CLASS_NAME</className>
+                            </protectionPolicy>
+                            <target>
+<className>TARGET_CLASS_NAME</className>
+                            </target>
+                        </targetPolicy>
+                    </responsePolicy>
+                    <options>AUTH_MODULE_OPTIONS</options>
+                </serverAuthModule>
+            </serverAuthContext>
+        </serverAuthConfig>
+        <persistent>true</persistent>
+        <classLoaderName>CONFIG_PROVIDER_CLASS_LOADER_NAME</classLoaderName>
+    </configProvider>
+</jaspi>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.schemas/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.schemas/plugin.xml?rev=990337&r1=990336&r2=990337&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.schemas/plugin.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.schemas/plugin.xml
Sat Aug 28 10:34:07 2010
@@ -25,87 +25,95 @@
          <catalogContribution>
          <uri
                name="http://geronimo.apache.org/xml/ns/attributes-1.2"
-               uri="v22/attributes-1.2.xsd">
+               uri="v30/attributes-1.2.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
-               uri="v22/geronimo-application-2.0.xsd">
+               uri="v30/geronimo-application-2.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0"
-               uri="v22/geronimo-application-client-2.0.xsd">
+               uri="v30/geronimo-application-client-2.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
-               uri="v22/geronimo-connector-1.2.xsd">
+               uri="v30/geronimo-connector-1.2.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/credentialstore-1.0"
-               uri="v22/geronimo-credential-store-1.0.xsd">
+               uri="v30/geronimo-credential-store-1.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/deployment/javabean-1.0"
-               uri="v22/geronimo-javabean-xmlattribute-1.0.xsd">
+               uri="v30/geronimo-javabean-xmlattribute-1.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-2.0.2"
-               uri="v22/geronimo-jetty-2.0.2.xsd">
+               uri="v30/geronimo-jetty-2.0.2.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/web/jetty/config-1.0.1"
-               uri="v22/geronimo-jetty-config-1.0.1.xsd">
+               uri="v30/geronimo-jetty-config-1.0.1.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/loginconfig-2.0"
-               uri="v22/geronimo-login-config-2.0.xsd">
+               uri="v30/geronimo-login-config-2.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/deployment-1.2"
-               uri="v22/geronimo-module-1.2.xsd">
+               uri="v30/geronimo-module-1.2.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/naming-1.2"
-               uri="v22/geronimo-naming-1.2.xsd">
+               uri="v30/geronimo-naming-1.2.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0"
-               uri="v22/geronimo-openejb-2.0.xsd">
+               uri="v30/geronimo-openejb-2.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/security-1.2"
-               uri="v22/geronimo-security-1.2.xsd">
+               uri="v30/geronimo-security-1.2.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/security-2.0"
-               uri="v22/geronimo-security-2.0.xsd">
+               uri="v30/geronimo-security-2.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/subject-info-1.0"
-               uri="v22/geronimo-subject-info-1.0.xsd">
+               uri="v30/geronimo-subject-info-1.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1"
-               uri="v22/geronimo-tomcat-2.0.1.xsd">
+               uri="v30/geronimo-tomcat-2.0.1.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0"
-               uri="v22/geronimo-tomcat-config-1.0.xsd">
+               uri="v30/geronimo-tomcat-config-1.0.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
-               uri="v22/geronimo-web-2.0.1.xsd">
+               uri="v30/geronimo-web-2.0.1.xsd">
          </uri>
          <uri
                name="http://geronimo.apache.org/xml/ns/plugins-1.3"
-               uri="v22/plugins-1.3.xsd">
+               uri="v30/plugins-1.3.xsd">
          </uri>
           <uri
                name="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
-               uri="v22/openejb-jar-2.2.xsd">
+               uri="v30/openejb-jar-2.2.xsd">
          </uri>
-            <uri
+         <uri
                name="http://openejb.apache.org/xml/ns/pkgen-2.1"
-               uri="v22/pkgen-2.1.xsd">
+               uri="v30/pkgen-2.1.xsd">
+         </uri>
+         <uri
+               name="http://geronimo.apache.org/xml/ns/geronimo-jaspi"
+               uri="v30/geronimo-jaspi.xsd">
+         </uri>
+         <uri
+               name="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+               uri="v30/blueprint.xsd">
          </uri>
          </catalogContribution>
    </extension>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/META-INF/MANIFEST.MF?rev=990337&r1=990336&r2=990337&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/META-INF/MANIFEST.MF
Sat Aug 28 10:34:07 2010
@@ -11,10 +11,11 @@ Require-Bundle: org.apache.geronimo.jaxb
  org.apache.geronimo.st.v21.core,
  org.apache.geronimo.st.core,
  org.apache.geronimo.jee.v21.jaxbmodel,
+ org.apache.geronimo.jee.v22.jaxbmodel,
  org.eclipse.core.runtime,
  org.eclipse.wst.server.core,
  org.eclipse.debug.core,
  org.eclipse.wst.common.project.facet.core,
  org.eclipse.jst.common.frameworks,
- org.eclipse.wst.common.modulecore 
+ org.eclipse.wst.common.modulecore
 Bundle-ActivationPolicy: lazy

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/pom.xml?rev=990337&r1=990336&r2=990337&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/pom.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.core/pom.xml
Sat Aug 28 10:34:07 2010
@@ -164,6 +164,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.devtools</groupId>
+            <artifactId>org.apache.geronimo.jee.v22.jaxbmodel</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.devtools</groupId>
             <artifactId>org.apache.geronimo.jaxbmodel.common</artifactId>
             <version>${version}</version>
         </dependency>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/META-INF/MANIFEST.MF?rev=990337&r1=990336&r2=990337&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/META-INF/MANIFEST.MF
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/META-INF/MANIFEST.MF
Sat Aug 28 10:34:07 2010
@@ -5,10 +5,11 @@ Bundle-SymbolicName: org.apache.geronimo
 Bundle-Version: 3.0.0
 Bundle-Activator: org.apache.geronimo.st.v21.ui.Activator
 Require-Bundle: org.apache.geronimo.runtime.common,
+ org.apache.geronimo.jee.v21.jaxbmodel,
+ org.apache.geronimo.jee.v22.jaxbmodel,
  org.apache.geronimo.st.v21.core,
  org.apache.geronimo.st.ui,
  org.apache.geronimo.st.v21.ui,
- org.apache.geronimo.jee.v21.jaxbmodel,
  org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.core.commands,

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/pom.xml?rev=990337&r1=990336&r2=990337&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v22.ui/pom.xml Sat
Aug 28 10:34:07 2010
@@ -132,6 +132,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.devtools</groupId>
+            <artifactId>org.apache.geronimo.jee.v22.jaxbmodel</artifactId>
+            <version>${version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.devtools</groupId>
             <artifactId>org.apache.geronimo.runtime.common</artifactId>
             <version>${version}</version>
         </dependency>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/pom.xml?rev=990337&r1=990336&r2=990337&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/pom.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/pom.xml Sat Aug 28 10:34:07 2010
@@ -150,6 +150,7 @@
     <modules>
         <module>org.apache.geronimo.jaxbmodel.common</module>
         <module>org.apache.geronimo.jee.v21.jaxbmodel</module>
+        <module>org.apache.geronimo.jee.v22.jaxbmodel</module>
         <module>org.apache.geronimo.j2ee.v11.jaxbmodel</module>
         <module>org.apache.geronimo.st.core</module>
         <module>org.apache.geronimo.st.v11.core</module>



Mime
View raw message