Search in sources :

Example 1 with ClosedClientException

use of io.etcd.jetcd.common.exception.ClosedClientException in project dubbo by alibaba.

the class JEtcdClientTest method test_watch_after_client_closed.

@Test
public void test_watch_after_client_closed() throws InterruptedException {
    String path = "/dubbo/com.alibaba.dubbo.demo.DemoService/providers";
    client.close();
    try {
        client.addChildListener(path, (parent, children) -> {
            Assertions.assertEquals(path, parent);
        });
    } catch (ClosedClientException e) {
        Assertions.assertEquals("watch client has been closed, path '" + path + "'", e.getMessage());
    }
}
Also used : ByteString(com.google.protobuf.ByteString) ClosedClientException(io.etcd.jetcd.common.exception.ClosedClientException) Test(org.junit.jupiter.api.Test)

Aggregations

ByteString (com.google.protobuf.ByteString)1 ClosedClientException (io.etcd.jetcd.common.exception.ClosedClientException)1 Test (org.junit.jupiter.api.Test)1