use of org.apache.hello_world_soap_http.types.GreetMeResponse in project cxf by apache.
the class AsyncHTTPConduitTest method testCallAsyncCallbackInvokedOnlyOnce.
@Test
public void testCallAsyncCallbackInvokedOnlyOnce() throws Exception {
// This test is especially targeted for RHEL 6.8
updateAddressPort(g, PORT_INV);
int repeat = 100;
final AtomicInteger count = new AtomicInteger(0);
for (int i = 0; i < repeat; i++) {
try {
g.greetMeAsync(request, new AsyncHandler<GreetMeResponse>() {
public void handleResponse(Response<GreetMeResponse> res) {
count.incrementAndGet();
}
}).get();
} catch (Exception e) {
}
}
Thread.sleep(1000);
assertEquals("Callback should be invoked only once per request", repeat, count.intValue());
}
Aggregations