Updated Boolean support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/data-miner-manager-cl@134519 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-11-22 13:32:47 +00:00
parent aa26b7fc9d
commit 7cda53e606
4 changed files with 29 additions and 15 deletions

View File

@ -70,7 +70,7 @@ public abstract class SClient implements Serializable{
throws Exception;
/**
* Cance a computation
* Cancel a computation
*
* @param computationId computation Id
* @return

View File

@ -190,9 +190,15 @@ public class WPS2DM {
guessPrimitiveType(guessedType), defaultValue);
}
} else
converted = new ListParameter(id, title, String.class.getName(),
} else {
if(guessedType.compareTo(Boolean.class.getName())==0){
converted = new ObjectParameter(id, title, guessedType, defaultValue);
} else {
converted = new ListParameter(id, title, String.class.getName(),
SEPARATOR);
}
}
return converted;
}
@ -401,9 +407,14 @@ public class WPS2DM {
}
if (values.length > 1) {
ObjectParameter conv = (ObjectParameter) converted;
converted = new EnumParameter(conv.getName(),
conv.getDescription(), enumValues,
conv.getDefaultValue());
if (conv.getType() != null
&& !conv.getType().isEmpty()
&& conv.getType().compareToIgnoreCase(
Boolean.class.getName()) != 0){
converted = new EnumParameter(conv.getName(),
conv.getDescription(), enumValues,
conv.getDefaultValue());
}
}
}
} else if (wpsType.isSetComplexData()) {
@ -525,6 +536,9 @@ public class WPS2DM {
return Long.class.getName();
else if (typeS.contains("short"))
return Short.class.getName();
else if (typeS.contains("boolean"))
return Boolean.class.getName();
}
return String.class.getName();
@ -538,6 +552,7 @@ public class WPS2DM {
}
public static String guessPrimitiveType(String type) {
if (type.equals(Integer.class.getName())) {
return Integer.class.getName();
} else if (type.equals(String.class.getName())) {

View File

@ -19,7 +19,7 @@ public class Resource implements Serializable {
private static final long serialVersionUID = 1417885805472591661L;
public enum ResourceType {
OBJECT, FILE, TABULAR, MAP, IMAGE, ERROR
OBJECT, FILE, TABULAR, MAP, IMAGE
};
private String resourceId, name, description;
@ -128,9 +128,7 @@ public class Resource implements Serializable {
return this.resourceType == ResourceType.IMAGE;
}
public boolean isError() {
return this.resourceType == ResourceType.ERROR;
}
@Override
public String toString() {

View File

@ -60,7 +60,7 @@ public class BionymLocalTest extends TestCase {
.startComputation(operator);
logger.debug("Started ComputationId: " + computationId);
monitoringComputation(computationId, sClient);
}
assertTrue("Success", true);
@ -159,15 +159,16 @@ public class BionymLocalTest extends TestCase {
EnumParameter parserName=new EnumParameter();
parserName.setName("Parser_Name");
parserName.setValue("SIMPLE");
EnumParameter activatePreparsingProcessing=new EnumParameter();
ObjectParameter activatePreparsingProcessing = new ObjectParameter();
activatePreparsingProcessing.setName("Activate_Preparsing_Processing");
activatePreparsingProcessing.setValue("true");
EnumParameter useStemmedGenusAndSpecies=new EnumParameter();
ObjectParameter useStemmedGenusAndSpecies=new ObjectParameter();
useStemmedGenusAndSpecies.setName("Use_Stemmed_Genus_and_Species");
useStemmedGenusAndSpecies.setValue("false");
EnumParameter accuracyVsSpeed=new EnumParameter();
accuracyVsSpeed.setName("Accuracy_vs_Speed");
accuracyVsSpeed.setValue("MAX_ACCURACY");