@Test
  public void testGetDispatcher() throws Exception {
    ServiceReference ref =
        new ServiceReferenceImpl(new QName("testGetDispatcher"), new InOnlyService(), null, null);
    Dispatcher dispatch = _provider.createDispatcher(ref);

    assertEquals(dispatch, _provider.getDispatcher(ref));
  }
  @Test
  public void testCreateDispatcher() throws Exception {
    // verify that dispatchers can be created for an InOnly service
    ServiceReference inOnly =
        new ServiceReferenceImpl(new QName("inOnly"), new InOnlyService(), _domain, null);
    assertNotNull(_provider.createDispatcher(inOnly));

    // verify that dispatchers can be created for an InOut service
    ServiceReference inOut =
        new ServiceReferenceImpl(new QName("inOut"), new InOutService(), _domain, null);
    assertNotNull(_provider.createDispatcher(inOut));
  }
 private ServiceReference registerInOutService(String name, ExchangeHandler handler) {
   ServiceReferenceImpl reference =
       new ServiceReferenceImpl(new QName(name), new InOutService(), _domain, null);
   _domain.registerService(new QName(name), new InOutService(), handler);
   reference.setDispatcher(_provider.createDispatcher(reference));
   return reference;
 }
 @Before
 public void setUp() throws Exception {
   _domain = new MockDomain();
   _camelContext = new SwitchYardCamelContext();
   _camelContext.setServiceDomain(_domain);
   _provider = new CamelExchangeBus(_camelContext);
   _provider.init(_domain);
   _camelContext.start();
 }