Examples of TCPTransportModule


Examples of org.apache.s4.fixtures.TCPTransportModule

    @Test
    public void testSingleMessage() throws Exception {

        Injector injector1 = Guice.createInjector(Modules.override(
                new TestCommModule(Resources.getResource("default.s4.comm.properties").openStream())).with(
                new TCPTransportModule(), new NoOpReceiverModule()));

        // this node picks partition 0
        Emitter emitter = injector1.getInstance(Emitter.class);

        Injector injector2 = Guice.createInjector(Modules.override(
                new TestCommModule(Resources.getResource("default.s4.comm.properties").openStream())).with(
                new TCPTransportModule(), new MockReceiverModule()));

        // creating the listener will inject assignment (i.e. assign a partition) and receiver (delegatee for
        // listener, here a mock which simply intercepts the message and notifies through a countdown latch)
        injector2.getInstance(Listener.class);
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.