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:
parent
070a2d4880
commit
2aae7ffe08
|
@ -31,23 +31,33 @@
|
||||||
</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>
|
||||||
<artifactId>hadoop-common</artifactId>
|
<artifactId>hadoop-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-common</artifactId>
|
<artifactId>hadoop-common</artifactId>
|
||||||
<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>
|
||||||
|
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue