Package uk.org.ogsadai.activity

Examples of uk.org.ogsadai.activity.MockOutputPipe


                new Integer(0),
                ControlBlock.LIST_END
        });
        activity.addInput("columns", inputColumns);

        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("data", output);
       
        activity.process();
       
        Iterator blocks = output.getActualBlocks().iterator();
        assertTrue(blocks.hasNext());
        assertEquals(ControlBlock.LIST_BEGIN, blocks.next());
        assertTrue(blocks.hasNext());
        Object block = blocks.next();
        assertTrue(block instanceof MetadataWrapper);
View Full Code Here


                ControlBlock.LIST_BEGIN,
                ControlBlock.LIST_END
        });
        activity.addInput("columns", inputColumns);

        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("data", output);
       
        activity.process();
       
        Iterator blocks = output.getActualBlocks().iterator();
        assertTrue(blocks.hasNext());
        assertEquals(ControlBlock.LIST_BEGIN, blocks.next());
        assertTrue(blocks.hasNext());
        Object block = blocks.next();
        assertTrue(block instanceof MetadataWrapper);
View Full Code Here

                ControlBlock.LIST_BEGIN,
                ControlBlock.LIST_END
        });
        activity.addInput("columns", inputColumns);

        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("data", output);
       
        try
        {
            activity.process();
View Full Code Here

                ControlBlock.LIST_BEGIN,
                ControlBlock.LIST_END
        });
        activity.addInput("columns", inputColumns);

        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("data", output);
       
        try
        {
            activity.process();
View Full Code Here

                ControlBlock.LIST_BEGIN,
                ControlBlock.LIST_END
        });
        activity.addInput("columns", inputColumns);

        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("data", output);
       
        try
        {
            activity.process();
View Full Code Here

                        tuple1, tuple2, tuple3,
                        ControlBlock.LIST_END
                });
        activity.addInput("data", input);
       
        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("result", output);
       
        activity.process();
       
        List actual = output.getActualBlocks();
        assertEquals(1, actual.size());
        PMMLDocument pmml = (PMMLDocument)actual.get(0);
       
        NumericInfo info = pmml.getPMML().getMiningModelArray(0).getModelStats().getUnivariateStatsArray(0).getNumericInfo();
        assertEquals(0, Double.compare(10, info.getMinimum()));
View Full Code Here

                        tuple1, tuple2, tuple3,
                        ControlBlock.LIST_END
                });
        activity.addInput("data", input);
       
        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("result", output);
       
        activity.process();
       
        List actual = output.getActualBlocks();
        assertEquals(1, actual.size());
        PMMLDocument pmml = (PMMLDocument)actual.get(0);
       
        PMMLToXMLCharArraysActivity toXML = new PMMLToXMLCharArraysActivity();
        input = new MockInputPipe(pmml);
        toXML.addInput("pmml", input);
       
        output = new MockOutputPipe(new Object[] {});
        toXML.addOutput("result", output);
       
        toXML.process();
       
        System.out.println(new String((char[])output.getActualBlocks().get(0)));
    }
View Full Code Here

                script
            });
        activity.addInput(GenericActivity.INPUT_SCRIPT, inputScript);
        MockInputPipe inputLanguage = new MockInputPipe("jruby");
        activity.addInput(GenericActivity.INPUT_LANGUAGE, inputLanguage);
        MockOutputPipe output = new MockOutputPipe(new Object[] {5l});
        activity.addOutput("output", output);
        activity.process();
        output.verify();
    }
View Full Code Here

        activity.addInput(GenericActivity.INPUT_SCRIPT, inputScript);
        MockInputPipe inputLanguage = new MockInputPipe("jruby");
        activity.addInput(GenericActivity.INPUT_LANGUAGE, inputLanguage);
        MockInputPipe inputName = new MockInputPipe("Amy");
        activity.addInput("input", inputName);
        MockOutputPipe output = new MockOutputPipe(new Object[] {"Amy"});
        activity.addOutput("output", output);
        activity.process();
        output.verify();
    }
View Full Code Here

        activity.addInput("min", inputMin);
        MockInputPipe inputMax = new MockInputPipe(max);
        activity.addInput("max", inputMax);
        MockInputPipe inputStep = new MockInputPipe(step);
        activity.addInput("step", inputStep);
        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addOutput("output", output);
        activity.process();
        List<?> actual = output.getActualBlocks();
        for (Object block : actual)
        {
            if (block instanceof Tuple)
            {
                Assert.assertEquals(value, ((Tuple)block).getDouble(0), 0.001);
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.activity.MockOutputPipe

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.