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

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


        TestInput<Ex1> in1 = tester.input(Ex1.class, "ex1", dataSize);
        TestInput<Ex2> in2 = tester.input(Ex2.class, "ex2");
        TestOutput<ExJoined> joined = tester.output(ExJoined.class, "joined");
        TestOutput<Ex2> missing = tester.output(Ex2.class, "missing");

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

        ex1.setValue(10);
        ex1.setStringAsString("a");
        ex1.setSid(10);
        in1.add(ex1);
        ex1.setStringAsString("b");
        ex1.setSid(11);
        in1.add(ex1);
        ex1.setStringAsString("c");
        ex1.setSid(12);
        in1.add(ex1);
        ex2.setValue(10);
        ex2.setStringAsString("a");
        ex2.setSid(1);
        in2.add(ex2);

        ex1.setValue(20);
        ex1.setStringAsString("a");
        ex1.setSid(20);
        in1.add(ex1);
        ex1.setStringAsString("b");
        ex1.setSid(21);
        in1.add(ex1);
        ex1.setStringAsString("c");
        ex1.setSid(22);
        in1.add(ex1);
        ex2.setValue(21);
        ex2.setSid(2);
        ex2.setStringAsString("a");
        in2.add(ex2);
        ex2.setValue(22);
        ex2.setStringAsString("b");
        ex2.setSid(3);
        in2.add(ex2);

        ex1.setValue(30);
        ex1.setStringAsString("a");
        ex1.setSid(30);
        in1.add(ex1);
        ex1.setStringAsString("b");
        ex1.setSid(31);
        in1.add(ex1);
        ex1.setStringAsString("c");
        ex1.setSid(32);
        in1.add(ex1);
        ex2.setValue(30);
        ex2.setStringAsString("a");
        ex2.setSid(4);
        in2.add(ex2);
View Full Code Here


        tester.options().setEnableCombiner(false);

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

        Ex1 ex1 = new Ex1();

        ex1.setStringAsString("a");
        ex1.setValue(1);
        in.add(ex1);

        ex1.setStringAsString("b");
        ex1.setValue(2);
        in.add(ex1);
        ex1.setValue(3);
        in.add(ex1);

        ex1.setStringAsString("c");
        ex1.setValue(4);
        in.add(ex1);
        ex1.setValue(5);
        in.add(ex1);
        ex1.setValue(6);
        in.add(ex1);
        ex1.setValue(7);
        in.add(ex1);

        assertThat(tester.runFlow(new FoldFlowSimple(in.flow(), out.flow())), is(true));
        List<Ex1> results = out.toList(new Comparator<Ex1>() {
            @Override
View Full Code Here

    @Test
    public void withParameter() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "ex1");
        TestOutput<Ex1> out = tester.output(Ex1.class, "ex1");

        Ex1 ex1 = new Ex1();

        ex1.setStringAsString("a");
        ex1.setValue(1);
        in.add(ex1);

        ex1.setStringAsString("b");
        ex1.setValue(2);
        in.add(ex1);
        ex1.setValue(3);
        in.add(ex1);

        ex1.setStringAsString("c");
        ex1.setValue(4);
        in.add(ex1);
        ex1.setValue(5);
        in.add(ex1);
        ex1.setValue(6);
        in.add(ex1);
        ex1.setValue(7);
        in.add(ex1);

        assertThat(tester.runFlow(new FoldFlowWithParameter(in.flow(), out.flow())), is(true));
        List<Ex1> results = out.toList(new Comparator<Ex1>() {
            @Override
View Full Code Here

        tester.options().setEnableCombiner(true);

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

        Ex1 ex1 = new Ex1();

        ex1.setStringAsString("a");
        ex1.setValue(1);
        in.add(ex1);

        ex1.setStringAsString("b");
        ex1.setValue(2);
        in.add(ex1);
        ex1.setValue(3);
        in.add(ex1);

        ex1.setStringAsString("c");
        ex1.setValue(4);
        in.add(ex1);
        ex1.setValue(5);
        in.add(ex1);
        ex1.setValue(6);
        in.add(ex1);
        ex1.setValue(7);
        in.add(ex1);

        assertThat(tester.runFlow(new FoldFlowSimple(in.flow(), out.flow())), is(true));
        List<Ex1> results = out.toList(new Comparator<Ex1>() {
            @Override
View Full Code Here

     * @throws Exception テストに失敗した場合
     */
    @Test
    public void keep_sticky() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "in");
        in.add(new Ex1());

        boolean result = tester.runFlow(new StickyStage(in.flow()));
        assertThat(result, is(false));
    }
View Full Code Here

     */
    @Test
    public void unify_volatile() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "in");
        TestOutput<Ex1> out = tester.output(Ex1.class, "out");
        in.add(new Ex1());

        boolean result = tester.runFlow(new VolatileStage(in.flow(), out.flow()));
        assertThat(result, is(true));

        List<Ex1> outputs = out.toList();
View Full Code Here

     */
    @Test
    public void duplicate() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "in");
        TestOutput<Ex1> out = tester.output(Ex1.class, "out");
        in.add(new Ex1());

        boolean result = tester.runFlow(new DuplicateStage(in.flow(), out.flow()));
        assertThat(result, is(true));

        List<Ex1> outputs = out.toList();
View Full Code Here

     */
    @Test
    public void confluent() throws Exception {
        TestInput<Ex1> in = tester.input(Ex1.class, "in");
        TestOutput<Ex1> out = tester.output(Ex1.class, "out");
        Ex1 ex1 = new Ex1();
        ex1.setStringAsString("Hello");
        ex1.setValue(100);
        in.add(ex1);

        boolean result = tester.runFlow(new TwinCogroupStage(in.flow(), out.flow()));
        assertThat(result, 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");
        TestOutput<Ex1> out3 = tester.output(Ex1.class, "out3");

        Ex1 model = new Ex1();
        model.setValue(0);
        in.add(model);
        model.setValue(1);
        in.add(model);

        boolean result = tester.runFlow(new BranchStage(
                in.flow(),
                out1.flow(), out2.flow(), out3.flow()));
View Full Code Here

    public void split_unify() throws Exception {
        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.setValue(0);
        in.add(model);

        boolean result = tester.runFlow(new SplitStage(in.flow(), out1.flow(), out2.flow()));
        assertThat(result, is(true));
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.