You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/12/24 02:28:10 UTC

svn commit: r489963 [2/2] - in /geronimo/server/trunk: configs/ configs/cxf/ configs/jee-specs/ configs/jetty6/ configs/openejb/ configs/tomcat6-deployer/src/plan/ configs/tomcat6/ configs/webservices-common/ configs/webservices-common/src/ configs/web...

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,61 @@
+/**
+ *  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.
+ */
+
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+
+package org.apache.geronimo.test.generated;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.apache.geronimo.test.generated package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.geronimo.test.generated
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link Account }
+     * 
+     */
+    public Account createAccount() {
+        return new Account();
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/ObjectFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd Sat Dec 23 17:28:06 2006
@@ -0,0 +1,35 @@
+<?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.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://geronimo.apache.org"
+            xmlns:tns="http://geronimo.apache.org">
+
+  <xsd:element name="Account">
+    <xsd:complexType>
+      <xsd:sequence>
+        <xsd:element name="FirstName" type="xsd:string"
+                     minOccurs="1"  maxOccurs="1"/>
+        <xsd:element name="LastName" type="xsd:string"
+                     minOccurs="1"  maxOccurs="1"/>
+      </xsd:sequence>
+    </xsd:complexType>
+  </xsd:element>
+
+</xsd:schema>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/account.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,24 @@
+/**
+ *  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.
+ */
+
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://geronimo.apache.org")
+package org.apache.geronimo.test.generated;

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/java/org/apache/geronimo/test/generated/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp Sat Dec 23 17:28:06 2006
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!--
+    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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+  version="1.2">
+<jsp:directive.page contentType="text/html"/>
+<jsp:directive.page import="java.io.IOException"/>
+<jsp:directive.page import="org.apache.geronimo.test.JAXBTest"/>
+
+<html><head><title>JSP</title></head>
+<body>
+
+<jsp:scriptlet>
+// Note we need to declare CDATA because we don't escape the less than symbol
+<![CDATA[
+        try {
+            JAXBTest t = new JAXBTest();
+            out.println(t.getImplementation());
+            t.testMarshall();
+            t.testUnmarshall();
+        } catch (Exception e) {
+            e.printStackTrace();
+            IOException exception = new IOException("Error");
+            exception.initCause(e);
+            throw exception;
+        }
+]]>
+</jsp:scriptlet>
+
+</body></html>
+</jsp:root>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/JAXBJSP.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,27 @@
+<?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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
+  <dep:environment>
+    <dep:moduleId>
+      <dep:groupId>JEE5</dep:groupId>
+      <dep:artifactId>JAXBServlet</dep:artifactId>
+      <dep:version>1.1</dep:version>
+      <dep:type>car</dep:type>
+    </dep:moduleId>
+  </dep:environment>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+   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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+    version="2.4">
+    <servlet>
+        <servlet-name>JAXBServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.test.JAXBServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>JAXBServlet</servlet-name>
+        <url-pattern>/JAXBServlet</url-pattern>
+    </servlet-mapping>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,74 @@
+/**
+ *  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.testsuite.testset;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import org.apache.geronimo.testsupport.TestSupport;
+import org.testng.annotations.Test;
+
+public class WebJAXBTest extends TestSupport {
+
+    private String baseURL = "http://localhost:8080/";
+
+    @Test
+    public void testServlet() throws Exception {
+        checkReply("/JAXBServlet");
+    }
+
+
+    @Test
+    public void testJSP() throws Exception {
+        checkReply("/JAXBJSP.jsp");
+    }
+
+    private void checkReply(String address)
+        throws Exception {
+        String warName = System.getProperty("webAppName");
+        assertNotNull(warName);
+        URL url = new URL(baseURL + warName + address);
+        HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+        try {
+            BufferedReader reader = 
+                new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+            assertTrue("Implementation", 
+                       find(reader, "com.sun.xml.bind.v2.runtime.JAXBContextImpl"));
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    private boolean find(BufferedReader reader, String text) 
+        throws IOException {
+        String line = null;
+        while ((line = reader.readLine()) != null) {
+            System.out.println(line);
+            if (line.indexOf(text) != -1) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/jaxb/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebJAXBTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>testsuite</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>jee5-testsuite</artifactId>
+    <name>Geronimo TestSuite, JEE5 Test Suite</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        Tests JEE5 features.
+    </description>
+    
+    <modules>
+        <module>stax</module>
+        <module>jaxb</module>
+    </modules>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,76 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>jee5-testsuite</artifactId>
+    <groupId>org.apache.geronimo.testsuite</groupId>
+    <version>2.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>stax-testsuite</artifactId>
+  <packaging>pom</packaging>
+  <name>Geronimo TestSuite, JEE5 Test Suite, StAX</name>
+  <description>Geronimo jee5-testsuite testsuite created from an archetype.</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>testsuite-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>generate-surefire-xml</id>
+            <phase>install</phase>
+            <goals>
+              <goal>generate-surefire-xml</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>default</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.geronimo.plugins</groupId>
+            <artifactId>geronimo-maven-plugin</artifactId>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.geronimo.genesis.plugins</groupId>
+            <artifactId>maven-maven-plugin</artifactId>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>child</id>
+    </profile>
+  </profiles>
+
+</project>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,115 @@
+<?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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>stax-testsuite</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>test-ejb</artifactId>
+    <name>Geronimo TestSuite, JEE5 Test Suite, StAX :: Test EJB</name>
+    <packaging>jar</packaging>
+
+    <description>This project executes testcases for your testsuite</description>
+
+    <dependencies>
+      <dependency>
+           <groupId>org.apache.geronimo.specs</groupId>
+           <artifactId>geronimo-ejb_2.1_spec</artifactId>
+       </dependency>
+
+       <dependency>
+           <groupId>org.apache.openejb</groupId>
+           <artifactId>openejb-core</artifactId>
+       </dependency>
+
+       <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+       </dependency>
+
+       <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${version}</version>
+       </dependency>
+
+       <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <scope>provided</scope>
+       </dependency>
+   </dependencies>
+
+   <profiles>
+        <profile>
+            <id>child</id>
+            <build>
+                <plugins>
+
+                  <plugin>
+                    <groupId>org.apache.geronimo.genesis.plugins</groupId>
+                    <artifactId>tools-maven-plugin</artifactId>
+                    <extensions>true</extensions>
+                  </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.geronimo.plugins</groupId>
+                        <artifactId>geronimo-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>deploy-ejb</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>deploy-module</goal>
+                                </goals>
+                                <configuration>
+                                  <moduleArchive>${project.build.directory}/${artifactId}-${version}.jar</moduleArchive>
+                                </configuration>
+                            </execution>
+                            
+                            <execution>
+                                <id>undeploy-ejb-as-moduleId</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>undeploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleId>JEE5/StaxEJB/1.1/car</moduleId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
+

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,71 @@
+/**
+ *  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.test;
+
+import java.rmi.RemoteException;
+import java.util.List;
+import java.util.ArrayList;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLEventFactory;
+
+public class StaxBean implements SessionBean {
+
+    private SessionContext sessionContext;
+
+    public void ejbCreate() {
+    }
+
+    public void ejbRemove() {
+    }
+
+    public void ejbActivate() {
+    }
+
+    public void ejbPassivate() {
+    }
+
+    public void setSessionContext(SessionContext sessionContext) {
+        this.sessionContext = sessionContext;
+    }
+    
+    public List testStax() throws RemoteException {
+        List output = new ArrayList();
+        try {
+            XMLInputFactory inFactory = XMLInputFactory.newInstance();
+            output.add(inFactory.getClass().getName());
+            StaxTest.testParse(inFactory);
+            XMLOutputFactory outFactory = XMLOutputFactory.newInstance();
+            output.add(outFactory.getClass().getName());
+            StaxTest.testStreamGenerate(outFactory);
+            XMLEventFactory eventFactory = XMLEventFactory.newInstance();
+            output.add(eventFactory.getClass().getName());
+            StaxTest.testEventGenerate(outFactory, eventFactory);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RemoteException("Error", e);
+        }
+        
+        return output;
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,29 @@
+/**
+ *  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.test;
+
+import java.rmi.RemoteException;
+import javax.ejb.EJBHome;
+import javax.ejb.CreateException;
+
+public interface StaxHome extends EJBHome {
+    
+    public StaxObject create() throws RemoteException, CreateException;
+    
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxHome.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,29 @@
+/**
+ *  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.test;
+
+import java.rmi.RemoteException;
+import java.util.List;
+import javax.ejb.EJBObject;
+
+public interface StaxObject extends EJBObject {
+    
+    public List testStax() throws RemoteException;
+
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,148 @@
+/**
+ *  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.test;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamConstants;
+
+/**
+ * Performs basic tests using the Stax API. 
+ * Some tests might be too delicate if tested with other parsers.
+ */
+public class StaxTest {
+
+    private static String XML = "<foo attr1=\"value1\"><bar>myData</bar></foo>";
+    
+    public static void testParse(XMLInputFactory inFactory) throws Exception {
+        StringReader reader = new StringReader(XML);
+        
+        XMLStreamReader stream = inFactory.createXMLStreamReader(reader);
+        int depth = 0;
+        while(stream.hasNext()) {
+            int event = stream.next();
+            System.out.println(event);
+            switch (event) {
+            case XMLStreamConstants.START_ELEMENT:
+                if (depth == 0) {
+                    if (!stream.getLocalName().equals("foo")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                    if (1 != stream.getAttributeCount()) {
+                        throw new Exception("unexpected number of attributes: " + 
+                                           stream.getAttributeCount());
+                    }
+                    if (!("value1".equals(stream.getAttributeValue(0)))) {
+                        throw new Exception("unexpected attribute value: " +
+                                            stream.getAttributeValue(0));
+                    }
+                } else if (depth == 1) {
+                    if (!stream.getLocalName().equals("bar")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                    if (0 != stream.getAttributeCount()) {
+                        throw new Exception("unexpected number of attributes: " + 
+                                           stream.getAttributeCount());
+                    }
+                } else {
+                    throw new Exception("unexpected element: " + stream.getLocalName());
+                }
+                depth++;
+                break;
+            case XMLStreamConstants.END_ELEMENT:
+                if (depth == 1) {
+                    if (!stream.getLocalName().equals("foo")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                } else if (depth == 2) {
+                    if (!stream.getLocalName().equals("bar")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                } else {
+                    throw new Exception("unexpected element: " + stream.getLocalName());
+                }
+                depth--;
+                break;
+            case XMLStreamConstants.CHARACTERS:
+                if (!(depth == 2 && "myData".equals(stream.getText()))) {
+                    throw new Exception("unexpected character data: " + stream.getText());
+                }
+                break;
+            }            
+          }
+    }
+    
+    public static void testStreamGenerate(XMLOutputFactory outFactory) throws Exception {
+        
+        StringWriter strWriter = new StringWriter();
+        
+        XMLStreamWriter writer = outFactory.createXMLStreamWriter(strWriter);
+        writer.writeStartElement("foo");
+        writer.writeAttribute("attr1", "value1");
+        writer.writeStartElement("bar");
+        writer.writeCharacters("myData");
+        writer.writeEndElement();
+        writer.writeEndElement();
+        
+        writer.flush();
+        writer.close();
+        
+        String actual = strWriter.toString();
+        
+        System.out.println(actual);
+        
+        if (!XML.equals(actual)) {
+            throw new Exception("Expected: " + XML + " Actual: " + actual);
+        }
+    }
+
+    public static void testEventGenerate(XMLOutputFactory outFactory,
+                                         XMLEventFactory eventFactory) throws Exception {
+        
+        StringWriter strWriter = new StringWriter();
+        
+        XMLEventWriter writer = outFactory.createXMLEventWriter(strWriter);
+        
+        
+        writer.add(eventFactory.createStartElement("", null, "foo"));
+        writer.add(eventFactory.createAttribute("attr1", "value1"));
+        writer.add(eventFactory.createStartElement("", null, "bar"));
+        writer.add(eventFactory.createCharacters("myData"));
+        writer.add(eventFactory.createEndElement("", null, "bar"));
+        writer.add(eventFactory.createEndElement("", null, "foo"));
+        
+        writer.flush();
+        writer.close();
+        
+        String actual = strWriter.toString();
+        
+        System.out.println(actual);
+        
+        if (!XML.equals(actual)) {
+            throw new Exception("Expected: " + XML + " Actual: " + actual);
+        }
+    }
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/java/org/apache/geronimo/test/StaxTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,40 @@
+<?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.
+-->
+<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
+  <enterprise-beans>
+    <session>
+      <ejb-name>Stax</ejb-name>
+      <home>org.apache.geronimo.test.StaxHome</home>
+      <remote>org.apache.geronimo.test.StaxObject</remote>
+      <ejb-class>org.apache.geronimo.test.StaxBean</ejb-class>
+      <session-type>Stateless</session-type>
+      <transaction-type>Container</transaction-type>
+    </session>
+  </enterprise-beans>
+  <assembly-descriptor>
+    <container-transaction>
+      <method>
+        <ejb-name>Stax</ejb-name>
+        <method-name>*</method-name>
+      </method>
+      <trans-attribute>Required</trans-attribute>
+    </container-transaction>
+  </assembly-descriptor>
+</ejb-jar>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,41 @@
+<?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.
+-->
+<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2"
+  xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"
+  xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+ xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+
+    <environment>
+        <moduleId>
+            <groupId>JEE5</groupId>
+            <artifactId>StaxEJB</artifactId>
+            <version>1.1</version>
+            <type>car</type>
+        </moduleId>
+   </environment>
+
+ <enterprise-beans>
+    <session>
+      <ejb-name>Stax</ejb-name>
+      <jndi-name>Stax</jndi-name>
+    </session>
+  </enterprise-beans>
+
+</openejb-jar>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,74 @@
+/**
+ *  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.testsuite.testset;
+
+import java.util.Properties;
+import java.util.List;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+
+import org.apache.geronimo.test.StaxHome;
+import org.apache.geronimo.test.StaxObject;
+
+import org.apache.geronimo.testsupport.TestSupport;
+import org.testng.annotations.Test;
+
+public class EJBStaxTest extends TestSupport {
+
+    @Test
+    public void testEJB() throws Exception {
+        Properties p = new Properties();
+    
+        p.put("java.naming.factory.initial", 
+              "org.apache.openejb.client.RemoteInitialContextFactory");
+        p.put("java.naming.provider.url", 
+              "127.0.0.1:4201");
+        p.put("java.naming.security.principal", 
+              "myuser");
+        p.put("java.naming.security.credentials", 
+              "mypass");    
+        
+        InitialContext ctx = new InitialContext(p);
+        
+        Object obj = ctx.lookup("/Stax");
+        
+        StaxHome ejbHome = 
+            (StaxHome)PortableRemoteObject.narrow(obj, StaxHome.class);
+
+        StaxObject ejbObject = ejbHome.create();
+    
+        List factoryList = ejbObject.testStax();
+
+        assertEquals(3, factoryList.size());
+        assertEquals("InputFactory", 
+                     "com.ctc.wstx.stax.WstxInputFactory",
+                     factoryList.get(0));
+
+        assertEquals("OutputFactory", 
+                     "com.ctc.wstx.stax.WstxOutputFactory",
+                     factoryList.get(1));
+
+        assertEquals("EventFactory", 
+                     "com.ctc.wstx.stax.WstxEventFactory",
+                     factoryList.get(2));
+
+        System.out.println( factoryList );
+    }
+    
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBStaxTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,122 @@
+<?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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.testsuite</groupId>
+        <artifactId>stax-testsuite</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>test-war</artifactId>
+    <name>Geronimo TestSuite, JEE5 Test Suite, StAX :: Test WAR</name>
+    <packaging>war</packaging>
+
+    <description>This project executes testcases for your testsuite</description>
+
+  <dependencies>
+
+     <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <scope>provided</scope>
+     </dependency>
+
+     <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_2.5_spec</artifactId> 
+            <scope>provided</scope>
+     </dependency>
+
+  </dependencies>
+
+
+   <profiles>
+        <profile>
+            <id>child</id>
+            <build>
+                <plugins>
+
+                  <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <configuration>
+                       <systemProperties>
+                          <property>
+                             <name>webAppName</name>
+                             <value>${artifactId}-${version}</value>
+                          </property>
+                       </systemProperties>
+                    </configuration>
+                  </plugin>
+
+                  <plugin>
+                    <groupId>org.apache.geronimo.genesis.plugins</groupId>
+                    <artifactId>tools-maven-plugin</artifactId>
+                    <extensions>true</extensions>
+                  </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <configuration>
+                            <webXml>${pom.basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
+                            <warSourceIncludes>WEB-INF/lib/${artifactId}-${version}.jar, **/*.jsp, **/*.xml, **/*.class</warSourceIncludes>
+                        </configuration>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.geronimo.plugins</groupId>
+                        <artifactId>geronimo-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>deploy-wars</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>deploy-module</goal>
+                                </goals>
+                                <configuration>
+                                  <moduleArchive>${project.build.directory}/${artifactId}-${version}.war</moduleArchive>
+                                </configuration>
+                            </execution>
+                            
+                            <execution>
+                                <id>undeploy-war-as-moduleId</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>undeploy-module</goal>
+                                </goals>
+                                <configuration>
+                                    <moduleId>JEE5/StaxServlet/1.1/car</moduleId>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
+

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,64 @@
+/**
+ *  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.test;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLEventFactory;
+
+public class StaxServlet extends HttpServlet {
+
+    public void doGet(HttpServletRequest theRequest,
+                      HttpServletResponse theResponse) 
+        throws IOException {
+
+        PrintWriter pw = theResponse.getWriter();
+
+        theResponse.setContentType("text/html");
+        pw.println("<html><head><title>Servlet</title></head>");
+        pw.println("<body>");
+
+        try {
+            XMLInputFactory inFactory = XMLInputFactory.newInstance();
+            pw.println(inFactory.getClass().getName());
+            StaxTest.testParse(inFactory);
+            XMLOutputFactory outFactory = XMLOutputFactory.newInstance();
+            pw.println(outFactory.getClass().getName());
+            StaxTest.testStreamGenerate(outFactory);
+            XMLEventFactory eventFactory = XMLEventFactory.newInstance();
+            pw.println(eventFactory.getClass().getName());
+            StaxTest.testEventGenerate(outFactory, eventFactory);
+        } catch (Exception e) {
+            e.printStackTrace();
+            IOException exception = new IOException("Error");
+            exception.initCause(e);
+            throw exception;
+        }
+        
+        pw.println("</body></html>");
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxServlet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java Sat Dec 23 17:28:06 2006
@@ -0,0 +1,148 @@
+/**
+ *  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.test;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamConstants;
+
+/**
+ * Performs basic tests using the Stax API. 
+ * Some tests might be too delicate if tested with other parsers.
+ */
+public class StaxTest {
+
+    private static String XML = "<foo attr1=\"value1\"><bar>myData</bar></foo>";
+    
+    public static void testParse(XMLInputFactory inFactory) throws Exception {
+        StringReader reader = new StringReader(XML);
+        
+        XMLStreamReader stream = inFactory.createXMLStreamReader(reader);
+        int depth = 0;
+        while(stream.hasNext()) {
+            int event = stream.next();
+            System.out.println(event);
+            switch (event) {
+            case XMLStreamConstants.START_ELEMENT:
+                if (depth == 0) {
+                    if (!stream.getLocalName().equals("foo")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                    if (1 != stream.getAttributeCount()) {
+                        throw new Exception("unexpected number of attributes: " + 
+                                           stream.getAttributeCount());
+                    }
+                    if (!("value1".equals(stream.getAttributeValue(0)))) {
+                        throw new Exception("unexpected attribute value: " +
+                                            stream.getAttributeValue(0));
+                    }
+                } else if (depth == 1) {
+                    if (!stream.getLocalName().equals("bar")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                    if (0 != stream.getAttributeCount()) {
+                        throw new Exception("unexpected number of attributes: " + 
+                                           stream.getAttributeCount());
+                    }
+                } else {
+                    throw new Exception("unexpected element: " + stream.getLocalName());
+                }
+                depth++;
+                break;
+            case XMLStreamConstants.END_ELEMENT:
+                if (depth == 1) {
+                    if (!stream.getLocalName().equals("foo")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                } else if (depth == 2) {
+                    if (!stream.getLocalName().equals("bar")) {
+                        throw new Exception("unexpected element: " + stream.getLocalName());
+                    }
+                } else {
+                    throw new Exception("unexpected element: " + stream.getLocalName());
+                }
+                depth--;
+                break;
+            case XMLStreamConstants.CHARACTERS:
+                if (!(depth == 2 && "myData".equals(stream.getText()))) {
+                    throw new Exception("unexpected character data: " + stream.getText());
+                }
+                break;
+            }            
+          }
+    }
+    
+    public static void testStreamGenerate(XMLOutputFactory outFactory) throws Exception {
+        
+        StringWriter strWriter = new StringWriter();
+        
+        XMLStreamWriter writer = outFactory.createXMLStreamWriter(strWriter);
+        writer.writeStartElement("foo");
+        writer.writeAttribute("attr1", "value1");
+        writer.writeStartElement("bar");
+        writer.writeCharacters("myData");
+        writer.writeEndElement();
+        writer.writeEndElement();
+        
+        writer.flush();
+        writer.close();
+        
+        String actual = strWriter.toString();
+        
+        System.out.println(actual);
+        
+        if (!XML.equals(actual)) {
+            throw new Exception("Expected: " + XML + " Actual: " + actual);
+        }
+    }
+
+    public static void testEventGenerate(XMLOutputFactory outFactory,
+                                         XMLEventFactory eventFactory) throws Exception {
+        
+        StringWriter strWriter = new StringWriter();
+        
+        XMLEventWriter writer = outFactory.createXMLEventWriter(strWriter);
+        
+        
+        writer.add(eventFactory.createStartElement("", null, "foo"));
+        writer.add(eventFactory.createAttribute("attr1", "value1"));
+        writer.add(eventFactory.createStartElement("", null, "bar"));
+        writer.add(eventFactory.createCharacters("myData"));
+        writer.add(eventFactory.createEndElement("", null, "bar"));
+        writer.add(eventFactory.createEndElement("", null, "foo"));
+        
+        writer.flush();
+        writer.close();
+        
+        String actual = strWriter.toString();
+        
+        System.out.println(actual);
+        
+        if (!XML.equals(actual)) {
+            throw new Exception("Expected: " + XML + " Actual: " + actual);
+        }
+    }
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/java/org/apache/geronimo/test/StaxTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp Sat Dec 23 17:28:06 2006
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!--
+    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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+  version="1.2">
+<jsp:directive.page contentType="text/html"/>
+<jsp:directive.page import="javax.xml.stream.*"/>
+<jsp:directive.page import="java.io.IOException"/>
+<jsp:directive.page import="org.apache.geronimo.test.StaxTest"/>
+
+<html><head><title>JSP</title></head>
+<body>
+
+<jsp:scriptlet>
+// Note we need to declare CDATA because we don't escape the less than symbol
+<![CDATA[
+        try {
+            XMLInputFactory inFactory = XMLInputFactory.newInstance();
+            out.println(inFactory.getClass().getName());
+            StaxTest.testParse(inFactory);
+            XMLOutputFactory outFactory = XMLOutputFactory.newInstance();
+            out.println(outFactory.getClass().getName());
+            StaxTest.testStreamGenerate(outFactory);
+            XMLEventFactory eventFactory = XMLEventFactory.newInstance();
+            out.println(eventFactory.getClass().getName());
+            StaxTest.testEventGenerate(outFactory, eventFactory);
+        } catch (Exception e) {
+            e.printStackTrace();
+            IOException exception = new IOException("Error");
+            exception.initCause(e);
+            throw exception;
+        }
+]]>
+</jsp:scriptlet>
+
+</body></html>
+</jsp:root>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/StaxJSP.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,27 @@
+<?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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
+  <dep:environment>
+    <dep:moduleId>
+      <dep:groupId>JEE5</dep:groupId>
+      <dep:artifactId>StaxServlet</dep:artifactId>
+      <dep:version>1.1</dep:version>
+      <dep:type>car</dep:type>
+    </dep:moduleId>
+  </dep:environment>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml Sat Dec 23 17:28:06 2006
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+   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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+    version="2.4">
+    <servlet>
+        <servlet-name>StaxServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.test.StaxServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>StaxServlet</servlet-name>
+        <url-pattern>/StaxServlet</url-pattern>
+    </servlet-mapping>
+</web-app>

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java?view=auto&rev=489963
==============================================================================
--- geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java (added)
+++ geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java Sat Dec 23 17:28:06 2006
@@ -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.testsuite.testset;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import org.apache.geronimo.testsupport.TestSupport;
+import org.testng.annotations.Test;
+
+public class WebStaxTest extends TestSupport {
+
+    private String baseURL = "http://localhost:8080/";
+
+    @Test
+    public void testServlet() throws Exception {
+        checkReply("/StaxServlet");
+    }
+
+    @Test
+    public void testJSP() throws Exception {
+        checkReply("/StaxJSP.jsp");
+    }
+
+    private void checkReply(String address)
+        throws Exception {
+        String warName = System.getProperty("webAppName");
+        assertNotNull(warName);
+        URL url = new URL(baseURL + warName + address);
+        HttpURLConnection connection = (HttpURLConnection)url.openConnection();
+        try {
+            BufferedReader reader = 
+                new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+            assertTrue("InputFactory", 
+                       find(reader, "com.ctc.wstx.stax.WstxInputFactory"));
+            assertTrue("OutputFactory", 
+                       find(reader, "com.ctc.wstx.stax.WstxOutputFactory"));
+            assertTrue("EventFactory", 
+                       find(reader, "com.ctc.wstx.stax.WstxEventFactory"));
+        } finally {
+            connection.disconnect();
+        }
+    }
+
+    private boolean find(BufferedReader reader, String text) 
+        throws IOException {
+        String line = null;
+        while ((line = reader.readLine()) != null) {
+            System.out.println(line);
+            if (line.indexOf(text) != -1) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/jee5-testsuite/stax/test-war/src/test/java/org/apache/geronimo/testsuite/testset/WebStaxTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/pom.xml?view=diff&rev=489963&r1=489962&r2=489963
==============================================================================
--- geronimo/server/trunk/testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/pom.xml Sat Dec 23 17:28:06 2006
@@ -71,6 +71,7 @@
         <module>deployment-testsuite</module>
         <module>enterprise-testsuite</module>
         <module>web-testsuite</module>
+        <module>jee5-testsuite</module>
     </modules>
 
     <build>