From 0c7ff37bea34c372780db048d33d3ff8b2e3f85b Mon Sep 17 00:00:00 2001 From: OrDTesters Date: Mon, 29 Oct 2018 14:24:14 -0500 Subject: [PATCH] Close all servers/ports after tests finish --- .../dubbo/rpc/protocol/dubbo/DubboProtocolTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocolTest.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocolTest.java index 7366ed1dd25..b67112c40df 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocolTest.java @@ -26,11 +26,13 @@ import org.apache.dubbo.rpc.protocol.dubbo.support.DemoService; import org.apache.dubbo.rpc.protocol.dubbo.support.DemoServiceImpl; import org.apache.dubbo.rpc.protocol.dubbo.support.NonSerialized; +import org.apache.dubbo.rpc.protocol.dubbo.support.ProtocolUtils; import org.apache.dubbo.rpc.protocol.dubbo.support.RemoteService; import org.apache.dubbo.rpc.protocol.dubbo.support.RemoteServiceImpl; import org.apache.dubbo.rpc.protocol.dubbo.support.Type; import org.apache.dubbo.rpc.service.EchoService; +import org.junit.AfterClass; import org.junit.Assert; import org.junit.Test; @@ -48,6 +50,11 @@ public class DubboProtocolTest { private Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); private ProxyFactory proxy = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); + @AfterClass + public static void after() { + ProtocolUtils.closeAll(); + } + @Test public void testDemoProtocol() throws Exception { DemoService service = new DemoServiceImpl(); @@ -181,4 +188,4 @@ public void testReturnNonSerialized() throws Exception { Assert.assertTrue(e.getMessage().contains("org.apache.dubbo.rpc.protocol.dubbo.support.NonSerialized must implement java.io.Serializable")); } } -} \ No newline at end of file +}