Package org.mokai

Examples of org.mokai.Connector


    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      routingEngine.start();

      Connector connector = mock(Connector.class, withSettings().extraInterfaces(Configurable.class));

      // add a connection
      routingEngine.addConnection("test1", connector);

      verify((Configurable) connector).configure();
View Full Code Here


    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      routingEngine.start();

      Connector connector = mock(Connector.class);

      // create and start a connector service
      ConnectorService connectorService = routingEngine.addConnection("test", connector)
        .withPriority(2000);
      connectorService.start();
View Full Code Here

  @Test
  public void testRetrieveConnections() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      Connector connector = mock(Connector.class);

      ConnectorService cs1 = routingEngine.addConnection("test1", connector).withPriority(2000);
      ConnectorService cs2 = routingEngine.addConnection("test2", connector).withPriority(1000);
      ConnectorService cs3 = routingEngine.addConnection("test3", connector).withPriority(1500);
View Full Code Here

  @Test
  public void shouldFailToModifyReturnedConnections() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      Connector connector = mock(Connector.class);
      ConnectorService cs1 = routingEngine.addConnection("test1", connector);

      List<ConnectorService> connectorServices = routingEngine.getConnections();
      Assert.assertEquals(connectorServices.size(), 1);
View Full Code Here

  @Test(expectedExceptions=ObjectAlreadyExistsException.class)
  public void shouldFailToAddExistingConnection() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      Connector connector = mock(Connector.class);

      // create a connector service
      routingEngine.addConnection("test", connector);

      // try to create another connector service with the same id
View Full Code Here

    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      routingEngine.start();

      Connector connector = mock(Connector.class);

      ConnectorService cs1 = routingEngine.addApplication("test1", connector);
      cs1.start();

      // check that the application was created successfully
View Full Code Here

  public void testCreateConfigurableApplication() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

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

      verify((Configurable) connector).configure();
    } finally {
      routingEngine.shutdown();
View Full Code Here

    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      routingEngine.start();

      Connector connector = mock(Connector.class);

      // create and start an application
      ConnectorService connectorService = routingEngine.addApplication("test", connector);
      connectorService.start();
View Full Code Here

  @Test
  public void testRetrieveApplications() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      Connector connector = mock(Connector.class);

      ConnectorService cs1 = routingEngine.addApplication("test1", connector).withPriority(2000);
      ConnectorService cs2 = routingEngine.addApplication("test2", connector).withPriority(1000);
      ConnectorService cs3 = routingEngine.addApplication("test3", connector).withPriority(1500);
View Full Code Here

  @Test
  public void shouldFailToModifyReturnedApplications() throws Exception {
    CamelRoutingEngine routingEngine = new CamelRoutingEngine();

    try {
      Connector connector = mock(Connector.class);
      ConnectorService cs1 = routingEngine.addApplication("test", connector);

      Collection<ConnectorService> connectorServices = routingEngine.getApplications();
      Assert.assertEquals(connectorServices.size(), 1);
View Full Code Here

TOP

Related Classes of org.mokai.Connector

Copyright © 2018 www.massapicom. 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.