use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class SequenceTimeoutTest 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
}
ConnectionHelper.setKeepAliveConnection(greeter, true);
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ClientServerGreeterBaseNoWsdlTest 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();
}
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ClientServerGreeterNoWsdlTest 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();
}
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class TrivialSOAPHandlerTest method testInvocation.
@Test
public void testInvocation() throws Exception {
GreeterService service = new GreeterService();
assertNotNull(service);
try {
Greeter greeter = service.getGreeterPort();
setAddress(greeter, address);
String greeting = greeter.greetMe("Bonjour");
assertNotNull("no response received from service", greeting);
assertEquals("BONJOUR", greeting);
} catch (UndeclaredThrowableException ex) {
throw (Exception) ex.getCause();
}
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class InterceptorFaultTest method setupGreeter.
private void setupGreeter(String cfgResource, boolean useDecoupledEndpoint) throws NumberFormatException, MalformedURLException {
SpringBusFactory bf = new SpringBusFactory();
controlBus = bf.createBus();
BusFactory.setDefaultBus(controlBus);
ControlService cs = new ControlService();
control = cs.getControlPort();
updateAddressPort(control, PORT);
assertTrue("Failed to start greeter", control.startGreeter(cfgResource));
greeterBus = bf.createBus(cfgResource);
BusFactory.setDefaultBus(greeterBus);
LOG.fine("Initialised greeter bus with configuration: " + cfgResource);
if (null == comparator) {
comparator = new PhaseComparator();
}
if (null == inPhases) {
inPhases = new ArrayList<>();
inPhases.addAll(greeterBus.getExtension(PhaseManager.class).getInPhases());
Collections.sort(inPhases, comparator);
}
if (null == postUnMarshalPhase) {
postUnMarshalPhase = getPhase(Phase.POST_UNMARSHAL);
}
GreeterService gs = new GreeterService();
greeter = gs.getGreeterPort();
updateAddressPort(greeter, PORT);
LOG.fine("Created greeter client.");
if (!useDecoupledEndpoint) {
return;
}
// programatically configure decoupled endpoint that is guaranteed to
// be unique across all test cases
decoupledEndpointPort++;
decoupledEndpoint = "http://localhost:" + allocatePort("decoupled-" + decoupledEndpointPort) + "/decoupled_endpoint";
Client c = ClientProxy.getClient(greeter);
HTTPConduit hc = (HTTPConduit) (c.getConduit());
HTTPClientPolicy cp = hc.getClient();
cp.setDecoupledEndpoint(decoupledEndpoint);
LOG.fine("Using decoupled endpoint: " + cp.getDecoupledEndpoint());
}
Aggregations