Package org.mokai

Examples of org.mokai.ConnectorService.start()


  public void testConnectorServiceState() throws Exception {
    Connector connector = Mockito.mock(Connector.class);
    ConnectorService processorService = new MockConnectorService("test", connector, resourceRegistry);
    Assert.assertEquals(State.STOPPED, processorService.getState());

    processorService.start();
    Assert.assertEquals(State.STARTED, processorService.getState());

    processorService.stop();
    Assert.assertEquals(State.STOPPED, processorService.getState());
  }
View Full Code Here


    Mockito
      .doThrow(new NullPointerException())
      .when(processor).process(Mockito.any(Message.class));

    ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
    processorService.start();

    // check that the status is UNKNOWN
    Assert.assertEquals(Status.UNKNOWN, processorService.getStatus());

    // simulate the message
View Full Code Here

    Mockito
      .when(((Monitorable) processor).getStatus())
      .thenReturn(Status.OK);

    ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
    processorService.start();

    Assert.assertEquals(Status.OK, processorService.getStatus());

    // simulate the message
    simulateMessage(new Message(), "activemq:mokai-test");
View Full Code Here

    Mockito
      .when(((Monitorable) processor).getStatus())
      .thenReturn(Status.FAILED);

    ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
    processorService.start();

    Assert.assertEquals(Status.FAILED, processorService.getStatus());

    // simulate the message
    simulateMessage(new Message(), "activemq:mokai-test");
View Full Code Here

    Mockito
      .when(((Monitorable) processor).getStatus())
      .thenReturn(Status.OK);

    ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
    processorService.start();
    Assert.assertEquals(Status.OK, processorService.getStatus());

    // simulate the message
    simulateMessage(new Message(), "activemq:mokai-test");
View Full Code Here

        smsMessage.setProperty("to", "1111");
      }

    });

    processorService.start();

    simulateMessage(new Message(), "activemq:mokai-test");

    outboundEndpoint.assertIsSatisfied(DEFAULT_TIMEOUT);
    failedEndpoint.assertIsSatisfied(DEFAULT_TIMEOUT);
View Full Code Here

    // validation route
    MockEndpoint inboundEndpoint = getReceivedMessagesEndpoint(1);

    SimpleReceiverProcessor processor = new SimpleReceiverProcessor();
    ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
    processorService.start();

    // add post-receiving action
    MockAction postReceivingAction = new MockAction();
    processorService.addPostReceivingAction(postReceivingAction);
View Full Code Here

      public boolean supports(Message message) {
        return true;
      }

    }, resourceRegistry);
    processorService.start();

    simulateMessage(new Message(), "activemq:mokai-test");

    failedEndpoint.assertIsSatisfied(DEFAULT_TIMEOUT);
    outboundEndpoint.assertIsSatisfied(DEFAULT_TIMEOUT);
View Full Code Here

    if (connectorService == null) {
      response.notFound();
      return;
    }

    connectorService.start();
  }

  public void stop(Request request, Response response) throws JSONException {
    String id = request.getPathVariable("id").asString();
    ConnectorService connectorService = routingEngine.getConnection(id);
View Full Code Here

    if (connectorService == null) {
      response.notFound();
      return;
    }

    connectorService.start();
  }

  public void stop(Request request, Response response) throws JSONException {
    String id = request.getPathVariable("id").asString();
    ConnectorService connectorService = routingEngine.getApplication(id);
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.