Package javaflow.network.definer

Examples of javaflow.network.definer.NetworkDefiner$ConnectionDefinitionImpl


        Assert.assertEquals(out.get(0), "0123456789");
    }

    @Test(description = "Test that packet can be assembled to single tree structure and drop still works")
    public void assemblingPacketsWorks() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("assembler", Assembler.class);
                component("out", LogPacketsToCollection.class);

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


        Assert.assertTrue(strings.contains("2"));
    }

    @Test(timeOut = 1000)
    public void assemblingSubTreeWorks() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("assembler", Assembler.class);
                component("out", LogPacketsToCollection.class);

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

        Assert.assertTrue(strings.contains("b"));
    }

    @Test(timeOut = 1000)
    public void disassemblingWorks() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("assembler", Assembler.class);
                component("disassembler", Disassembler.class);
                component("out", ToCollection.class);
View Full Code Here

    @Test//timeOut = 1000,
            expectedExceptions = Error.class,
            description = "Tests that network detects deadlocks when no component is processing packages")
    public void deadlock() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("generator 1", IntegerGenerator.class);
                component("generator 2", IntegerGenerator.class);
                component("ss 1", MarkSubstream.class);
                component("ss 2", MarkSubstream.class);
View Full Code Here

    @Test(timeOut = 1000,
            description = "Tests that lost packets that are received are detected")
    public void lostPacketsAreDetected1() {
        try {
            runNetworkDefinition(new NetworkDefiner() {
                {
                    component("generator", IntegerGenerator.class);
                    component("eater", JustEatPacketComponent.class);

                    from("generator").to("eater");
View Full Code Here

    @Test(timeOut = 1000,
            description = "Tests that lost packets that are created inside component are detected")
    public void lostPacketsAreDetected2() {
        try {
            runNetworkDefinition(new NetworkDefiner() {
                {
                    component("generator", CreatePacketsButDontSendThem.class);
                }
            });
            Assert.fail("Should have reported missing packets");
View Full Code Here

    @Test(timeOut = 1000,
            description = "Tests non correct handling of initialization packets are detected")
    public void lostPacketsAreDetected3() {
        try {
            runNetworkDefinition(new NetworkDefiner() {
                {
                    component("eater", JustEatPacketComponent.class);

                    initialize("eater.IN", "eat this");
                }
View Full Code Here

    }

    @Test(timeOut = 1000,
            description = "Tests closing input port when there is input ")
    public void lostPacketsAreDetected4() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("dropper", TestDropAndSendComponent.class);
                component("out", ToCollection.class);

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

    }

    @Test(timeOut = 1000,
            description = "Tests chaining packets does not confuse the counters")
    public void lostPacketsAreDetectedWithChains() {
        Network network = (NetworkImpl) builder.build(new NetworkDefiner() {
            {
                component("generator", IntegerGenerator.class);
                component("substream", MarkSubstream.class);
                component("assembler", Assembler.class);
                component("disassembler", Disassembler.class);
View Full Code Here

    }

    @Test(//timeOut = 1000,
            description = "Sending to a closed output port is error")
    public void sendingToClosedOuputPort() {
        runNetworkDefinition(new NetworkDefiner() {
            {
                component("non-connected-out", TestSendingThrowsException.class);
                component("out", ToCollection.class);

                from("non-connected-out","RESULT").to("out");
View Full Code Here

TOP

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

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.