Updated Test

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/data-miner-manager-cl@133845 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-11-03 10:59:56 +00:00
parent ea2f561001
commit 241a92a74a
24 changed files with 135 additions and 261 deletions

View File

@ -26,6 +26,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>

View File

@ -5,6 +5,11 @@
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name> <name>org.eclipse.jdt.core.javabuilder</name>
<arguments> <arguments>
@ -15,9 +20,17 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -1,5 +1,8 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="data-miner-manager-cl">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.7"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>

View File

@ -3,10 +3,7 @@ package org.gcube.data.analysis.dataminermanagercl.server;
import static org.gcube.common.authorization.client.Constants.authorizationService; import static org.gcube.common.authorization.client.Constants.authorizationService;
import org.gcube.common.authorization.library.AuthorizationEntry; import org.gcube.common.authorization.library.AuthorizationEntry;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.gcube.common.authorization.library.provider.ClientInfo;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.authorization.library.provider.UserInfo;
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClient; import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClient;
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClient4WPSBuilder; import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClient4WPSBuilder;
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClientBuilder; import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClientBuilder;
@ -25,8 +22,9 @@ import org.slf4j.LoggerFactory;
*/ */
public class DataMinerService { public class DataMinerService {
private static Logger logger = LoggerFactory // private HashMap<String, SClient> cachedSClients;
.getLogger(DataMinerService.class);
private Logger logger = LoggerFactory.getLogger(DataMinerService.class);
/** /**
* *
@ -36,22 +34,35 @@ public class DataMinerService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public static SClient getClient()
throws Exception { public DataMinerService() {
// cachedSClients= new HashMap<>();
}
public SClient getClient() throws Exception {
ServiceCredential serviceCredential = getServiceCredential(); ServiceCredential serviceCredential = getServiceCredential();
/*
* if (cachedSClients.isEmpty() ||
* !cachedSClients.containsKey(serviceCredential.getScope())) {
*/
SClientBuilder sBuilder = new SClient4WPSBuilder(serviceCredential); SClientBuilder sBuilder = new SClient4WPSBuilder(serviceCredential);
SClientDirector director = new SClientDirector(); SClientDirector director = new SClientDirector();
director.setSClientBuilder(sBuilder); director.setSClientBuilder(sBuilder);
director.constructSClient(); director.constructSClient();
SClient sClient = director.getSClient(); SClient sClient = director.getSClient();
logger.debug("" + sClient); logger.debug("" + sClient);
// cachedSClients.put(serviceCredential.getScope(), sClient);
return sClient; return sClient;
/*
* } else { return cachedSClients.get(serviceCredential.getScope()); }
*/
} }
private static ServiceCredential getServiceCredential() private ServiceCredential getServiceCredential() throws ServiceException {
throws ServiceException {
String userName = null; String userName = null;
String token = null; String token = null;
String scope = null; String scope = null;
@ -66,11 +77,13 @@ public class DataMinerService {
try { try {
logger.debug("Retrieving token credentials"); logger.debug("Retrieving token credentials");
// get username from SmartGears // get username from SmartGears
ClientInfo tokenInfo = (UserInfo) AuthorizationProvider.instance // ClientInfo tokenInfo = (UserInfo)
.get().getClient(); // AuthorizationProvider.instance
userName = tokenInfo.getId(); // .get().getClient();
// userName = tokenInfo.getId();
token = SecurityTokenProvider.instance.get(); token = SecurityTokenProvider.instance.get();
AuthorizationEntry entry = authorizationService().get(token); AuthorizationEntry entry = authorizationService().get(token);
userName = entry.getClientInfo().getId();
scope = entry.getContext(); scope = entry.getContext();
} catch (Exception e) { } catch (Exception e) {
logger.error("Error Retrieving token credentials: " logger.error("Error Retrieving token credentials: "

View File

@ -3,8 +3,6 @@
*/ */
package org.gcube.data.analysis.dataminermanagercl.shared.parameters; package org.gcube.data.analysis.dataminermanagercl.shared.parameters;
/** /**
* *
* @author Giancarlo Panichi email: <a * @author Giancarlo Panichi email: <a
@ -15,8 +13,6 @@ public class ColumnListParameter extends Parameter {
private static final long serialVersionUID = -6743494426144267089L; private static final long serialVersionUID = -6743494426144267089L;
private String referredTabularParameterName; private String referredTabularParameterName;
// private List<String> columnNames = new ArrayList<String>();
private String value;
private String separator; private String separator;
public ColumnListParameter() { public ColumnListParameter() {
@ -47,18 +43,6 @@ public class ColumnListParameter extends Parameter {
return referredTabularParameterName; return referredTabularParameterName;
} }
/**
* @return the value
*/
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
/** /**
* @return the separator * @return the separator
*/ */

View File

@ -3,7 +3,6 @@
*/ */
package org.gcube.data.analysis.dataminermanagercl.shared.parameters; package org.gcube.data.analysis.dataminermanagercl.shared.parameters;
/** /**
* *
* @author Giancarlo Panichi email: <a * @author Giancarlo Panichi email: <a
@ -18,7 +17,6 @@ public class ColumnParameter extends Parameter {
private static final long serialVersionUID = -5084557326770554659L; private static final long serialVersionUID = -5084557326770554659L;
private String referredTabularParameterName; private String referredTabularParameterName;
private String defaultColumn; private String defaultColumn;
private String value;
/** /**
* *
@ -69,18 +67,6 @@ public class ColumnParameter extends Parameter {
this.defaultColumn = defaultColumn; this.defaultColumn = defaultColumn;
} }
/**
* @return the value
*/
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
return "ColumnParameter [referredTabularParameterName=" return "ColumnParameter [referredTabularParameterName="

View File

@ -3,7 +3,6 @@
*/ */
package org.gcube.data.analysis.dataminermanagercl.shared.parameters; package org.gcube.data.analysis.dataminermanagercl.shared.parameters;
/** /**
* *
* @author Giancarlo Panichi email: <a * @author Giancarlo Panichi email: <a
@ -14,7 +13,6 @@ public class DateParameter extends Parameter {
private static final long serialVersionUID = 1673874854501249519L; private static final long serialVersionUID = 1673874854501249519L;
private String defaultValue; private String defaultValue;
private String value;
/** /**
* *
@ -49,19 +47,6 @@ public class DateParameter extends Parameter {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
/**
* @return the value
*/
@Override
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
return "DateParameter [defaultValue=" + defaultValue + ", value=" return "DateParameter [defaultValue=" + defaultValue + ", value="

View File

@ -8,8 +8,8 @@ import java.util.List;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class EnumParameter extends Parameter { public class EnumParameter extends Parameter {
@ -17,8 +17,6 @@ public class EnumParameter extends Parameter {
private static final long serialVersionUID = 1673874854501249519L; private static final long serialVersionUID = 1673874854501249519L;
private List<String> values = new ArrayList<String>(); private List<String> values = new ArrayList<String>();
private String defaultValue; private String defaultValue;
private String value;
/** /**
* *
@ -27,66 +25,52 @@ public class EnumParameter extends Parameter {
super(); super();
this.typology = ParameterType.ENUM; this.typology = ParameterType.ENUM;
} }
/** /**
* @param type * @param type
* @param defaultValue * @param defaultValue
* @param value * @param value
*/ */
public EnumParameter(String name, String description, List<String> values, String defaultValue) { public EnumParameter(String name, String description, List<String> values,
String defaultValue) {
super(name, ParameterType.ENUM, description); super(name, ParameterType.ENUM, description);
this.values = values; this.values = values;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
/** /**
* @return the defaultValue * @return the defaultValue
*/ */
public String getDefaultValue() { public String getDefaultValue() {
return defaultValue; return defaultValue;
} }
/** /**
* @param defaultValue the defaultValue to set * @param defaultValue
* the defaultValue to set
*/ */
public void setDefaultValue(String defaultValue) { public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
/** /**
* @param values the values to set * @param values
* the values to set
*/ */
public void setValues(List<String> values) { public void setValues(List<String> values) {
this.values = values; this.values = values;
} }
/** /**
* @return the values * @return the values
*/ */
public List<String> getValues() { public List<String> getValues() {
return values; return values;
} }
public void addValue(String value) { public void addValue(String value) {
this.values.add(value); this.values.add(value);
} }
/**
* @return the value
*/
@Override
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
@ -95,8 +79,5 @@ public class EnumParameter extends Parameter {
+ ", description=" + description + ", typology=" + typology + ", description=" + description + ", typology=" + typology
+ "]"; + "]";
} }
} }

View File

@ -5,19 +5,18 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class FileParameter extends Parameter { public class FileParameter extends Parameter {
private static final long serialVersionUID = -2967577990287112937L; private static final long serialVersionUID = -2967577990287112937L;
private String value;
private String defaultMimeType; private String defaultMimeType;
private ArrayList<String> supportedMimeTypes; private ArrayList<String> supportedMimeTypes;
/** /**
* *
*/ */
@ -25,7 +24,7 @@ public class FileParameter extends Parameter {
super(); super();
this.typology = ParameterType.FILE; this.typology = ParameterType.FILE;
} }
/** /**
* *
* @param name * @param name
@ -33,7 +32,8 @@ public class FileParameter extends Parameter {
* @param fileName * @param fileName
* @param mimeType * @param mimeType
*/ */
public FileParameter(String name, String description, String defaultMimeType, ArrayList<String> supportedMimeTypes) { public FileParameter(String name, String description,
String defaultMimeType, ArrayList<String> supportedMimeTypes) {
super(name, ParameterType.FILE, description); super(name, ParameterType.FILE, description);
this.defaultMimeType = defaultMimeType; this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes; this.supportedMimeTypes = supportedMimeTypes;
@ -55,23 +55,6 @@ public class FileParameter extends Parameter {
this.supportedMimeTypes = supportedMimeTypes; this.supportedMimeTypes = supportedMimeTypes;
} }
/**
*
*/
public String getValue() {
return value;
}
/**
*
*/
@Override
public void setValue(String value) {
this.value=value;
}
@Override @Override
public String toString() { public String toString() {
return "FileParameter [value=" + value + ", defaultMimeType=" return "FileParameter [value=" + value + ", defaultMimeType="
@ -80,7 +63,4 @@ public class FileParameter extends Parameter {
+ description + ", typology=" + typology + "]"; + description + ", typology=" + typology + "]";
} }
} }

View File

@ -14,7 +14,6 @@ public class ListParameter extends Parameter {
private static final long serialVersionUID = 5405965026753332225L; private static final long serialVersionUID = 5405965026753332225L;
private String type; private String type;
private String value;
private String separator; private String separator;
/** /**
@ -51,15 +50,6 @@ public class ListParameter extends Parameter {
this.type = type; this.type = type;
} }
@Override
public void setValue(String value) {
this.value = value;
}
@Override
public String getValue() {
return value;
}
/** /**
* @return the separator * @return the separator

View File

@ -1,21 +1,17 @@
package org.gcube.data.analysis.dataminermanagercl.shared.parameters; package org.gcube.data.analysis.dataminermanagercl.shared.parameters;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class ObjectParameter extends Parameter { public class ObjectParameter extends Parameter {
private static final long serialVersionUID = 1058462575242430851L; private static final long serialVersionUID = 1058462575242430851L;
private String type; private String type;
private String defaultValue; private String defaultValue;
private String value;
/** /**
* *
*/ */
@ -23,55 +19,50 @@ public class ObjectParameter extends Parameter {
super(); super();
this.typology = ParameterType.OBJECT; this.typology = ParameterType.OBJECT;
} }
/**
public ObjectParameter(String name, String description, String type, String defaultValue) { *
* @param name
* @param description
* @param type
* @param defaultValue
*/
public ObjectParameter(String name, String description, String type,
String defaultValue) {
super(name, ParameterType.OBJECT, description); super(name, ParameterType.OBJECT, description);
this.type = type; this.type = type;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
/** /**
* @return the type * @return the type
*/ */
public String getType() { public String getType() {
return type; return type;
} }
/** /**
* @param type the type to set * @param type
* the type to set
*/ */
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
/** /**
* @return the defaultValue * @return the defaultValue
*/ */
public String getDefaultValue() { public String getDefaultValue() {
return defaultValue; return defaultValue;
} }
/** /**
* @param defaultValue the defaultValue to set * @param defaultValue
* the defaultValue to set
*/ */
public void setDefaultValue(String defaultValue) { public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
/**
* @return the value
*/
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
@ -81,10 +72,4 @@ public class ObjectParameter extends Parameter {
+ "]"; + "]";
} }
} }

View File

@ -21,6 +21,7 @@ public abstract class Parameter implements Serializable {
protected String name; protected String name;
protected String description; protected String description;
protected ParameterType typology; protected ParameterType typology;
protected String value;
/** /**
* *
@ -29,6 +30,7 @@ public abstract class Parameter implements Serializable {
super(); super();
} }
/** /**
* @param name * @param name
* @param type * @param type
@ -43,9 +45,13 @@ public abstract class Parameter implements Serializable {
this.description = description; this.description = description;
} }
public abstract void setValue(String value); public void setValue(String value){
this.value=value;
}
public abstract String getValue(); public String getValue(){
return value;
}
public String getName() { public String getName() {
return name; return name;
@ -88,7 +94,9 @@ public abstract class Parameter implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "Parameter [name=" + name + ", description=" + description return "Parameter [name=" + name + ", description=" + description
+ ", typology=" + typology + "]"; + ", typology=" + typology + ", value=" + value + "]";
} }
} }

View File

@ -7,14 +7,13 @@ import java.util.ArrayList;
/** /**
* *
* @author Giancarlo Panichi * @author Giancarlo Panichi email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class TabularListParameter extends Parameter { public class TabularListParameter extends Parameter {
private static final long serialVersionUID = -1786477950530892502L; private static final long serialVersionUID = -1786477950530892502L;
private String value;
private String separator; private String separator;
private ArrayList<String> templates = new ArrayList<String>(); private ArrayList<String> templates = new ArrayList<String>();
private String defaultMimeType; private String defaultMimeType;
@ -40,16 +39,6 @@ public class TabularListParameter extends Parameter {
this.supportedMimeTypes = supportedMimeTypes; this.supportedMimeTypes = supportedMimeTypes;
} }
@Override
public void setValue(String value) {
this.value = value;
}
@Override
public String getValue() {
return value;
}
/** /**
* @return the separator * @return the separator
*/ */
@ -105,6 +94,4 @@ public class TabularListParameter extends Parameter {
+ description + ", typology=" + typology + "]"; + description + ", typology=" + typology + "]";
} }
} }

View File

@ -14,7 +14,6 @@ import java.util.ArrayList;
public class TabularParameter extends Parameter { public class TabularParameter extends Parameter {
private static final long serialVersionUID = 8038591467145151553L; private static final long serialVersionUID = 8038591467145151553L;
private String tableName;
private ArrayList<String> templates = new ArrayList<String>(); private ArrayList<String> templates = new ArrayList<String>();
private String defaultMimeType; private String defaultMimeType;
private ArrayList<String> supportedMimeTypes; private ArrayList<String> supportedMimeTypes;
@ -36,7 +35,7 @@ public class TabularParameter extends Parameter {
public TabularParameter(String name, String description, String tableName, public TabularParameter(String name, String description, String tableName,
String defaultMimeType, ArrayList<String> supportedMimeTypes) { String defaultMimeType, ArrayList<String> supportedMimeTypes) {
super(name, ParameterType.TABULAR, description); super(name, ParameterType.TABULAR, description);
this.tableName = tableName; this.value = tableName;
this.templates = null; this.templates = null;
this.defaultMimeType = defaultMimeType; this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes; this.supportedMimeTypes = supportedMimeTypes;
@ -53,18 +52,18 @@ public class TabularParameter extends Parameter {
ArrayList<String> templates, String defaultMimeType, ArrayList<String> templates, String defaultMimeType,
ArrayList<String> supportedMimeTypes) { ArrayList<String> supportedMimeTypes) {
super(name, ParameterType.TABULAR, description); super(name, ParameterType.TABULAR, description);
this.tableName = tableName; this.value = tableName;
this.templates = templates; this.templates = templates;
this.defaultMimeType = defaultMimeType; this.defaultMimeType = defaultMimeType;
this.supportedMimeTypes = supportedMimeTypes; this.supportedMimeTypes = supportedMimeTypes;
} }
public String getTableName() { public String getTableName() {
return tableName; return value;
} }
public void setTableName(String tableName) { public void setTableName(String tableName) {
this.tableName = tableName; this.value = tableName;
} }
public ArrayList<String> getTemplates() { public ArrayList<String> getTemplates() {
@ -75,16 +74,6 @@ public class TabularParameter extends Parameter {
this.templates = templates; this.templates = templates;
} }
@Override
public String getValue() {
return getTableName();
}
@Override
public void setValue(String value) {
this.setTableName(value);
}
public String getDefaultMimeType() { public String getDefaultMimeType() {
return defaultMimeType; return defaultMimeType;
} }
@ -103,7 +92,7 @@ public class TabularParameter extends Parameter {
@Override @Override
public String toString() { public String toString() {
return "TabularParameter [tableName=" + tableName + ", templates=" return "TabularParameter [tableName=" + value + ", templates="
+ templates + ", defaultMimeType=" + defaultMimeType + templates + ", defaultMimeType=" + defaultMimeType
+ ", supportedMimeTypes=" + supportedMimeTypes + ", name=" + ", supportedMimeTypes=" + supportedMimeTypes + ", name="
+ name + ", description=" + description + ", typology=" + name + ", description=" + description + ", typology="

View File

@ -13,7 +13,6 @@ public class TimeParameter extends Parameter {
private static final long serialVersionUID = 1673874854501249519L; private static final long serialVersionUID = 1673874854501249519L;
private String defaultValue; private String defaultValue;
private String value;
/** /**
* *
@ -48,19 +47,6 @@ public class TimeParameter extends Parameter {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }
/**
* @return the value
*/
@Override
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
return "TimeParameter [defaultValue=" + defaultValue + ", value=" return "TimeParameter [defaultValue=" + defaultValue + ", value="

View File

@ -15,7 +15,6 @@ public class WKTParameter extends Parameter {
private static final long serialVersionUID = 1673874854501249519L; private static final long serialVersionUID = 1673874854501249519L;
private WKTGeometryType wktGeometryType; private WKTGeometryType wktGeometryType;
private String defaultValue; private String defaultValue;
private String value;
/** /**
* *
@ -69,19 +68,6 @@ public class WKTParameter extends Parameter {
this.wktGeometryType = wktGeometryType; this.wktGeometryType = wktGeometryType;
} }
/**
* @return the value
*/
@Override
public String getValue() {
return value;
}
@Override
public void setValue(String value) {
this.value = value;
}
@Override @Override
public String toString() { public String toString() {
return "WKTParameter [wktGeometryType=" + wktGeometryType return "WKTParameter [wktGeometryType=" + wktGeometryType

View File

@ -1,7 +1,6 @@
package org.gcube.data.analysis.dataminermanagercl.test; package org.gcube.data.analysis.dataminermanagercl.test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import junit.framework.TestCase; import junit.framework.TestCase;
@ -37,7 +36,8 @@ public class DBScanTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test Dbscan"); logger.debug("Test Dbscan");
try { try {
SClient sClient = DataMinerService.getClient(); DataMinerService dataMinerService = new DataMinerService();
SClient sClient = dataMinerService.getClient();
Operator dBScanOperator = sClient Operator dBScanOperator = sClient
.getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.DBSCAN"); .getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.DBSCAN");
@ -90,8 +90,7 @@ public class DBScanTest extends TestCase {
@Override @Override
public void failed(String message, Exception exception) { public void failed(String message, Exception exception) {
logger.error("Operation Failed"); logger.error("Operation Failed");
logger.error(message); logger.error(message, exception);
logger.error(exception.getStackTrace().toString());
} }
@ -126,11 +125,12 @@ public class DBScanTest extends TestCase {
OutputData output = sClient OutputData output = sClient
.getOutputDataByComputationId(computationId); .getOutputDataByComputationId(computationId);
logger.debug("Output: " + output); logger.debug("Output: " + output);
Resource resource=output.getResource(); Resource resource = output.getResource();
if(resource.isMap()){ if (resource.isMap()) {
MapResource mapResource=(MapResource) resource; MapResource mapResource = (MapResource) resource;
for(String key: mapResource.getMap().keySet()){ for (String key : mapResource.getMap().keySet()) {
logger.debug("Entry: "+key+" = "+mapResource.getMap().get(key)); logger.debug("Entry: " + key + " = "
+ mapResource.getMap().get(key));
} }
} }
@ -158,32 +158,21 @@ public class DBScanTest extends TestCase {
occurencePointsTable.setName("OccurrencePointsTable"); occurencePointsTable.setName("OccurrencePointsTable");
occurencePointsTable occurencePointsTable
.setValue("http://data-d.d4science.org/SnBPSHJQOEI4UHQ0QkhnM2p3L2JGQytNTmtSb1FpUTFHbWJQNStIS0N6Yz0"); .setValue("http://data-d.d4science.org/SnBPSHJQOEI4UHQ0QkhnM2p3L2JGQytNTmtSb1FpUTFHbWJQNStIS0N6Yz0");
occurencePointsTable.setDefaultMimeType("text/csv");
ArrayList<String> supportedMimeTypes = new ArrayList<>(
Arrays.asList(new String[] { "text/xml", "text/csv",
"text/plain" }));
occurencePointsTable.setSupportedMimeTypes(supportedMimeTypes);
ColumnListParameter columnListParameter = new ColumnListParameter(); ColumnListParameter columnListParameter = new ColumnListParameter();
columnListParameter.setName("FeaturesColumnNames"); columnListParameter.setName("FeaturesColumnNames");
columnListParameter
.setReferredTabularParameterName("OccurrencePointsTable");
columnListParameter.setSeparator("|");
columnListParameter.setValue("depthmean|sstmnmax|salinitymin"); columnListParameter.setValue("depthmean|sstmnmax|salinitymin");
ObjectParameter occurencePointsClusterLabel = new ObjectParameter(); ObjectParameter occurencePointsClusterLabel = new ObjectParameter();
occurencePointsClusterLabel.setName("OccurrencePointsClusterLabel"); occurencePointsClusterLabel.setName("OccurrencePointsClusterLabel");
occurencePointsClusterLabel.setType("java.lang.String");
occurencePointsClusterLabel.setValue("Test"); occurencePointsClusterLabel.setValue("Test");
ObjectParameter epsilon = new ObjectParameter(); ObjectParameter epsilon = new ObjectParameter();
epsilon.setName("epsilon"); epsilon.setName("epsilon");
epsilon.setType("java.lang.Integer");
epsilon.setValue("10"); epsilon.setValue("10");
ObjectParameter minPoints = new ObjectParameter(); ObjectParameter minPoints = new ObjectParameter();
minPoints.setName("min_points"); minPoints.setName("min_points");
minPoints.setType("java.lang.Integer");
minPoints.setValue("1"); minPoints.setValue("1");
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();

View File

@ -28,7 +28,7 @@ public class DataMinerServiceTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test Operators"); logger.debug("Test Operators");
try { try {
SClient sClient = DataMinerService.getClient(); SClient sClient = new DataMinerService().getClient();
List<OperatorsClassification> operatorsClassifications = sClient List<OperatorsClassification> operatorsClassifications = sClient
.getOperatorsClassifications(); .getOperatorsClassifications();
logger.debug("OperatorsClassifications: " + operatorsClassifications); logger.debug("OperatorsClassifications: " + operatorsClassifications);
@ -69,7 +69,8 @@ public class DataMinerServiceTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test DBScan"); logger.debug("Test DBScan");
try { try {
SClient sClient = DataMinerService.getClient(); DataMinerService dataMinerService=new DataMinerService();
SClient sClient = dataMinerService.getClient();
List<OperatorsClassification> operatorsClassifications = sClient List<OperatorsClassification> operatorsClassifications = sClient
.getOperatorsClassifications(); .getOperatorsClassifications();
logger.debug("OperatorsClassifications rerieved"); logger.debug("OperatorsClassifications rerieved");

View File

@ -34,7 +34,8 @@ public class ListDBInfoTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test ListDBInfo"); logger.debug("Test ListDBInfo");
try { try {
SClient sClient = DataMinerService.getClient(); DataMinerService dataMinerService=new DataMinerService();
SClient sClient = dataMinerService.getClient();
Operator operator = sClient Operator operator = sClient
.getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBINFO"); .getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBINFO");
@ -147,15 +148,13 @@ public class ListDBInfoTest extends TestCase {
*/ */
private void createRequest(Operator operator) { private void createRequest(Operator operator) {
logger.debug("Create Request"); logger.debug("Create Request");
ObjectParameter resourceName = new ObjectParameter(); ObjectParameter resourceName = new ObjectParameter();
resourceName.setName("ResourceName"); resourceName.setName("ResourceName");
resourceName.setType("java.lang.String");
//MaxNumber.setValue("CKanDatabase");
resourceName.setValue("FishBase"); resourceName.setValue("FishBase");
//MaxNumber.setValue("CKanDatabase");
List<Parameter> parameters = new ArrayList<>();
List<Parameter> parameters = new ArrayList<>();
parameters.add(resourceName); parameters.add(resourceName);
logger.debug("Parameters set: " + parameters); logger.debug("Parameters set: " + parameters);

View File

@ -34,7 +34,8 @@ public class ListDBNameTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test ListDBName"); logger.debug("Test ListDBName");
try { try {
SClient sClient = DataMinerService.getClient(); DataMinerService dataMinerService=new DataMinerService();
SClient sClient = dataMinerService.getClient();
Operator operator = sClient Operator operator = sClient
.getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBNAMES"); .getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBNAMES");
@ -150,7 +151,6 @@ public class ListDBNameTest extends TestCase {
ObjectParameter maxNumber = new ObjectParameter(); ObjectParameter maxNumber = new ObjectParameter();
maxNumber.setName("MaxNumber"); maxNumber.setName("MaxNumber");
maxNumber.setType("java.lang.String");
maxNumber.setValue("-1"); maxNumber.setValue("-1");
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();

View File

@ -35,7 +35,8 @@ public class ListDBSchemaTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test ListDBSchema"); logger.debug("Test ListDBSchema");
try { try {
SClient sClient = DataMinerService.getClient(); DataMinerService dataMinerService=new DataMinerService();
SClient sClient = dataMinerService.getClient();
Operator operator = sClient Operator operator = sClient
.getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBSCHEMA"); .getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBSCHEMA");
@ -162,12 +163,10 @@ public class ListDBSchemaTest extends TestCase {
ObjectParameter resourceName = new ObjectParameter(); ObjectParameter resourceName = new ObjectParameter();
resourceName.setName("ResourceName"); resourceName.setName("ResourceName");
resourceName.setType("java.lang.String");
resourceName.setValue("FishBase"); resourceName.setValue("FishBase");
ObjectParameter databaseName = new ObjectParameter(); ObjectParameter databaseName = new ObjectParameter();
databaseName.setName("DatabaseName"); databaseName.setName("DatabaseName");
databaseName.setType("java.lang.String");
databaseName.setValue("fishbase"); databaseName.setValue("fishbase");
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();

View File

@ -35,7 +35,8 @@ public class ListTablesTest extends TestCase {
if (Constants.TEST_ENABLE) { if (Constants.TEST_ENABLE) {
logger.debug("Test ListTables"); logger.debug("Test ListTables");
try { try {
SClient sClient = DataMinerService.getClient(); DataMinerService dataMinerService=new DataMinerService();
SClient sClient = dataMinerService.getClient();
Operator operator = sClient Operator operator = sClient
.getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTTABLES"); .getOperatorById("org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTTABLES");
@ -162,17 +163,14 @@ public class ListTablesTest extends TestCase {
ObjectParameter resourceName = new ObjectParameter(); ObjectParameter resourceName = new ObjectParameter();
resourceName.setName("ResourceName"); resourceName.setName("ResourceName");
resourceName.setType("java.lang.String");
resourceName.setValue("FishBase"); resourceName.setValue("FishBase");
ObjectParameter databaseName = new ObjectParameter(); ObjectParameter databaseName = new ObjectParameter();
databaseName.setName("DatabaseName"); databaseName.setName("DatabaseName");
databaseName.setType("java.lang.String");
databaseName.setValue("fishbase"); databaseName.setValue("fishbase");
ObjectParameter schemaName = new ObjectParameter(); ObjectParameter schemaName = new ObjectParameter();
schemaName.setName("SchemaName"); schemaName.setName("SchemaName");
schemaName.setType("java.lang.String");
schemaName.setValue("public"); schemaName.setValue("public");
List<Parameter> parameters = new ArrayList<>(); List<Parameter> parameters = new ArrayList<>();