This commit is contained in:
Gianpaolo Coro 2017-02-28 13:04:30 +00:00
parent e5c284f750
commit fbf3eb8081
1 changed files with 13 additions and 9 deletions

View File

@ -2,6 +2,7 @@ package org.gcube.dataanalysis.wps.statisticalmanager.synchserver.test;
import java.io.File;
import org.gcube.contentmanagement.graphtools.utils.MathFunctions;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates;
import org.gcube.dataanalysis.ecoengine.test.regression.Regressor;
@ -14,20 +15,23 @@ public class CreateTestTableFromFile {
Regressor regressor = new Regressor();
AlgorithmConfiguration config = regressor.getConfig();
String tableName = "spread_test";
File tableFile = new File("C:\\Users\\coro\\Desktop\\DATABASE e NOTE\\spread_input_dataset .csv");
String tableName = "hcaf_2050";
File tableFile = new File("C:\\Users\\coro\\Desktop\\DATABASE e NOTE\\hcaf_2050.csv");
String inputTableTemplate = TableTemplates.GENERIC.name();
String scope = "/gcube/devsec/devVRE";
//String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab";
String scope = "/d4science.research-infrastructures.eu/gCubeApps";
System.out.println("Asking the infra for database in scope: "+scope);
InfrastructureDialoguer dialoguer = new InfrastructureDialoguer(scope);
DatabaseInfo supportDatabaseInfo = dialoguer.getDatabaseInfo("StatisticalManagerDataBase");
InputsManager manager = new InputsManager(null, config, "test");
manager.configSupportDatabaseParameters(supportDatabaseInfo);
System.out.println("Database retrieved: "+supportDatabaseInfo.url);
DatabaseInfo supportDatabaseInfo = dialoguer.getDatabaseInfo("AquaMapsDB");
System.out.println("Creating: "+tableName);
// InputsManager manager = new InputsManager(null, config, "test");
// manager.configSupportDatabaseParameters(supportDatabaseInfo);
// System.out.println("Database retrieved: "+supportDatabaseInfo.url);
manager.createTable(tableName, tableFile,manager.getConfig(), supportDatabaseInfo, inputTableTemplate);
// System.out.println("Creating: "+tableName);
//manager.createTable(tableName, tableFile,manager.getConfig(), supportDatabaseInfo, inputTableTemplate);
System.out.println("DB coordinates: \nURL "+supportDatabaseInfo.url+"\n user "+supportDatabaseInfo.username+"\n password "+supportDatabaseInfo.password+"\n driver "+supportDatabaseInfo.driver+"\n dialect "+supportDatabaseInfo.dialect);
System.out.println("All done");