Package com.asakusafw.compiler.flow.testing.model

Examples of com.asakusafw.compiler.flow.testing.model.Ex1


    public void ident_unify() throws Exception {
        TestInput<Ex1> in1 = tester.input(Ex1.class, "in1");
        TestInput<Ex1> in2 = tester.input(Ex1.class, "in2");
        TestOutput<Ex1> out1 = tester.output(Ex1.class, "out1");

        Ex1 model = new Ex1();
        model.setValue(1);
        in1.add(model);
        model.setValue(2);
        in2.add(model);

        final In<Ex1> pIn1 = in1.flow();
        final In<Ex1> pIn2 = in2.flow();
        final Out<Ex1> pOut1 = out1.flow();
View Full Code Here


        in.setSid(10L);
        in.setValue(100);
        f.add(in);

        assertThat(result.getResults().size(), is(1));
        Ex1 out = result.getResults().get(0);
        assertThat(out.getSid(), is(10L));
        assertThat(out.getValue(), is(100));
        assertThat(out.getStringOption().isNull(), is(true));
    }
View Full Code Here

        TestInput<Ex1> in = tester.input(Ex1.class, "in");
        TestOutput<Ex1> out1 = tester.output(Ex1.class, "out1");
        TestOutput<Ex1> out2 = tester.output(Ex1.class, "out2");

        Ex1 model = new Ex1();
        model.setStringAsString("a");
        model.setValue(1);
        in.add(model);
        model.setStringAsString("b");
        model.setValue(2);
        in.add(model);
        model.setValue(3);
        in.add(model);
        model.setStringAsString("c");
        model.setValue(4);
        in.add(model);
        model.setValue(5);
        in.add(model);
        model.setValue(6);
        in.add(model);

        boolean result = tester.runFlow(new CombineStage(in.flow(), out1.flow(), out2.flow()));
        assertThat(result, is(true));
View Full Code Here

        MockResult<Part1> result = mapper.create("out");

        @SuppressWarnings("unchecked")
        Result<Ex1> f = (Result<Ex1>) create(loader, name, mapper.toArguments());

        Ex1 in = new Ex1();
        in.setSid(10L);
        in.setValue(100);
        in.setStringAsString("Hello, world!");
        f.add(in);

        assertThat(result.getResults().size(), is(1));
        Part1 out = result.getResults().get(0);
        assertThat(out.getSid(), is(10L));
View Full Code Here

        MockResult<Ex2> result = mapper.create("out");

        @SuppressWarnings("unchecked")
        Result<Ex1> f = (Result<Ex1>) create(loader, name, mapper.toArguments());

        Ex1 in = new Ex1();
        in.setSid(10L);
        in.setValue(100);
        in.setStringAsString("Hello, world!");
        f.add(in);

        assertThat(result.getResults().size(), is(1));
        Ex2 out = result.getResults().get(0);
        assertThat(out.getSid(), is(10L));
View Full Code Here

    public void compress_flow_block() throws Exception {
        TestInput<Ex1> in1 = tester.input(Ex1.class, "in1");
        TestOutput<Ex1> out1 = tester.output(Ex1.class, "out1");
        TestOutput<Ex1> out2 = tester.output(Ex1.class, "out2");

        Ex1 model = new Ex1();
        model.setValue(0);
        model.setStringAsString("k");
        in1.add(model);

        final In<Ex1> pIn1 = in1.flow();
        final Out<Ex1> pOut1 = out1.flow();
        final Out<Ex1> pOut2 = out2.flow();
View Full Code Here

     */
    @Test
    public void branch_pushdown() throws Exception {
        TestInput<Ex1> in1 = tester.input(Ex1.class, "in1");
        TestOutput<Ex1> out1 = tester.output(Ex1.class, "out1");
        Ex1 model = new Ex1();
        model.setValue(0);
        in1.add(model);
        model.setValue(1);
        in1.add(model);
        model.setValue(2);
        in1.add(model);
        final In<Ex1> pIn1 = in1.flow();
        final Out<Ex1> pOut1 = out1.flow();
        boolean result = tester.runFlow(new FlowDescription() {
            @Override
View Full Code Here

        MockResult<Part1> result = mapper.create("out");

        @SuppressWarnings("unchecked")
        Result<Ex1> f = (Result<Ex1>) create(loader, name, mapper.toArguments());

        Ex1 in = new Ex1();
        in.setSid(10L);
        in.setValue(100);
        in.setStringAsString("Hello, world!");
        f.add(in);

        assertThat(result.getResults().size(), is(1));
        Part1 out = result.getResults().get(0);
        assertThat(out.getSid(), is(10L));
View Full Code Here

        MockResult<Ex2> result = mapper.create("out");

        @SuppressWarnings("unchecked")
        Result<Ex1> f = (Result<Ex1>) create(loader, name, mapper.toArguments());

        Ex1 in = new Ex1();
        in.setSid(10L);
        in.setValue(100);
        in.setStringAsString("Hello, world!");
        f.add(in);

        assertThat(result.getResults().size(), is(1));
        Ex2 out = result.getResults().get(0);
        assertThat(out.getSid(), is(10L));
View Full Code Here

        TestInput<Ex2> in2 = tester.input(Ex2.class, "ex2", dataSize);
        TestOutput<Ex1> high = tester.output(Ex1.class, "high");
        TestOutput<Ex1> low = tester.output(Ex1.class, "low");
        TestOutput<Ex1> stop = tester.output(Ex1.class, "stop");

        Ex1 ex1 = new Ex1();
        Ex2 ex2 = new Ex2();

        // high
        ex1.setStringAsString("high");
        ex1.setValue(11);
        ex2.setStringAsString("high");
        ex2.setValue(20);
        in1.add(ex1);
        in2.add(ex2);

        // low
        ex1.setStringAsString("low");
        ex1.setValue(50);
        ex2.setStringAsString("low");
        ex2.setValue(-20);
        in1.add(ex1);
        in2.add(ex2);

        // stop
        ex1.setStringAsString("0-stop");
        ex1.setValue(10);
        ex2.setStringAsString("0-stop");
        ex2.setValue(-10);
        in1.add(ex1);
        in2.add(ex2);

        // missing master
        ex1.setStringAsString("1-missing");
        ex1.setValue(1000);
        ex2.setStringAsString("2-missing");
        ex2.setValue(-1);
        in1.add(ex1);
        in2.add(ex2);
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.flow.testing.model.Ex1

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.