Package org.mokai.types.mock

Examples of org.mokai.types.mock.MockConnector


      ConnectorService connection = routingEngine.addConnection("1", processor);
      connection.addAcceptor(new MockAcceptor());
      connection.start();

      // create the application
      MockConnector receiver = new MockConnector();
      ConnectorService application = routingEngine.addApplication("1", receiver);
      application.start();

      // send the message
      receiver.produceMessage(new Message());

      // wait
      barrier.await(20, TimeUnit.SECONDS);

      Assert.assertEquals(1, processor.getCount());
View Full Code Here


      ConnectorService application = routingEngine.addApplication("1", processor);
      application.addAcceptor(new MockAcceptor());
      application.start();

      // create the connection
      MockConnector receiver = new MockConnector();
      ConnectorService connection = routingEngine.addConnection("1", receiver);
      connection.start();

      // send the message
      receiver.produceMessage(new Message());

      // wait
      barrier.await(20, TimeUnit.SECONDS);

      Assert.assertEquals(1, processor.getCount());
View Full Code Here

  @Test
  public void testInjectResourceToProcessor() throws Exception {
    // add the resource to the resource registry
    resourceRegistry.putResource(MessageStore.class, Mockito.mock(MessageStore.class));

    MockConnector processor = new MockConnector();
    new MockConnectorService("test", processor, resourceRegistry);

    Assert.assertNotNull(processor.getMessageStore());

    ConnectorContext context = processor.getContext();
    Assert.assertNotNull(context);
    Assert.assertEquals("test", context.getId());
  }
View Full Code Here

  @Test
  public void testSaveOneConnectorNoAdditionals() throws Exception {
    String path = "src/test/resources/temp-connectors/connectors.xml";

    ConnectorService processorService = mockConnectorService("test", 1000,
        new MockConnector(), new ArrayList<Acceptor>(), new ArrayList<Action>(),
        new ArrayList<Action>(), new ArrayList<Action>());

    ConfigDelegator delegator = mock(ConfigDelegator.class);
    when(delegator.getConnectors())
      .thenReturn(Collections.singletonList(processorService));
View Full Code Here

    List<Action> actions = new ArrayList<Action>();
    actions.add(new MockAction());
    actions.add(new MockAction());

    ConnectorService connectorService = mockConnectorService("test", 1000,
        new MockConnector(), acceptors, actions, actions, actions);

    ConfigDelegator delegator = mock(ConfigDelegator.class);
    when(delegator.getConnectors())
      .thenReturn(Collections.singletonList(connectorService));
View Full Code Here

  @Test
  public void testSaveMultipleConnectors() throws Exception {
    String path = "src/test/resources/temp-connectors/connectors.xml";

    List<ConnectorService> connectors = new ArrayList<ConnectorService>();
    connectors.add(mockConnectorService("test-1", 1000, new MockConnector(), new ArrayList<Acceptor>(),
        new ArrayList<Action>(), new ArrayList<Action>(), new ArrayList<Action>()));
    connectors.add(mockConnectorService("test-2", 2000, new MockConnector(), new ArrayList<Acceptor>(),
        new ArrayList<Action>(), new ArrayList<Action>(), new ArrayList<Action>()));

    ConfigDelegator delegator = mock(ConfigDelegator.class);
    when(delegator.getConnectors()).thenReturn(connectors);
View Full Code Here

TOP

Related Classes of org.mokai.types.mock.MockConnector

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.