You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2018/05/29 20:04:43 UTC
svn commit: r1832476 -
/tomcat/trunk/test/org/apache/tomcat/util/http/parser/TestHttpParserHost.java
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org