Tweak DefaultServletTest for windows.

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@923 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Jan Bartel 2009-09-17 02:20:47 +00:00
parent a0ba8a3bc3
commit de5a44532c
2 changed files with 19 additions and 17 deletions

View File

@ -34,6 +34,7 @@ jetty-7.0.0.RC6-SNAPSHOT
+ 288182 PUT request fails during retry + 288182 PUT request fails during retry
+ 289221 HttpExchange does not timeout when using blocking connector + 289221 HttpExchange does not timeout when using blocking connector
+ 289285 org.eclipse.jetty.continuation 7.0.0.RC5 imports the org.mortbay.util.ajax package + 289285 org.eclipse.jetty.continuation 7.0.0.RC5 imports the org.mortbay.util.ajax package
+ Tweak DefaultServletTest under windows
jetty-6.1.20 27 August 2009 jetty-6.1.20 27 August 2009
+ JETTY-838 Don't log and throw + JETTY-838 Don't log and throw

View File

@ -99,30 +99,29 @@ public class DefaultServletTest extends TestCase
new File(resBase, "two").mkdir(); new File(resBase, "two").mkdir();
new File(resBase, "three").mkdir(); new File(resBase, "three").mkdir();
if ( !_runningOnWindows ) if ( !_runningOnWindows )
{
assertTrue("Creating dir 'f??r' (Might not work in Windows)", new File(resBase, "f??r").mkdir()); assertTrue("Creating dir 'f??r' (Might not work in Windows)", new File(resBase, "f??r").mkdir());
String resBasePath = resBase.getAbsolutePath(); String resBasePath = resBase.getAbsolutePath();
defholder.setInitParameter( "resourceBase", resBasePath ); defholder.setInitParameter( "resourceBase", resBasePath );
StringBuffer req1 = new StringBuffer(); StringBuffer req1 = new StringBuffer();
/* /*
* Intentionally bad request URI. Sending a non-encoded URI with typically encoded characters '<', '>', and * Intentionally bad request URI. Sending a non-encoded URI with typically encoded characters '<', '>', and
* '"'. * '"'.
*/ */
req1.append( "GET /context/;<script>window.alert(\"hi\");</script> HTTP/1.1\n" ); req1.append( "GET /context/;<script>window.alert(\"hi\");</script> HTTP/1.1\n" );
req1.append( "Host: localhost\n" ); req1.append( "Host: localhost\n" );
req1.append( "\n" ); req1.append( "\n" );
String response = connector.getResponses( req1.toString() ); String response = connector.getResponses( req1.toString() );
assertResponseContains( "/one/", response ); assertResponseContains( "/one/", response );
assertResponseContains( "/two/", response ); assertResponseContains( "/two/", response );
assertResponseContains( "/three/", response ); assertResponseContains( "/three/", response );
if ( !_runningOnWindows )
assertResponseContains( "/f%3F%3Fr", response ); assertResponseContains( "/f%3F%3Fr", response );
assertResponseNotContains( "<script>", response ); assertResponseNotContains( "<script>", response );
}
} }
public void testListingProperUrlEncoding() throws Exception public void testListingProperUrlEncoding() throws Exception
@ -236,6 +235,8 @@ public class DefaultServletTest extends TestCase
response= connector.getResponses("GET /context/dir%3F/ HTTP/1.0\r\n\r\n"); response= connector.getResponses("GET /context/dir%3F/ HTTP/1.0\r\n\r\n");
assertResponseContains("Directory: /context/dir?/<",response); assertResponseContains("Directory: /context/dir?/<",response);
} }
else
assertResponseContains("404",response);
response= connector.getResponses("GET /context/index.html HTTP/1.0\r\n\r\n"); response= connector.getResponses("GET /context/index.html HTTP/1.0\r\n\r\n");
assertResponseContains("Hello Index",response); assertResponseContains("Hello Index",response);