use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class FieldDecoderTest method checkCommon.
protected SweField checkCommon(ObjectNode json, boolean withValue) throws DecodingException {
SweField field = validateWithValueAndDecode(json, withValue);
assertThat(field, is(notNullValue()));
errors.checkThat(field.getName().getValue(), is(NAME));
assertThat(field.getElement(), is(notNullValue()));
errors.checkThat(field.getElement().getDefinition(), is(DEFINITION));
errors.checkThat(field.getElement().getDescription(), is(DESCRIPTION));
errors.checkThat(field.getElement().getIdentifier(), is(IDENTIFIER));
errors.checkThat(field.getElement().getLabel(), is(LABEL));
return field;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class GeometryObservationDecodingTest method before.
@Before
public void before() throws DecodingException {
this.decoder = new ObservationDecoder();
this.observation = decoder.decodeJSON(json, true);
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class ODataFesParserTest method testEndswith.
@Test
public void testEndswith() throws DecodingException {
Filter<?> filter = parser.decode("endswith(textValue,'asdf')");
assertThat(filter, is(instanceOf(ComparisonFilter.class)));
ComparisonFilter cf = (ComparisonFilter) filter;
errors.checkThat(cf.getOperator(), is(ComparisonOperator.PropertyIsLike));
errors.checkThat(cf.getValue(), is("%asdf"));
errors.checkThat(cf.getValueReference(), is("om:result"));
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class ODataFesParserTest method testStartswith.
@Test
public void testStartswith() throws DecodingException {
Filter<?> filter = parser.decode("startswith(textValue,'asdf')");
assertThat(filter, is(instanceOf(ComparisonFilter.class)));
ComparisonFilter cf = (ComparisonFilter) filter;
errors.checkThat(cf.getOperator(), is(ComparisonOperator.PropertyIsLike));
errors.checkThat(cf.getValue(), is("asdf%"));
errors.checkThat(cf.getValueReference(), is("om:result"));
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class AbstractGmlDecoderv321 method parseNamedValueType.
protected NamedValue<?> parseNamedValueType(NamedValuePropertyType namedValueProperty) throws DecodingException {
if (namedValueProperty.isSetNamedValue()) {
NamedValueType namedValue = namedValueProperty.getNamedValue();
NamedValue<?> sosNamedValue = parseNamedValueValue(namedValue.getValue());
org.n52.shetland.ogc.gml.ReferenceType referenceType = (org.n52.shetland.ogc.gml.ReferenceType) decodeXmlObject(namedValue.getName());
sosNamedValue.setName(referenceType);
return sosNamedValue;
} else if (namedValueProperty.isSetHref()) {
NamedValue<org.n52.shetland.ogc.gml.ReferenceType> sosNamedValue = new NamedValue<>();
org.n52.shetland.ogc.gml.ReferenceType referenceType = new org.n52.shetland.ogc.gml.ReferenceType(namedValueProperty.getHref());
if (namedValueProperty.isSetTitle()) {
referenceType.setTitle(namedValueProperty.getTitle());
}
sosNamedValue.setName(referenceType);
return sosNamedValue;
} else {
throw new UnsupportedDecoderInputException(this, namedValueProperty);
}
}
Aggregations