use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class RobustServiceAtMostOnceTest method testRobustAtMostOnceWithSlowProcessing.
@Test
public void testRobustAtMostOnceWithSlowProcessing() throws Exception {
LOG.fine("Creating greeter client");
SpringBusFactory bf = new SpringBusFactory();
bus = bf.createBus("/org/apache/cxf/systest/ws/rm/seqlength1.xml");
// set the client retry interval much shorter than the slow processing delay
RMManager manager = bus.getExtension(RMManager.class);
manager.getConfiguration().setBaseRetransmissionInterval(new Long(3000));
BusFactory.setDefaultBus(bus);
GreeterService gs = new GreeterService();
greeter = gs.getGreeterPort();
updateAddressPort(greeter, PORT);
LOG.fine("Invoking greeter");
greeter.greetMeOneWay("one");
Thread.sleep(10000);
assertEquals("invoked too many times", 1, serverGreeter.getCount());
assertTrue("still in retransmission", manager.getRetransmissionQueue().isEmpty());
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class SequenceTest method initProxy.
private void initProxy(boolean useDecoupledEndpoint, Executor executor) {
GreeterService gs = new GreeterService();
if (null != executor) {
gs.setExecutor(executor);
}
greeter = gs.getGreeterPort();
try {
updateAddressPort(greeter, PORT);
} catch (Exception e) {
// ignore
}
LOG.fine("Created greeter client.");
ConnectionHelper.setKeepAliveConnection(greeter, true);
if (useDecoupledEndpoint) {
initDecoupledEndpoint(ClientProxy.getClient(greeter));
}
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class SequenceTest method initDispatch.
private void initDispatch(boolean useDecoupledEndpoint) {
GreeterService gs = new GreeterService();
dispatch = gs.createDispatch(GreeterService.GreeterPort, DOMSource.class, Service.Mode.MESSAGE);
try {
updateAddressPort(dispatch, PORT);
} catch (Exception e) {
// ignore
}
dispatch.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.FALSE);
if (useDecoupledEndpoint) {
initDecoupledEndpoint(((DispatchImpl<?>) dispatch).getClient());
}
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ServiceInvocationAckBase method setupGreeter.
protected void setupGreeter(String cfgResource) throws NumberFormatException, MalformedURLException {
SpringBusFactory bf = new SpringBusFactory();
controlBus = bf.createBus();
BusFactory.setDefaultBus(controlBus);
ControlService cs = new ControlService();
control = cs.getControlPort();
updateAddressPort(control, getPort());
assertTrue("Failed to start greeter", control.startGreeter(cfgResource));
System.setProperty("db.name", getPrefix());
greeterBus = bf.createBus(cfgResource);
BusFactory.setDefaultBus(greeterBus);
System.clearProperty("db.name");
LOG.fine("Initialised greeter bus with configuration: " + cfgResource);
GreeterService gs = new GreeterService();
greeter = gs.getGreeterPort();
updateAddressPort(greeter, getPort());
LOG.fine("Created greeter client.");
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ClientServerGreeterBaseTest method testInvocation.
@Test
public void testInvocation() throws Exception {
GreeterService service = new GreeterService();
assertNotNull(service);
try {
Greeter greeter = service.getGreeterPort();
updateAddressPort(greeter, PORT);
String greeting = greeter.greetMe("Bonjour");
assertNotNull("no response received from service", greeting);
assertEquals("Hello Bonjour", greeting);
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
Aggregations