reports =
applicationHistoryManagerImpl.getApplications(2, 2000L, 5000L);
- Assert.assertNotNull(reports);
- Assert.assertEquals(2, reports.size());
- Assert.assertNull(reports.get("1"));
- Assert.assertNull(reports.get("2"));
- Assert.assertNull(reports.get("3"));
+ assertNotNull(reports);
+ assertEquals(2, reports.size());
+ assertNull(reports.get("1"));
+ assertNull(reports.get("2"));
+ assertNull(reports.get("3"));
}
}
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
index 96c81315704d8..a31d9a92419f4 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestApplicationHistoryManagerOnTimelineStore.java
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,6 +26,11 @@
import java.util.Map;
import java.util.Set;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.SaslRpcServer.AuthMethod;
import org.apache.hadoop.security.UserGroupInformation;
@@ -56,16 +61,13 @@
import org.apache.hadoop.yarn.server.timeline.TimelineDataManager;
import org.apache.hadoop.yarn.server.timeline.TimelineStore;
import org.apache.hadoop.yarn.server.timeline.security.TimelineACLsManager;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-@RunWith(Parameterized.class)
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
public class TestApplicationHistoryManagerOnTimelineStore {
private static final int SCALE = 5;
@@ -75,91 +77,78 @@ public class TestApplicationHistoryManagerOnTimelineStore {
private UserGroupInformation callerUGI;
private Configuration conf;
- @BeforeClass
+ @BeforeAll
public static void prepareStore() throws Exception {
store = createStore(SCALE);
TimelineEntities entities = new TimelineEntities();
- entities.addEntity(createApplicationTimelineEntity(
- ApplicationId.newInstance(0, SCALE + 1), true, true, false, false,
- YarnApplicationState.FINISHED));
- entities.addEntity(createApplicationTimelineEntity(
- ApplicationId.newInstance(0, SCALE + 2), true, false, true, false,
- YarnApplicationState.FINISHED));
+ entities.addEntity(
+ createApplicationTimelineEntity(ApplicationId.newInstance(0, SCALE + 1), true, true, false,
+ false, YarnApplicationState.FINISHED));
+ entities.addEntity(
+ createApplicationTimelineEntity(ApplicationId.newInstance(0, SCALE + 2), true, false, true,
+ false, YarnApplicationState.FINISHED));
store.put(entities);
}
public static TimelineStore createStore(int scale) throws Exception {
- TimelineStore store = new MemoryTimelineStore();
- prepareTimelineStore(store, scale);
+ store = new MemoryTimelineStore();
+ prepareTimelineStore(scale);
return store;
}
- @Before
- public void setup() throws Exception {
- // Only test the ACLs of the generic history
- TimelineACLsManager aclsManager = new TimelineACLsManager(new YarnConfiguration());
- aclsManager.setTimelineStore(store);
- TimelineDataManager dataManager =
- new TimelineDataManager(store, aclsManager);
- dataManager.init(conf);
- ApplicationACLsManager appAclsManager = new ApplicationACLsManager(conf);
- historyManager =
- new ApplicationHistoryManagerOnTimelineStore(dataManager, appAclsManager);
- historyManager.init(conf);
- historyManager.start();
- }
-
- @After
+ @AfterEach
public void tearDown() {
if (historyManager != null) {
historyManager.stop();
}
}
- @Parameters
public static Collection