Skip to content

Commit 9ad6515

Browse files
committed
fixed this bug
1 parent e98823b commit 9ad6515

File tree

1 file changed

+17
-17
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp

1 file changed

+17
-17
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/TestWebApp.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ void testDefaultRoutes() throws Exception {
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();
@@ -266,14 +266,14 @@ public void setup() {
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,7 +289,7 @@ void testEncodedUrl() throws Exception {
289289
public void setup() {
290290
route("/:foo", FooController.class);
291291
}
292-
};
292+
};
293293

294294
WebApp app = WebApps.$for("test-encoded-urls", TestWebApp.class, this, "ws")
295295
.withResourceConfig(configure()).start(webApp);
@@ -298,12 +298,12 @@ public void setup() {
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 {
@@ -360,7 +360,7 @@ public void setup() {
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

Comments
 (0)