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>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
@ -48,6 +43,21 @@
<type>test-jar</type>
<scope>test</scope>
</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>
<groupId>com.google.inject</groupId>

View File

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