Skip to content

Commit 2aae7ff

Browse files
hotcodemachaAshutosh Gupta
andauthored
YARN-11337. Upgrade Junit 4 to 5 in hadoop-yarn-applications-mawo (#4993)
Co-authored-by: Ashutosh Gupta <ashugpt@amazon.com> Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
1 parent 070a2d4 commit 2aae7ff

2 files changed

Lines changed: 34 additions & 22 deletions

File tree

  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-mawo/hadoop-yarn-applications-mawo-core

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-mawo/hadoop-yarn-applications-mawo-core/pom.xml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,33 @@
3131
</properties>
3232

3333
<dependencies>
34+
3435
<dependency>
35-
<groupId>junit</groupId>
36-
<artifactId>junit</artifactId>
37-
<scope>test</scope>
36+
<groupId>org.apache.hadoop</groupId>
37+
<artifactId>hadoop-common</artifactId>
3838
</dependency>
3939

4040
<dependency>
4141
<groupId>org.apache.hadoop</groupId>
4242
<artifactId>hadoop-common</artifactId>
43+
<type>test-jar</type>
44+
<scope>test</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.junit.jupiter</groupId>
48+
<artifactId>junit-jupiter-api</artifactId>
49+
<scope>test</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.junit.jupiter</groupId>
53+
<artifactId>junit-jupiter-engine</artifactId>
54+
<scope>test</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.junit.platform</groupId>
58+
<artifactId>junit-platform-launcher</artifactId>
59+
<scope>test</scope>
4360
</dependency>
44-
45-
<dependency>
46-
<groupId>org.apache.hadoop</groupId>
47-
<artifactId>hadoop-common</artifactId>
48-
<type>test-jar</type>
49-
<scope>test</scope>
50-
</dependency>
5161

5262
<dependency>
5363
<groupId>com.google.inject</groupId>

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-mawo/hadoop-yarn-applications-mawo-core/src/test/java/org/apache/hadoop/applications/mawo/server/common/TestMaWoConfiguration.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
package org.apache.hadoop.applications.mawo.server.common;
2020

2121

22-
import org.junit.Assert;
23-
import org.junit.Test;
22+
import org.junit.jupiter.api.Test;
23+
24+
import static org.junit.jupiter.api.Assertions.assertEquals;
25+
import static org.junit.jupiter.api.Assertions.assertTrue;
2426

2527
/**
2628
* Test MaWo configuration.
@@ -31,29 +33,29 @@ public class TestMaWoConfiguration {
3133
* Validate default MaWo Configurations.
3234
*/
3335
@Test
34-
public void testMaWoConfiguration() {
36+
void testMaWoConfiguration() {
3537

3638
MawoConfiguration mawoConf = new MawoConfiguration();
3739

3840
// validate Rpc server port
39-
Assert.assertEquals(mawoConf.getRpcServerPort(), 5120);
41+
assertEquals(5120, mawoConf.getRpcServerPort());
4042

4143
// validate Rpc hostname
42-
Assert.assertTrue("localhost".equals(mawoConf.getRpcHostName()));
44+
assertEquals("localhost", mawoConf.getRpcHostName());
4345

4446
// validate job queue storage conf
4547
boolean jobQueueStorage = mawoConf.getJobQueueStorageEnabled();
46-
Assert.assertTrue(jobQueueStorage);
48+
assertTrue(jobQueueStorage);
4749

4850
// validate default teardownWorkerValidity Interval
49-
Assert.assertEquals(mawoConf.getTeardownWorkerValidityInterval(), 120000);
51+
assertEquals(120000, mawoConf.getTeardownWorkerValidityInterval());
5052

5153
// validate Zk related configs
52-
Assert.assertTrue("/tmp/mawoRoot".equals(mawoConf.getZKParentPath()));
53-
Assert.assertTrue("localhost:2181".equals(mawoConf.getZKAddress()));
54-
Assert.assertEquals(1000, mawoConf.getZKRetryIntervalMS());
55-
Assert.assertEquals(10000, mawoConf.getZKSessionTimeoutMS());
56-
Assert.assertEquals(1000, mawoConf.getZKRetriesNum());
54+
assertEquals("/tmp/mawoRoot", mawoConf.getZKParentPath());
55+
assertEquals("localhost:2181", mawoConf.getZKAddress());
56+
assertEquals(1000, mawoConf.getZKRetryIntervalMS());
57+
assertEquals(10000, mawoConf.getZKSessionTimeoutMS());
58+
assertEquals(1000, mawoConf.getZKRetriesNum());
5759
}
5860

5961

0 commit comments

Comments
 (0)