use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class DecoupledClientServerOnewayTest method testDecoupledOneway.
@Test
public void testDecoupledOneway() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
bus = bf.createBus("/org/apache/cxf/systest/ws/rm/exactlyonce-inorder-decoupled.xml");
BusFactory.setDefaultBus(bus);
LoggingInInterceptor in = new LoggingInInterceptor();
in.setPrettyLogging(true);
bus.getInInterceptors().add(in);
bus.getInFaultInterceptors().add(in);
LoggingOutInterceptor out = new LoggingOutInterceptor();
out.setPrettyLogging(true);
bus.getOutInterceptors().add(out);
bus.getOutFaultInterceptors().add(out);
GreeterService gs = new GreeterService();
final Greeter greeter = gs.getGreeterPort();
updateAddressPort(greeter, PORT);
((BindingProvider) greeter).getRequestContext().put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.TRUE);
LOG.fine("Created greeter client.");
ConnectionHelper.setKeepAliveConnection(greeter, true);
greeter.greetMeOneWay("oneway");
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class DeliveryAssuranceOnewayTest method initProxy.
private void initProxy(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, false);
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ManagedEndpointsTest method testManagedEndpointsOneway12.
@Test
public void testManagedEndpointsOneway12() throws Exception {
prepareClient();
RMManager clientManager = clientBus.getExtension(RMManager.class);
RMManager serverManager = serverBus.getExtension(RMManager.class);
InstrumentationManager serverIM = serverBus.getExtension(InstrumentationManager.class);
MBeanServer mbs = serverIM.getMBeanServer();
assertNotNull("MBeanServer must be available.", mbs);
ObjectName clientManagerName = RMUtils.getManagedObjectName(clientManager);
ObjectName serverManagerName = RMUtils.getManagedObjectName(serverManager);
Object o;
GreeterService gs = new GreeterService();
final Greeter greeter = gs.getGreeterPort();
updateAddressPort(greeter, ManagedEndpointsTest.PORT);
LOG.fine("Created greeter client.");
ClientProxy.getClient(greeter).getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY, RM11Constants.NAMESPACE_URI);
org.apache.cxf.endpoint.Endpoint ep = ClientProxy.getClient(greeter).getEndpoint();
String epId = RMUtils.getEndpointIdentifier(ep, clientBus);
// sent
greeter.greetMeOneWay("one");
o = mbs.invoke(clientManagerName, "getEndpointIdentifiers", null, null);
verifyArray("Expected endpoint identifier", o, new String[] { epId }, true);
o = mbs.invoke(serverManagerName, "getEndpointIdentifiers", null, null);
verifyArray("Expected endpoint identifier", o, new String[] { epId }, true);
ObjectName clientEndpointName = RMUtils.getManagedObjectName(clientManager, ep);
// we need to find out serverEndpointName by using the query name
ObjectName serverEndpointName = getEndpointName(mbs, serverManager);
String sseqId = getSingleSourceSequenceId(mbs, clientEndpointName);
o = mbs.invoke(clientEndpointName, "getCurrentSourceSequenceId", null, null);
assertTrue("Expected sequence identifier", o instanceof String && sseqId.equals(o));
o = mbs.invoke(serverEndpointName, "getDestinationSequenceIds", null, null);
verifyArray("Expected sequence identifier", o, new String[] { sseqId }, false);
String dseqId = getSingleDestinationSequenceId(mbs, clientEndpointName);
testOperation(mbs, greeter, clientEndpointName, serverEndpointName, sseqId, dseqId);
mbs.invoke(clientEndpointName, "closeSourceSequence", new Object[] { sseqId }, ONESTRING_SIGNATURE);
o = mbs.invoke(clientEndpointName, "getSourceSequenceIds", new Object[] { true }, ONEBOOLEAN_SIGNATURE);
verifyArray("Expected sequence identifier", o, new String[] { sseqId }, true);
mbs.invoke(clientEndpointName, "terminateSourceSequence", new Object[] { sseqId }, ONESTRING_SIGNATURE);
o = mbs.invoke(clientEndpointName, "getSourceSequenceIds", new Object[] { true }, ONEBOOLEAN_SIGNATURE);
assertTrue("Source sequence terminated", o instanceof String[] && 0 == ((String[]) o).length);
mbs.invoke(clientEndpointName, "terminateDestinationSequence", new Object[] { dseqId }, ONESTRING_SIGNATURE);
o = mbs.invoke(clientEndpointName, "getDestinationSequenceIds", new Object[] {}, EMPTY_SIGNATURE);
assertTrue("Destination sequence terminated", o instanceof String[] && 0 == ((String[]) o).length);
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ManagedEndpointsTest method testManagedEndpointsOneway.
@Test
public void testManagedEndpointsOneway() throws Exception {
prepareClient();
RMManager clientManager = clientBus.getExtension(RMManager.class);
RMManager serverManager = serverBus.getExtension(RMManager.class);
InstrumentationManager serverIM = serverBus.getExtension(InstrumentationManager.class);
MBeanServer mbs = serverIM.getMBeanServer();
assertNotNull("MBeanServer must be available.", mbs);
ObjectName clientManagerName = RMUtils.getManagedObjectName(clientManager);
ObjectName serverManagerName = RMUtils.getManagedObjectName(serverManager);
Object o;
GreeterService gs = new GreeterService();
final Greeter greeter = gs.getGreeterPort();
updateAddressPort(greeter, ManagedEndpointsTest.PORT);
LOG.fine("Created greeter client.");
org.apache.cxf.endpoint.Endpoint ep = ClientProxy.getClient(greeter).getEndpoint();
String epId = RMUtils.getEndpointIdentifier(ep, clientBus);
// sent
greeter.greetMeOneWay("one");
o = mbs.invoke(clientManagerName, "getEndpointIdentifiers", null, null);
verifyArray("Expected endpoint identifier", o, new String[] { epId }, true);
o = mbs.invoke(serverManagerName, "getEndpointIdentifiers", null, null);
verifyArray("Expected endpoint identifier", o, new String[] { epId }, true);
ObjectName clientEndpointName = RMUtils.getManagedObjectName(clientManager, ep);
// we need to find out serverEndpointName by using the query name
ObjectName serverEndpointName = getEndpointName(mbs, serverManager);
String sseqId = getSingleSourceSequenceId(mbs, clientEndpointName);
o = mbs.invoke(clientEndpointName, "getCurrentSourceSequenceId", null, null);
assertTrue("Expected sequence identifier", o instanceof String && sseqId.equals(o));
o = mbs.invoke(serverEndpointName, "getDestinationSequenceIds", null, null);
verifyArray("Expected sequence identifier", o, new String[] { sseqId }, false);
String dseqId = getSingleDestinationSequenceId(mbs, clientEndpointName);
testOperation(mbs, greeter, clientEndpointName, serverEndpointName, sseqId, dseqId);
mbs.invoke(clientEndpointName, "terminateSourceSequence", new Object[] { sseqId }, ONESTRING_SIGNATURE);
o = mbs.invoke(clientEndpointName, "getSourceSequenceIds", new Object[] { true }, ONEBOOLEAN_SIGNATURE);
assertTrue("Source sequence terminated", o instanceof String[] && 0 == ((String[]) o).length);
mbs.invoke(clientEndpointName, "terminateDestinationSequence", new Object[] { dseqId }, ONESTRING_SIGNATURE);
o = mbs.invoke(clientEndpointName, "getDestinationSequenceIds", new Object[] {}, EMPTY_SIGNATURE);
assertTrue("Destination sequence terminated", o instanceof String[] && 0 == ((String[]) o).length);
}
use of org.apache.cxf.greeter_control.GreeterService in project cxf by apache.
the class ProtocolVariationsTest 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));
}
}
Aggregations