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);
greeter.greetMeOneWay("one"); // sent
o = mbs.invoke(clientManagerName, "getEndpointIdentifiers", null, null);
verifyArray("Expected endpoint identifier", o, new String[]{epId});
o = mbs.invoke(serverManagerName, "getEndpointIdentifiers", null, null);
verifyArray("Expected endpoint identifier", o, new String[]{epId});
ObjectName clientEndpointName = RMUtils.getManagedObjectName(clientManager, ep);
ObjectName serverEndpointName = RMUtils.getManagedObjectName(serverManager, ep);
o = mbs.invoke(clientEndpointName, "getSourceSequenceIds",
new Object[]{true}, new String[]{"boolean"});
assertTrue("One sequence expected", o instanceof String[] && 1 == ((String[])o).length);
String sseqId = ((String[])o)[0];
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});
o = mbs.invoke(clientEndpointName, "getDestinationSequenceIds", null, null);
assertTrue("One sequence expected", o instanceof String[] && 1 == ((String[])o).length);
String dseqId = ((String[])o)[0];
o = mbs.invoke(serverEndpointName, "getSourceSequenceIds",
new Object[]{true}, new String[]{"boolean"});
verifyArray("Expected sequence identifier", o, new String[]{dseqId});
o = mbs.invoke(clientEndpointName, "getQueuedMessageTotalCount", null, null);
assertTrue("No queued message", o instanceof Integer && 0 == ((Integer)o).intValue());
o = mbs.invoke(clientEndpointName, "getQueuedMessageCount",
new Object[]{sseqId}, new String[]{"java.lang.String"});
assertTrue("No queued message", o instanceof Integer && 0 == ((Integer)o).intValue());
o = mbs.invoke(clientEndpointName, "getCurrentSourceSequence", null, null);
verifySourceSequence(o, sseqId, 1, 0);
o = mbs.invoke(clientEndpointName, "getSourceSequences",
new Object[]{true}, new String[]{"boolean"});
assertTrue("One sequence message", o instanceof CompositeData[] && 1 == ((CompositeData[])o).length);
verifySourceSequence(((CompositeData[])o)[0], sseqId, 1, 0);
o = mbs.invoke(clientEndpointName, "getSourceSequenceAcknowledgedRange",
new Object[]{sseqId}, new String[]{"java.lang.String"});
verifyArray("Expected range", o, new Long[]{1L, 1L});
o = mbs.invoke(clientEndpointName, "getUnAcknowledgedMessageIdentifiers",
new Object[]{sseqId}, new String[]{"java.lang.String"});
assertTrue("No unacknowledged message", o instanceof Long[] && 0 == ((Long[])o).length);
greeter.greetMeOneWay("two"); // getting lost
greeter.greetMeOneWay("three"); // sent
o = mbs.invoke(clientEndpointName, "getQueuedMessageTotalCount", null, null);
assertTrue("One queued message", o instanceof Integer && 1 == ((Integer)o).intValue());
o = mbs.invoke(clientEndpointName, "getSourceSequenceAcknowledgedRange",