@Test
public void testUsingRM() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
bus = bf.createBus("org/apache/cxf/systest/ws/policy/rm.xml");
BusFactory.setDefaultBus(bus);
OutMessageRecorder outRecorder = new OutMessageRecorder();
bus.getOutInterceptors().add(outRecorder);
InMessageRecorder inRecorder = new InMessageRecorder();
bus.getInInterceptors().add(inRecorder);
BasicGreeterService gs = new BasicGreeterService();
final Greeter greeter = gs.getGreeterPort();
updateAddressPort(greeter, PORT);
LOG.fine("Created greeter client.");
ConnectionHelper.setKeepAliveConnection(greeter, true);
// oneway
greeter.greetMeOneWay("CXF");
// two-way
assertEquals("CXF", greeter.greetMe("cxf"));
// exception
try {
greeter.pingMe();
} catch (PingMeFault ex) {
fail("First invocation should have succeeded.");
}
try {
greeter.pingMe();
fail("Expected PingMeFault not thrown.");
} catch (PingMeFault ex) {
assertEquals(2, ex.getFaultInfo().getMajor());
assertEquals(1, ex.getFaultInfo().getMinor());
}
MessageRecorder mr = new MessageRecorder(outRecorder, inRecorder);
mr.awaitMessages(5, 4, 5000);
MessageFlow mf = new MessageFlow(outRecorder.getOutboundMessages(), inRecorder.getInboundMessages(),
Names200408.WSA_NAMESPACE_NAME, RM10Constants.NAMESPACE_URI);
mf.verifyMessages(5, true);
String[] expectedActions = new String[] {RM10Constants.INSTANCE.getCreateSequenceAction(),