ASF Bugzilla – Attachment 30528 Details for
Bug 55166
schemaLocation references between servlet and jsp XSDs are invalid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Same as 30527 but with ASF header and link to this issue
55166-3.patch (text/plain), 3.54 KB, created by
Jeremy Boynes
on 2013-07-03 03:46:49 UTC
(
hide
)
Description:
Same as 30527 but with ASF header and link to this issue
Filename:
MIME Type:
Creator:
Jeremy Boynes
Created:
2013-07-03 03:46:49 UTC
Size:
3.54 KB
patch
obsolete
>Index: test/javax/servlet/TestSchemaValidation.java >=================================================================== >--- test/javax/servlet/TestSchemaValidation.java (revision 0) >+++ test/javax/servlet/TestSchemaValidation.java (revision 0) >@@ -0,0 +1,50 @@ >+/* >+ * 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 javax.servlet; >+ >+import java.io.File; >+import java.net.URL; >+import javax.xml.XMLConstants; >+import javax.xml.parsers.DocumentBuilder; >+import javax.xml.parsers.DocumentBuilderFactory; >+import javax.xml.validation.Schema; >+import javax.xml.validation.SchemaFactory; >+ >+import junit.framework.Assert; >+import org.junit.Test; >+import org.w3c.dom.Document; >+ >+public class TestSchemaValidation { >+ >+ /** >+ * Test for https://issues.apache.org/bugzilla/show_bug.cgi?id=55166 >+ */ >+ @Test >+ public void testValidation() throws Exception { >+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); >+ URL url = ServletContext.class.getResource("/javax/servlet/resources/web-app_3_1.xsd"); >+ System.out.println("url = " + url); >+ Schema schema = schemaFactory.newSchema(url); >+ >+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); >+ factory.setNamespaceAware(true); >+ factory.setSchema(schema); >+ DocumentBuilder builder = factory.newDocumentBuilder(); >+ Document document = builder.parse(new File("test/webapp/WEB-INF/web.xml")); >+ Assert.assertEquals("web-app", document.getDocumentElement().getLocalName()); >+ } >+} >Index: test/webapp/WEB-INF/web.xml >=================================================================== >--- test/webapp/WEB-INF/web.xml (revision 1499184) >+++ test/webapp/WEB-INF/web.xml (working copy) >@@ -43,9 +43,9 @@ > </filter-mapping> > <filter-mapping> > <filter-name>Bug49922</filter-name> >+ <servlet-name>Bug49922Target</servlet-name> > <dispatcher>FORWARD</dispatcher> > <dispatcher>INCLUDE</dispatcher> >- <servlet-name>Bug49922Target</servlet-name> > </filter-mapping> > <servlet> > <servlet-name>Bug49922Forward</servlet-name> >@@ -98,9 +98,9 @@ > > <jsp-config> > <jsp-property-group> >- <default-content-type>text/plain</default-content-type> > <url-pattern>/bug49nnn/bug49726a.jsp</url-pattern> > <url-pattern>/bug49nnn/bug49726b.jsp</url-pattern> >+ <default-content-type>text/plain</default-content-type> > </jsp-property-group> > </jsp-config> > >@@ -129,8 +129,8 @@ > <env-entry> > <description>Resource for testing bug 53465</description> > <env-entry-name>bug53465</env-entry-name> >+ <env-entry-type>java.lang.Integer</env-entry-type> > <env-entry-value>10</env-entry-value> >- <env-entry-type>java.lang.Integer</env-entry-type> > <mapped-name>Bug53465MappedName</mapped-name> > </env-entry> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55166
:
30508
|
30526
|
30527
| 30528 |
30556
|
30567