Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
import org.apache.hadoop.yarn.server.federation.utils.FederationStateStoreFacade;
import org.apache.hadoop.yarn.util.StringHelper;
import org.apache.hadoop.yarn.webapp.util.WebAppUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

public class TestFedAppReportFetcher {

Expand All @@ -66,7 +66,7 @@ public class TestFedAppReportFetcher {
private static FedAppReportFetcher fetcher;
private final String appNotFoundExceptionMsg = "APP NOT FOUND";

@After
@AfterEach
public void cleanUp() {
history = null;
fetcher = null;
Expand Down Expand Up @@ -132,16 +132,16 @@ public void testFetchReportAHSDisabled() throws Exception {
.getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
Mockito.verify(appManager2, Mockito.times(1))
.getApplicationReport(Mockito.any(GetApplicationReportRequest.class));
Assert.assertNull("HistoryManager should be null as AHS is disabled", history);
Assertions.assertNull(history, "HistoryManager should be null as AHS is disabled");
}

@Test
public void testGetRmAppPageUrlBase() throws IOException, YarnException {
testHelper(true);
String scheme = WebAppUtils.getHttpSchemePrefix(conf);
Assert.assertEquals(fetcher.getRmAppPageUrlBase(appId1),
Assertions.assertEquals(fetcher.getRmAppPageUrlBase(appId1),
StringHelper.pjoin(scheme + clusterInfo1.getRMWebServiceAddress(), "cluster", "app"));
Assert.assertEquals(fetcher.getRmAppPageUrlBase(appId2),
Assertions.assertEquals(fetcher.getRmAppPageUrlBase(appId2),
StringHelper.pjoin(scheme + clusterInfo2.getRMWebServiceAddress(), "cluster", "app"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.hadoop.yarn.server.webproxy;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -57,9 +57,10 @@
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.mockito.Mockito;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -84,7 +85,7 @@ public class TestWebAppProxyServletFed {
/**
* Simple http server. Server should send answer with status 200
*/
@BeforeClass
@BeforeAll
public static void setUp() throws Exception {
mockServer = new Server(0);
((QueuedThreadPool) mockServer.getThreadPool()).setMaxThreads(20);
Expand All @@ -102,7 +103,7 @@ public static void setUp() throws Exception {
LOG.info("Running embedded servlet container at: http://localhost:" + mockServerPort);
}

@AfterClass
@AfterAll
public static void tearDown() throws Exception {
if (mockServer != null) {
mockServer.stop();
Expand Down Expand Up @@ -139,7 +140,8 @@ public void testWebServlet() throws IOException {
conn.disconnect();
}

@Test(timeout=5000)
@Test
@Timeout(value = 5)
public void testWebAppProxyServletFed() throws Exception {

Configuration conf = new Configuration();
Expand Down