Package org.mokai.impl.camel

Examples of org.mokai.impl.camel.CamelRoutingEngine.shutdown()


    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      routingEngine.removeConnection("test");
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test(expectedExceptions=ObjectAlreadyExistsException.class)
  public void shouldFailToAddExistingConnection() throws Exception {
View Full Code Here


      routingEngine.addConnection("test", connector);

      // try to create another connector service with the same id
      routingEngine.addConnection("test", connector);
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test
  public void testCreateRemoveApplication() throws Exception {
View Full Code Here

      Assert.assertTrue(applications.contains(cs1));
      Assert.assertTrue(applications.contains(cs2));
      Assert.assertFalse(applications.contains(cs3));
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test
  public void testCreateConfigurableApplication() throws Exception {
View Full Code Here

      Connector connector = mock(Connector.class, withSettings().extraInterfaces(Configurable.class));
      routingEngine.addApplication("test1", connector);

      verify((Configurable) connector).configure();
    } finally {
      routingEngine.shutdown();
    }
  }

  public void testRetrieveApplication() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();
View Full Code Here

      // try to retrieve an unexisting application
      csTest = routingEngine.getApplication("notexistent");
      Assert.assertNull(csTest);
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test
  public void testRetrieveApplications() throws Exception {
View Full Code Here

      Assert.assertEquals(3, connectorServices.size());
      Assert.assertEquals(cs2, connectorServices.get(0));
      Assert.assertEquals(cs3, connectorServices.get(1));
      Assert.assertEquals(cs1, connectorServices.get(2));
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test
  public void shouldFailToModifyReturnedApplications() throws Exception {
View Full Code Here

      connectorServices.add(cs1);
      Assert.assertEquals(connectorServices.size(), 2);

      Assert.assertEquals(routingEngine.getApplications().size(), 1);
    } finally {
      routingEngine.shutdown();
    }

  }

  @Test(expectedExceptions=ObjectNotFoundException.class)
View Full Code Here

    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      routingEngine.removeApplication("test");
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test(expectedExceptions=ObjectAlreadyExistsException.class)
  public void shouldFailToAddExistingApplication() throws Exception {
View Full Code Here

      routingEngine.addApplication("test", connector);

      // try to create another application with the same id
      routingEngine.addApplication("test", connector);
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test
  public void testStartRoutingEngineWithSlowConnectors() throws Exception {
View Full Code Here

      routingEngine.start();
      long endTime = new Date().getTime();

      Assert.assertTrue((endTime - startTime) < 5000);
    } finally {
      routingEngine.shutdown();
    }
  }

  @Test
  public void testToConnectionsMessageFlow() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.