Package javaflow.network.definer

Examples of javaflow.network.definer.NetworkDefiner$InitPacketDefinitionImpl


    }

    @TesttimeOut=1000,
            description = "Tests that isOpen works, also @MustRun annotation is tested because there is no kicker component used.")
    public void isOpenTestAndMustRunWorks() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("test output closes", TestOutputPortClosingComponent.class);
                component("close input, signal when ready", ReceiveOneSignalAndCloseInputComponent.class);
                component("out", ToCollection.class);
View Full Code Here


    }
   
    @Test
    public void testComponentIsNotStartedIfNoInputInPorts() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("closer", SendOneMessageWaitAndCloseOutput.class);
                component("receiver", ReceiveNonNullPackets.class);
                component("out", ToCollection.class);
View Full Code Here

    }

    @Test(timeOut=1000)
    public void nonlooperComponentsAllowNetworkToShutdown() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("ex", ExtractAndSubstituteSubchain.class);
                component("copy", Copy.class);

View Full Code Here

        }
    }

    @Test
    public void subnetTest() {
        final SubnetDefinition everyOther = new NetworkDefiner(){
            {
                inputPort("IN");
                outputPort("OUT");

                component("roundRobin", RoundRobinScheduler.class);
                component("drop", Drop.class);

                from("IN").to("roundRobin");
                from("roundRobin","OUT[0]").to("OUT");
                from("roundRobin","OUT[1]").to("drop");

            }
        };

        runNetworkDefinition(new NetworkDefiner() {
            {
                component("generator", IntegerGenerator.class);
                component("every other", everyOther);
                component("out", ToCollection.class);
View Full Code Here

        Assert.assertEquals(out.get(4).toString(),"8");
    }

    @Test
    public void subnetRelaunchTest() {
        final SubnetDefinition uniq = new NetworkDefiner(){
            {
                inputPort("IN", SUBSTREAM_SENSITIVE);
                outputPort("OUT");

                component("unique component", Unique.class);

                from("IN").to("unique component").to("OUT");
            }
        };

        runNetworkDefinition(new NetworkDefiner() {
            {
                component("uniq subnet", uniq);
                component("out", ToCollection.class);

                from("uniq subnet").to("out");
View Full Code Here

    }

    @Test
    public void substreamSensitiveOutput() {
        final SubnetDefinition subnet = new NetworkDefiner(){
            {
                inputPort("IN", SUBSTREAM_SENSITIVE);
                outputPort("OUT", SUBSTREAM_SENSITIVE);

                component("pass", PassThrough.class);

                from("IN").to("pass").to("OUT");
            }
        };

        runNetworkDefinition(new NetworkDefiner() {
            {
                component("subnet", subnet);
                component("out", LogPacketsToCollection.class);

                from("subnet").to("out");
View Full Code Here

    }

    @Test(description = "There have been problem that actual network does not get started by packet from subnet")
    public void subnetStartsNetwork() {
        final SubnetDefinition subnet = new NetworkDefiner(){
            {
                outputPort("OUT");
                from(c("generator", IntegerGenerator.class)).to("OUT");
            }
        };

        runNetworkDefinition(new NetworkDefiner() {
            {
                component("generator", subnet);
                component("out", ToCollection.class);

                from("generator").to(c("passthrough",PassThrough.class)).to("out");
View Full Code Here

    @Test(timeOut = 3000,
            expectedExceptions = Error.class,
            description = "Shutdown network when there is uncatch exception in component")
    public void shutdownOnException() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("fail", FailComponent.class);
                component("generator", ForeverGenerator.class);
                component("drop", Drop.class);
View Full Code Here

import javaflow.network.impl.SimpleNetworkBuilder;

public class SpeedTest {
    public static void main(String[] args) {
        final int messageCount = 10000000;
        Network network = new SimpleNetworkBuilder().build(new NetworkDefiner() {{
            from(c("generator", Generator.class)).to(c("expectPackets", ExpectPackets.class));

            from("generator", "STARTNOTIFY").to("START", c("timer", Timer.class));
            from("expectPackets", "ENDNOTIFY").to("END", "timer");
View Full Code Here

TOP

Related Classes of javaflow.network.definer.NetworkDefiner$InitPacketDefinitionImpl

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.