diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-11 14:53:23 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-11 14:53:23 +0200 |
commit | a4414f27a1076dbf53224c22765c4dc64c5b7bd8 (patch) | |
tree | 609d14afce4d17eb57d2996696d94576af70192c /src/test | |
parent | 6f414b99c94f5e1562785f9f2b95940a50a70a88 (diff) |
Remove old RpcChannel.
Fix tests with NewRpcChannel.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java index e0757d4..1f1bc46 100644 --- a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java +++ b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java @@ -18,6 +18,8 @@ package com.orbekk.protobuf; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; +import java.io.IOException; +import java.net.UnknownHostException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; @@ -33,11 +35,13 @@ public class ProtobufFunctionalTest { CountDownLatch returnC = new CountDownLatch(1); SimpleProtobufServer server = SimpleProtobufServer.create(0, 50, 1); int serverport = server.getPort(); - RpcChannel channel = RpcChannel.create("localhost", serverport); + NewRpcChannel channel; TestService directService = new TestService(); - Test.Service service = Test.Service.newStub(channel); + Test.Service service; - @Before public void setUp() { + @Before public void setUp() throws Exception { + channel = NewRpcChannel.create("localhost", serverport); + service = Test.Service.newStub(channel); server.start(); server.registerService(directService); } @@ -150,7 +154,7 @@ public class ProtobufFunctionalTest { service.testC(rpc, request, new RpcCallback<Type2>() { @Override public void run(Type2 result) { assertThat(rpc.failed(), is(true)); - assertThat(rpc.errorText(), is("connection closed")); + assertThat(rpc.errorText(), is("channel closed")); stop.countDown(); } }); |