From 2f94028141269693a88885923d73248c7a6c2103 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 7 Mar 2010 11:27:20 +0000 Subject: [PATCH] Check all versions are correctly parsed git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@919968 13f79535-47bb-0310-9956-ffa450edef68 --- test/org/apache/catalina/deploy/TestWebXml.java | 42 ++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/test/org/apache/catalina/deploy/TestWebXml.java b/test/org/apache/catalina/deploy/TestWebXml.java index d8c5ca6c2..7909a88fe 100644 --- a/test/org/apache/catalina/deploy/TestWebXml.java +++ b/test/org/apache/catalina/deploy/TestWebXml.java @@ -71,7 +71,37 @@ public class TestWebXml extends TestCase { assertEquals(500, webxml.getMinorVersion()); } - public void testParsePublicIdVersion() { + public void testParsePublicIdVersion22() { + + WebXml webxml = new WebXml(); + + webxml.setPublicId( + org.apache.catalina.startup.Constants.WebDtdPublicId_22); + assertEquals(2, webxml.getMajorVersion()); + assertEquals(2, webxml.getMinorVersion()); + } + + public void testParsePublicIdVersion23() { + + WebXml webxml = new WebXml(); + + webxml.setPublicId( + org.apache.catalina.startup.Constants.WebDtdPublicId_23); + assertEquals(2, webxml.getMajorVersion()); + assertEquals(3, webxml.getMinorVersion()); + } + + public void testParsePublicIdVersion24() { + + WebXml webxml = new WebXml(); + + webxml.setPublicId( + org.apache.catalina.startup.Constants.WebSchemaPublicId_24); + assertEquals(2, webxml.getMajorVersion()); + assertEquals(4, webxml.getMinorVersion()); + } + + public void testParsePublicIdVersion25() { WebXml webxml = new WebXml(); @@ -80,4 +110,14 @@ public class TestWebXml extends TestCase { assertEquals(2, webxml.getMajorVersion()); assertEquals(5, webxml.getMinorVersion()); } + + public void testParsePublicIdVersion30() { + + WebXml webxml = new WebXml(); + + webxml.setPublicId( + org.apache.catalina.startup.Constants.WebSchemaPublicId_30); + assertEquals(3, webxml.getMajorVersion()); + assertEquals(0, webxml.getMinorVersion()); + } } -- 2.11.0