本文整理匯總了Java中io.vertx.ext.consul.ConsulClient.agentInfo方法的典型用法代碼示例。如果您正苦於以下問題:Java ConsulClient.agentInfo方法的具體用法?Java ConsulClient.agentInfo怎麽用?Java ConsulClient.agentInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.vertx.ext.consul.ConsulClient
的用法示例。
在下文中一共展示了ConsulClient.agentInfo方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: timeout
import io.vertx.ext.consul.ConsulClient; //導入方法依賴的package包/類
@Test
public void timeout(TestContext tc) {
SlowHttpServer slowConsul = new SlowHttpServer(vertx, 10000);
ConsulClient client = ctx.createClient(new ConsulClientOptions().setPort(slowConsul.port()).setTimeout(1000));
client.agentInfo(tc.asyncAssertFailure(t -> {
ctx.closeClient(client);
slowConsul.close();
tc.assertTrue(t.getMessage().contains("The timeout period of 1000ms"));
}));
}
示例2: closedConnection
import io.vertx.ext.consul.ConsulClient; //導入方法依賴的package包/類
@Test
public void closedConnection(TestContext tc) {
BrokenHttpServer brokenConsul = new BrokenHttpServer(vertx);
ConsulClient client = ctx.createClient(new ConsulClientOptions().setPort(brokenConsul.port()));
client.agentInfo(tc.asyncAssertFailure(t -> {
ctx.closeClient(client);
brokenConsul.close();
tc.assertTrue(t.getMessage().contains("Connection was closed"));
}));
}
示例3: tryClient
import io.vertx.ext.consul.ConsulClient; //導入方法依賴的package包/類
private void tryClient(TestContext tc, ConsulClient client, String expectedExceptionMessageSubstring) {
client.agentInfo(tc.asyncAssertFailure(t -> {
tc.assertTrue(t.getMessage().contains(expectedExceptionMessageSubstring));
ctx.closeClient(client);
}));
}