use of com.sldeditor.rendertransformation.SelectedProcessFunction in project sldeditor by robward-scisys.
the class SelectedProcessFunctionTest method testSetBuiltInProcessFunction.
/**
* Test method for
* {@link com.sldeditor.rendertransformation.SelectedProcessFunction#setBuiltInProcessFunction(org.opengis.filter.capability.FunctionName, org.geotools.process.function.ProcessFunction)}.
*/
@Test
public void testSetBuiltInProcessFunction() {
SelectedProcessFunction obj = new SelectedProcessFunction();
assertTrue(obj.isBuiltInSelected());
assertTrue(obj.extractParameters().isEmpty());
assertNull(obj.getFunctionName());
assertEquals(0, obj.getRowCount());
ProcessFunctionFactory processFunctionFactory = new ProcessFunctionFactory();
List<FunctionName> functionNameList = processFunctionFactory.getFunctionNames();
FunctionName functionName = functionNameList.get(0);
obj.setBuiltInProcessFunction(functionName, null);
assertTrue(obj.isBuiltInSelected());
assertTrue(obj.getFunctionName().getLocalPart().compareTo(functionName.getName()) == 0);
assertEquals(obj.getRowCount(), obj.extractParameters().size());
assertFalse(obj.extractParameters().isEmpty());
}
use of com.sldeditor.rendertransformation.SelectedProcessFunction in project sldeditor by robward-scisys.
the class SelectedProcessFunctionTest method testSetSelectedCustomFunction.
/**
* Test method for
* {@link com.sldeditor.rendertransformation.SelectedProcessFunction#setSelectedCustomFunction(net.opengis.wps10.ProcessDescriptionType)}.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testSetSelectedCustomFunction() {
ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
CodeType codeType = Ows11FactoryImpl.init().createCodeType();
String expectedFunctionName = "JTS:area";
codeType.setValue(expectedFunctionName);
process.setIdentifier(codeType);
InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
codeType2.setValue("dummyParameter");
inputDescription.setIdentifier(codeType2);
inputDescription.setMinOccurs(BigInteger.valueOf(1));
inputDescription.setMaxOccurs(BigInteger.valueOf(1));
LiteralInputType literal = Wps10FactoryImpl.init().createLiteralInputType();
DomainMetadataType domainType = Ows11FactoryImpl.init().createDomainMetadataType();
domainType.setValue("xs:int");
literal.setDefaultValue("1234");
literal.setDataType(domainType);
inputDescription.setLiteralData(literal);
DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
EList dataInputList = dataInputs.getInput();
dataInputList.add(inputDescription);
process.setDataInputs(dataInputs);
LanguageStringType title = Ows11FactoryImpl.init().createLanguageStringType();
title.setValue(expectedFunctionName);
process.setTitle(title);
SelectedProcessFunction obj = new SelectedProcessFunction();
obj.setSelectedCustomFunction(process);
assertFalse(obj.isBuiltInSelected());
assertTrue(obj.getFunctionName().getLocalPart().compareTo(expectedFunctionName) == 0);
assertEquals(1, obj.getRowCount());
assertFalse(obj.extractParameters().isEmpty());
obj.setSelectedCustomFunction(null);
assertFalse(obj.isBuiltInSelected());
assertNull(obj.getFunctionName());
assertEquals(0, obj.getRowCount());
assertTrue(obj.extractParameters().isEmpty());
}
Aggregations