Author: markt Date: Tue May 29 20:04:42 2018 New Revision: 1832476 URL: http://svn.apache.org/viewvc?rev=1832476&view=rev Log: Expand the test coverage
Modified: tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java Modified: tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java?rev=1832476&r1=1832475&r2=1832476&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java (original) +++ tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java Tue May 29 20:04:42 2018 @@ -220,6 +220,25 @@ public class TestHttpParserHost { Class<? extends Exception> exceptionClass = null; int result = -1; try { + result = Host.parse(input); + } catch (Exception e) { + exceptionClass = e.getClass(); + } + Assert.assertEquals(input, expectedResult.intValue(), result); + if (expectedException == null) { + Assert.assertNull(input, exceptionClass); + } else { + Assert.assertNotNull(exceptionClass); + Assert.assertTrue(input, expectedException.isAssignableFrom(exceptionClass)); + } + } + + + @Test + public void testHostType() { + Class<? extends Exception> exceptionClass = null; + int result = -1; + try { StringReader sr = new StringReader(input); switch(testType) { case IPv4: --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org