Skip to content

Commit

Permalink
Close all servers/ports after tests finish (apache#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrDTesters authored and CrazyHZM committed Dec 6, 2018
1 parent 75c2f47 commit 39af141
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down Expand Up @@ -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"));
}
}
}
}

0 comments on commit 39af141

Please sign in to comment.