This commit is contained in:
Gianpaolo Coro 2017-02-28 13:04:35 +00:00
parent fbf3eb8081
commit e65b50b735
1 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
package org.gcube.dataanalysis.wps.statisticalmanager.synchserver.test;
import java.io.File;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.datatypes.enumtypes.TableTemplates;
import org.gcube.dataanalysis.ecoengine.test.regression.Regressor;
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.infrastructure.DatabaseInfo;
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.infrastructure.InfrastructureDialoguer;
import org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping.InputsManager;
public class DumpTestTables {
public static void main(String[] args) throws Exception{
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 inputTableTemplate = TableTemplates.GENERIC.name();
String scope = "/gcube/devsec/devVRE";
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);
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");
}
}