Package de.bamberg.ha.api.remote

Examples of de.bamberg.ha.api.remote.MessageEvent


    });
  }

  @Test
  public void test() {
    MessageEvent event=new MessageEvent("Hello World!");
    processEvent(event);
  }
View Full Code Here


  @Test
  public void testNullParser() {
    MessageParser oldParser=parser;
    try {
      parser=null;
      MessageEvent event=new MessageEvent("Hello World!");
      processEvent(event);
    } finally {
      parser=oldParser;
    }
  }
View Full Code Here

  @Ignore
  @Test
  public void testDispatcherReceive() throws Exception {
    LocalQueueDispatcher dispatcher=new LocalQueueDispatcher(null);
    dispatcher.received(new MessageEvent("Hello world!"));
    Thread.currentThread().sleep(5000);
    dispatcher.destroy();
  }
View Full Code Here

    Connector connector=createConnector();
    JUnitMessageListener l1=new JUnitMessageListener();
    JUnitMessageListener l2=new JUnitMessageListener();
    connector.addMessageListener(l1);
    connector.addMessageListener(l2);
    connector.messageReceived(new MessageEvent(HELLO_WORLD));
    assertEquals(HELLO_WORLD,l1.getMessage());
    assertEquals(HELLO_WORLD,l2.getMessage());
   
  }
View Full Code Here

  }
 
  @Test
  public void testNoListenerRegistered() throws Exception {
    Connector connector=createConnector();
    connector.messageReceived(new MessageEvent(HELLO_WORLD));
   
  }
View Full Code Here

  @Override
  public void run() {
    boolean running=true;
    while (!Thread.currentThread().isInterrupted() && running ) {
      try {
        MessageEvent event=queue.poll(50, TimeUnit.MILLISECONDS);
        if (event!=null) {
          log.trace(event.getMessage());
          processEvent(event);   
        }
        // check he next pendingResponse
        PendingResponse pendingResponse=pendlingRespones.poll();
        handleAsynchronResponseState(pendingResponse);
View Full Code Here

TOP

Related Classes of de.bamberg.ha.api.remote.MessageEvent

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.