use of com.yahoo.jdisc.service.ClientProvider in project vespa by vespa-engine.
the class ApplicationStatusHandlerTest method client_providers_are_rendered.
@Test
public void client_providers_are_rendered() throws Exception {
final String id = "myClient";
final String clientBinding = "http://*/clientBinding";
final String clientBinding2 = "http://*/anotherClientBinding";
final String serverBinding = "http://*/serverBinding";
HashMap<ComponentId, ClientProvider> clientsById = new HashMap<>();
clientsById.put(new ComponentId(id), Mockito.mock(ClientProvider.class));
JdiscBindingsConfig bindingsConfig = new JdiscBindingsConfig(new JdiscBindingsConfig.Builder().handlers(id, new Handlers.Builder().clientBindings(clientBinding).clientBindings(clientBinding2).serverBindings(serverBinding)));
String json = ApplicationStatusHandler.renderRequestHandlers(bindingsConfig, clientsById).toString();
System.out.println(json);
assertThat(json, containsString("\"" + id + "\""));
assertThat(json, containsString(clientBinding));
assertThat(json, containsString(clientBinding2));
assertThat(json, containsString(serverBinding));
}
use of com.yahoo.jdisc.service.ClientProvider in project vespa by vespa-engine.
the class ConfiguredApplication method startClients.
private static void startClients() {
for (ClientProvider client : Container.get().getClientProviderRegistry().allComponents()) {
if (!startedClients.contains(client)) {
client.start();
startedClients.add(client);
}
}
}
use of com.yahoo.jdisc.service.ClientProvider in project vespa by vespa-engine.
the class NonWorkingClientTestCase method requireThatHandleRequestThrowsException.
@Test
public void requireThatHandleRequestThrowsException() {
ClientProvider client = new NonWorkingClientProvider();
try {
client.handleRequest(null, null);
fail();
} catch (UnsupportedOperationException e) {
}
}
use of com.yahoo.jdisc.service.ClientProvider in project vespa by vespa-engine.
the class NonWorkingClientTestCase method requireThatRetainDoesNotThrow.
@Test
public void requireThatRetainDoesNotThrow() {
ClientProvider client = new NonWorkingClientProvider();
client.release();
}
use of com.yahoo.jdisc.service.ClientProvider in project vespa by vespa-engine.
the class NonWorkingClientTestCase method requireThatReleaseDoesNotThrow.
@Test
public void requireThatReleaseDoesNotThrow() {
ClientProvider client = new NonWorkingClientProvider();
client.release();
}
Aggregations