Search in sources :

Example 6 with LogDispatcher

use of com.yahoo.logserver.LogDispatcher in project vespa by vespa-engine.

the class LogDispatcherTestCase method testVerifyMessages.

@Test
public void testVerifyMessages() {
    MockHandler handler = new MockHandler();
    LogDispatcher dispatcher = new LogDispatcher();
    dispatcher.registerLogHandler(handler);
    dispatcher.handle(sample1);
    dispatcher.handle(sample2);
    assertTrue(sample1 == handler.messages.get(0));
    assertTrue(sample2 == handler.messages.get(1));
}
Also used : LogDispatcher(com.yahoo.logserver.LogDispatcher)

Aggregations

LogDispatcher (com.yahoo.logserver.LogDispatcher)6 LogMessage (com.yahoo.log.LogMessage)1 AbstractLogHandler (com.yahoo.logserver.handlers.AbstractLogHandler)1 LogHandler (com.yahoo.logserver.handlers.LogHandler)1 LogConnection (com.yahoo.logserver.net.LogConnection)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 ServerSocketChannel (java.nio.channels.ServerSocketChannel)1 SocketChannel (java.nio.channels.SocketChannel)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 BrokenBarrierException (java.util.concurrent.BrokenBarrierException)1 CyclicBarrier (java.util.concurrent.CyclicBarrier)1 Test (org.junit.Test)1