Add missing test from jetty-7

This commit is contained in:
Jan Bartel 2012-03-15 09:53:12 +11:00
parent fef74963af
commit 83ce567e66
1 changed files with 18 additions and 0 deletions

View File

@ -87,6 +87,24 @@ public class WebAppContextTest
assertTrue(Arrays.equals(configs,wac.getConfigurations()));
}
@Test
public void testRealPathDoesNotExist() throws Exception
{
Server server = new Server(0);
WebAppContext context = new WebAppContext(".", "/");
server.setHandler(context);
server.start();
// When
ServletContext ctx = context.getServletContext();
// Then
// This passes:
assertNotNull(ctx.getRealPath("/doesnotexist"));
// This fails:
assertNotNull(ctx.getRealPath("/doesnotexist/"));
}
/**
* tests that the servlet context white list works
*