@@ -232,15 +232,15 @@ void testServePathsNoName() {
232232 @ Test
233233 void testDefaultRoutes () throws Exception {
234234 WebApp app = WebApps .
235- $for ("test" , TestWebApp .class , this , "ws" ).
235+ $for ("test-default-routes " , TestWebApp .class , this , "ws" ).
236236 withResourceConfig (configure ()).start ();
237237 String baseUrl = baseUrl (app );
238238 try {
239- assertEquals ("foo" , getContent (baseUrl + "test/foo" ).trim ());
240- assertEquals ("foo" , getContent (baseUrl + "test/foo/index" ).trim ());
241- assertEquals ("bar" , getContent (baseUrl + "test/foo/bar" ).trim ());
242- // assertEquals("default", getContent(baseUrl + "test").trim());
243- assertEquals ("default" , getContent (baseUrl + "test/" ).trim ());
239+ assertEquals ("foo" , getContent (baseUrl + "test-default-routes /foo" ).trim ());
240+ assertEquals ("foo" , getContent (baseUrl + "test-default-routes /foo/index" ).trim ());
241+ assertEquals ("bar" , getContent (baseUrl + "test-default-routes /foo/bar" ).trim ());
242+ // assertEquals("default", getContent(baseUrl + "test-default-routes ").trim());
243+ assertEquals ("default" , getContent (baseUrl + "test-default-routes /" ).trim ());
244244 // assertEquals("default", getContent(baseUrl).trim());
245245 } finally {
246246 app .stop ();
@@ -260,20 +260,20 @@ public void setup() {
260260 }
261261 };
262262
263- WebApp app = WebApps .$for ("test" , this )
263+ WebApp app = WebApps .$for ("test-custom-routes " , this )
264264 .withResourceConfig (configure ())
265265 .start (newWebApp );
266266
267267 String baseUrl = baseUrl (app );
268268 try {
269- assertEquals ("foo" , getContent (baseUrl + "test/" ).trim ());
270- assertEquals ("foo1" , getContent (baseUrl + "test/1" ).trim ());
271- assertEquals ("bar" , getContent (baseUrl + "test/bar/foo" ).trim ());
272- assertEquals ("default" , getContent (baseUrl + "test/foo/bar" ).trim ());
273- assertEquals ("default1" , getContent (baseUrl + "test/foo/1" ).trim ());
274- assertEquals ("default2" , getContent (baseUrl + "test/foo/bar/2" ).trim ());
275- assertEquals (404 , getResponseCode (baseUrl ));
276- assertEquals (404 , getResponseCode (baseUrl + "test/goo" ));
269+ assertEquals ("foo" , getContent (baseUrl + "test-custom-routes /" ).trim ());
270+ assertEquals ("foo1" , getContent (baseUrl + "test-custom-routes /1" ).trim ());
271+ assertEquals ("bar" , getContent (baseUrl + "test-custom-routes /bar/foo" ).trim ());
272+ assertEquals ("default" , getContent (baseUrl + "test-custom-routes /foo/bar" ).trim ());
273+ assertEquals ("default1" , getContent (baseUrl + "test-custom-routes /foo/1" ).trim ());
274+ assertEquals ("default2" , getContent (baseUrl + "test-custom-routes /foo/bar/2" ).trim ());
275+ // assertEquals(404, getResponseCode(baseUrl));
276+ assertEquals (404 , getResponseCode (baseUrl + "test-custom-routes /goo" ));
277277 assertEquals (200 , getResponseCode (baseUrl + "ws/v1/test" ));
278278 assertTrue (getContent (baseUrl + "ws/v1/test" ).contains ("myInfo" ));
279279 } finally {
@@ -289,21 +289,21 @@ void testEncodedUrl() throws Exception {
289289 public void setup () {
290290 route ("/:foo" , FooController .class );
291291 }
292- };
292+ };
293293
294- WebApp app = WebApps .$for ("test" , TestWebApp .class , this , "ws" )
294+ WebApp app = WebApps .$for ("test-encoded-urls " , TestWebApp .class , this , "ws" )
295295 .withResourceConfig (configure ()).start (webApp );
296296 String baseUrl = baseUrl (app );
297297
298298 try {
299299 // Test encoded url
300300 String rawPath = "localhost:8080" ;
301- String encodedUrl = baseUrl + "test/" +
301+ String encodedUrl = baseUrl + "test-encoded-urls /" +
302302 URLEncoder .encode (rawPath , "UTF-8" );
303303 assertEquals ("foo" + rawPath , getContent (encodedUrl ).trim ());
304304
305305 rawPath = "@;%$" ;
306- encodedUrl = baseUrl + "test/" +
306+ encodedUrl = baseUrl + "test-encoded-urls /" +
307307 URLEncoder .encode (rawPath , "UTF-8" );
308308 assertEquals ("foo" + rawPath , getContent (encodedUrl ).trim ());
309309 } finally {
@@ -320,7 +320,7 @@ public void setup() {
320320 }
321321 };
322322
323- WebApp app = WebApps .$for ("test" , TestWebApp .class , this , "ws" )
323+ WebApp app = WebApps .$for ("test-robots-txt " , TestWebApp .class , this , "ws" )
324324 .withResourceConfig (configure ()).start (newWebApp );
325325 String baseUrl = baseUrl (app );
326326 try {
@@ -352,15 +352,15 @@ public void setup() {
352352 }
353353 };
354354
355- WebApp app = WebApps .$for ("test" , this )
355+ WebApp app = WebApps .$for ("test-yarn-webapp-context " , this )
356356 .withResourceConfig (configure ())
357357 .start (webApp );
358358 String baseUrl = baseUrl (app );
359359 try {
360360 // Not able to access a non-existing dir, should not redirect to foo.
361361 assertEquals (404 , getResponseCode (baseUrl + "logs" ));
362362 // should be able to redirect to foo.
363- assertEquals ("foo" , getContent (baseUrl + "test/foo" ).trim ());
363+ assertEquals ("foo" , getContent (baseUrl + "test-yarn-webapp-context /foo" ).trim ());
364364 } finally {
365365 app .stop ();
366366 }
0 commit comments