geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 54976 - in geronimo/trunk/modules: j2ee-schema/src/test-data/j2ee_1_2dtd j2ee-schema/src/test/org/apache/geronimo/schema jetty/src/java/org/apache/geronimo/jetty/deployment
Date Sun, 17 Oct 2004 22:14:06 GMT
Author: djencks
Date: Sun Oct 17 15:14:05 2004
New Revision: 54976

Added:
   geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/
   geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/web-1-22.xml
   geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/web-1-24.xml
Modified:
   geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Log:
add a servlet 2.2 test case, and remove bogus call to validate untranformed documents from
JettyModuleBuilder

Added: geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/web-1-22.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/web-1-22.xml	Sun Oct 17 15:14:05
2004
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN' 'http://java.sun.com/j2ee/dtds/web-app_2_2.dtd'>
+
+<web-app>
+    <display-name>display name</display-name>
+    <description>no description</description>
+    <servlet>
+        <servlet-name>servletname</servlet-name>
+        <display-name>servlet display name</display-name>
+        <description>no description</description>
+        <servlet-class>com.nowhere.Servlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>servletname</servlet-name>
+        <url-pattern>/urlPattern</url-pattern>
+    </servlet-mapping>
+    <session-config>
+        <session-timeout>60</session-timeout>
+    </session-config>
+</web-app>

Added: geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/web-1-24.xml
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_2dtd/web-1-24.xml	Sun Oct 17 15:14:05
2004
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee">
+  <description>no description</description>
+  <display-name>display name</display-name>
+  <servlet>
+    <description>no description</description>
+    <display-name>servlet display name</display-name>
+    <servlet-name>servletname</servlet-name>
+    <servlet-class>com.nowhere.Servlet</servlet-class>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>servletname</servlet-name>
+    <url-pattern>/urlPattern</url-pattern>
+  </servlet-mapping>
+  <session-config>
+    <session-timeout>60</session-timeout>
+  </session-config>
+</web-app>
+

Modified: geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
(original)
+++ geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
Sun Oct 17 15:14:05 2004
@@ -256,6 +256,22 @@
         assertTrue("Differences: " + problems, ok2);
     }
 
+    public void testWeb22To24Transform1() throws Exception {
+        File srcXml = new File(basedir, "src/test-data/j2ee_1_2dtd/web-1-22.xml");
+        File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_2dtd/web-1-24.xml");
+        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
+        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
+//        System.out.println(xmlObject.toString());
+//        System.out.println(expected.toString());
+        List problems = new ArrayList();
+        boolean ok = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences: " + problems, ok);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
+        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
+        assertTrue("Differences: " + problems, ok2);
+    }
+
     public void testEJB21To21DoesNothing() throws Exception {
         File srcXml = new File(basedir, "src/test-data/j2ee_1_4schema/ejb-jar.xml");
         File expectedOutputXml = new File(basedir, "src/test-data/j2ee_1_4schema/ejb-jar.xml");

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Sun Oct 17 15:14:05 2004
@@ -118,7 +118,6 @@
 
             // parse it
             XmlObject parsed = SchemaConversionUtils.parse(specDD);
-            SchemaConversionUtils.validateDD(parsed);
             WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
         } catch (XmlException xmle) {

Mime
View raw message