This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit d59762f56ddc9538e380a790683df21279466376 Author: laijianbin <[email protected]> AuthorDate: Fri Jun 29 09:57:21 2018 +0800 refactor test demo --- .../servicecomb/foundation/common/net/TestNetUtils.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/net/TestNetUtils.java b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/net/TestNetUtils.java index f80ce51..8766b84 100644 --- a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/net/TestNetUtils.java +++ b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/net/TestNetUtils.java @@ -110,15 +110,16 @@ public class TestNetUtils { } @Test - public void testGetHostName() throws Exception { + public void testGetHostName() { Assert.assertNotEquals(null, NetUtils.getHostName()); - Assert.assertNotEquals(null, NetUtils.getHostAddress()); - Deencapsulation.setField(NetUtils.class, "hostName", null); Assert.assertNotEquals(null, NetUtils.getHostName()); - + } + + @Test + public void testGetHostAddress() { + Assert.assertNotEquals(null, NetUtils.getHostAddress()); Deencapsulation.setField(NetUtils.class, "hostAddress", null); Assert.assertNotEquals(null, NetUtils.getHostAddress()); - } }
