From 5338b7f0df7bccba15d2d6b1a768f741d1dcb4d0 Mon Sep 17 00:00:00 2001 From: Gianpaolo Coro Date: Sun, 10 Jan 2016 18:51:47 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineSmartExecutor@122178 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../executor/tests/TestKnitrCompiler.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/org/gcube/dataanalysis/executor/tests/TestKnitrCompiler.java diff --git a/src/main/java/org/gcube/dataanalysis/executor/tests/TestKnitrCompiler.java b/src/main/java/org/gcube/dataanalysis/executor/tests/TestKnitrCompiler.java new file mode 100644 index 0000000..0a34198 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/executor/tests/TestKnitrCompiler.java @@ -0,0 +1,44 @@ +package org.gcube.dataanalysis.executor.tests; + +import java.util.List; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveType; +import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType; +import org.gcube.dataanalysis.ecoengine.interfaces.ComputationalAgent; +import org.gcube.dataanalysis.ecoengine.processing.factories.TransducerersFactory; +import org.gcube.dataanalysis.ecoengine.test.regression.Regressor; + +public class TestKnitrCompiler { + + public static void main(String[] args) throws Exception { + + // setup the configuration + AlgorithmConfiguration config = new AlgorithmConfiguration(); + // set the path to the cfg folder and to the PARALLEL_PROCESSING folder + config.setConfigPath("./cfg/"); + config.setPersistencePath("./PARALLEL_PROCESSING"); + AnalysisLogger.setLogger(config.getConfigPath()+AlgorithmConfiguration.defaultLoggerFile); + //set the scope and the user (optional for this test) + config.setGcubeScope( "/gcube/devsec/devVRE"); + config.setParam("ServiceUserName", "test.user"); + config.setParam("zipfile", "C:/Users/coro/Desktop/WorkFolder/Workspace/EcologicalEngineSmartExecutor/cfg/knitr_test_julien_wfs.zip"); + config.setParam("file.inout", "test_julien_zip"); + + //set the name of the algorithm to call, as is is in the transducerer.properties file + config.setAgent("KNITR_COMPILER"); + + //recall the transducerer with the above name + List transducers = TransducerersFactory.getTransducerers(config); + ComputationalAgent transducer =transducers.get(0); + //init the transducerer + transducer.init(); + //start the process + Regressor.process(transducer); + //retrieve the output + StatisticalType st = transducer.getOutput(); + System.out.println("st:"+((PrimitiveType)st).getContent()); + } + +}