use of net.opengis.ows.x11.LanguageStringType 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());
}
use of net.opengis.ows.x11.LanguageStringType in project arctic-sea by 52North.
the class OwsEncoderv110 method encodeOwsLanguageString.
private LanguageStringType encodeOwsLanguageString(LocalizedString ls) {
LanguageStringType lst = LanguageStringType.Factory.newInstance(getXmlOptions());
lst.setStringValue(ls.getText());
lst.setLang(LocaleHelper.encode(ls.getLang()));
return lst;
}
Aggregations