Skip to content
Permalink
Browse files

Use static imports for standard test utilities

Use static imports for standard test utilities in
/alluxio/core/common/src/test/java/alluxio/util/network/GetMasterWorkerAddressTest.java

Change
import org.junit.Assert;
to
import static org.junit.Assert.assertEquals;
Put the static imports before non-static imports.

AND

Update all
Assert.assertEquals*
to
assertEquals*

pr-link: #9060
change-id: cid-598517e707525e4813949607c383728b5adeaad6
  • Loading branch information...
ScorpionFray authored and alluxio-bot committed May 11, 2019
1 parent eb85a05 commit 475aab7f7831c4a8124f9d4abc7fd93709f84d07
Showing with 6 additions and 5 deletions.
  1. +6 −5 core/common/src/test/java/alluxio/util/network/GetMasterWorkerAddressTest.java
@@ -11,12 +11,13 @@

package alluxio.util.network;

import static org.junit.Assert.assertEquals;

import alluxio.ConfigurationTestUtils;
import alluxio.conf.InstancedConfiguration;
import alluxio.conf.PropertyKey;
import alluxio.util.network.NetworkAddressUtils.ServiceType;

import org.junit.Assert;
import org.junit.Test;

import java.net.InetSocketAddress;
@@ -44,23 +45,23 @@ public void getMasterAddress() {
int defaultPort = Integer.parseInt(PropertyKey.MASTER_RPC_PORT.getDefaultValue());
InetSocketAddress masterAddress =
NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC, conf);
Assert.assertEquals(new InetSocketAddress("RemoteMaster1", 10000), masterAddress);
assertEquals(new InetSocketAddress("RemoteMaster1", 10000), masterAddress);
conf = ConfigurationTestUtils.defaults();

// port only
conf.set(PropertyKey.MASTER_RPC_PORT, "20000");
masterAddress = NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC, conf);
Assert.assertEquals(new InetSocketAddress(defaultHostname, 20000), masterAddress);
assertEquals(new InetSocketAddress(defaultHostname, 20000), masterAddress);
conf = ConfigurationTestUtils.defaults();

// connect host only
conf.set(PropertyKey.MASTER_HOSTNAME, "RemoteMaster3");
masterAddress = NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC, conf);
Assert.assertEquals(new InetSocketAddress("RemoteMaster3", defaultPort), masterAddress);
assertEquals(new InetSocketAddress("RemoteMaster3", defaultPort), masterAddress);
conf = ConfigurationTestUtils.defaults();

// all default
masterAddress = NetworkAddressUtils.getConnectAddress(ServiceType.MASTER_RPC, conf);
Assert.assertEquals(new InetSocketAddress(defaultHostname, defaultPort), masterAddress);
assertEquals(new InetSocketAddress(defaultHostname, defaultPort), masterAddress);
}
}

0 comments on commit 475aab7

Please sign in to comment.
You can’t perform that action at this time.