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>
This commit is contained in:
Ashutosh Gupta 2022-10-29 18:25:53 +01:00 committed by GitHub
parent 070a2d4880
commit 2aae7ffe08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 23 deletions

View File

@ -31,11 +31,6 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.hadoop</groupId>
@ -48,6 +43,21 @@
<type>test-jar</type> <type>test-jar</type>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>com.google.inject</groupId> <groupId>com.google.inject</groupId>

View File

@ -19,8 +19,10 @@
package org.apache.hadoop.applications.mawo.server.common; package org.apache.hadoop.applications.mawo.server.common;
import org.junit.Assert; import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**
* Test MaWo configuration. * Test MaWo configuration.
@ -31,29 +33,29 @@ public class TestMaWoConfiguration {
* Validate default MaWo Configurations. * Validate default MaWo Configurations.
*/ */
@Test @Test
public void testMaWoConfiguration() { void testMaWoConfiguration() {
MawoConfiguration mawoConf = new MawoConfiguration(); MawoConfiguration mawoConf = new MawoConfiguration();
// validate Rpc server port // validate Rpc server port
Assert.assertEquals(mawoConf.getRpcServerPort(), 5120); assertEquals(5120, mawoConf.getRpcServerPort());
// validate Rpc hostname // validate Rpc hostname
Assert.assertTrue("localhost".equals(mawoConf.getRpcHostName())); assertEquals("localhost", mawoConf.getRpcHostName());
// validate job queue storage conf // validate job queue storage conf
boolean jobQueueStorage = mawoConf.getJobQueueStorageEnabled(); boolean jobQueueStorage = mawoConf.getJobQueueStorageEnabled();
Assert.assertTrue(jobQueueStorage); assertTrue(jobQueueStorage);
// validate default teardownWorkerValidity Interval // validate default teardownWorkerValidity Interval
Assert.assertEquals(mawoConf.getTeardownWorkerValidityInterval(), 120000); assertEquals(120000, mawoConf.getTeardownWorkerValidityInterval());
// validate Zk related configs // validate Zk related configs
Assert.assertTrue("/tmp/mawoRoot".equals(mawoConf.getZKParentPath())); assertEquals("/tmp/mawoRoot", mawoConf.getZKParentPath());
Assert.assertTrue("localhost:2181".equals(mawoConf.getZKAddress())); assertEquals("localhost:2181", mawoConf.getZKAddress());
Assert.assertEquals(1000, mawoConf.getZKRetryIntervalMS()); assertEquals(1000, mawoConf.getZKRetryIntervalMS());
Assert.assertEquals(10000, mawoConf.getZKSessionTimeoutMS()); assertEquals(10000, mawoConf.getZKSessionTimeoutMS());
Assert.assertEquals(1000, mawoConf.getZKRetriesNum()); assertEquals(1000, mawoConf.getZKRetriesNum());
} }