Service service = serviceDomain.getServiceRegistry().getServices(
new QName("urn:switchyard-interface-esb", "HelloService")).get(0);
Assert.assertNotNull(service);
ServiceInterface iface = service.getInterface();
Assert.assertEquals(EsbInterfaceModel.ESB, iface.getType());
ServiceOperation op = iface.getOperation(ServiceInterface.DEFAULT_OPERATION);
Assert.assertNotNull(op);
Assert.assertEquals(ExchangePattern.IN_ONLY, op.getExchangePattern());
// Test the reference
ServiceReference reference = serviceDomain.getServiceReference(
new QName("urn:switchyard-interface-esb", "HelloService/SomeOtherService"));
Assert.assertNotNull(reference);
Assert.assertEquals(EsbInterfaceModel.ESB, service.getInterface().getType());
ServiceOperation rop = reference.getInterface().getOperation(ServiceInterface.DEFAULT_OPERATION);
Assert.assertNotNull(rop);
Assert.assertEquals(ExchangePattern.IN_OUT, rop.getExchangePattern());
deployment.stop();
deployment.destroy();
}