Initial adjustments
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/SeaDataNetConnector@119224 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ac011b6a2f
commit
9f385a528e
|
@ -88,7 +88,7 @@ public class SeaDataNetConnector extends StandardLocalExternalAlgorithm {
|
|||
outputfile,
|
||||
PrimitiveTypes.FILE,
|
||||
"OutputFile",
|
||||
"nome del file");
|
||||
"file name");
|
||||
|
||||
return file;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package org.gcube.dataanalysis.seadatanet.test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.contentmanagement.lexicalmatcher.utils.FileTools;
|
||||
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 TestSeaDataNetConnector {
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("TEST 1");
|
||||
List<ComputationalAgent> trans = null;
|
||||
|
||||
trans = TransducerersFactory.getTransducerers(testConfigLocal());
|
||||
ComputationalAgent prova = trans.get(0);
|
||||
prova.init();
|
||||
prova.compute();
|
||||
StatisticalType output = prova.getOutput();
|
||||
System.out.println(output.getDescription());
|
||||
System.out.println(output.getClass());
|
||||
if (output instanceof PrimitiveType){
|
||||
PrimitiveType ptype = (PrimitiveType) output;
|
||||
File file = (File)ptype.getContent();
|
||||
|
||||
System.out.println(file.getAbsolutePath());
|
||||
System.out.println(FileTools.loadString(file.getAbsolutePath(), "UTF-8"));
|
||||
}
|
||||
trans = null;
|
||||
}
|
||||
|
||||
private static AlgorithmConfiguration testConfigLocal() {
|
||||
|
||||
AlgorithmConfiguration config = Regressor.getConfig();
|
||||
config.setAgent("SEADATANET_CONNECTOR");
|
||||
|
||||
config.setParam("InputTable", "hcaf_d");
|
||||
config.setParam("Longitude", "centerlong");
|
||||
config.setParam("Latitude", "centerlat");
|
||||
config.setParam("Quantity", "landdist");
|
||||
config.setParam("axisX", "dimx");
|
||||
config.setParam("axisY", "dimy");
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue