use of org.n52.shetland.ogc.swe.SweField in project arctic-sea by 52North.
the class FieldDecoderTest method testText.
@Test
public void testText() throws DecodingException {
ObjectNode json = createField().put(JSONConstants.TYPE, JSONConstants.TEXT_TYPE);
SweField field = checkCommon(json, false);
assertThat(field.getElement(), is(instanceOf(SweText.class)));
SweText swe = (SweText) field.getElement();
errors.checkThat(swe.getValue(), is(nullValue()));
}
use of org.n52.shetland.ogc.swe.SweField in project arctic-sea by 52North.
the class FieldDecoderTest method testCategoryWithValue.
@Test
public void testCategoryWithValue() throws DecodingException {
ObjectNode json = createField().put(JSONConstants.TYPE, JSONConstants.CATEGORY_TYPE).put(JSONConstants.CODESPACE, CODESPACE).put(JSONConstants.VALUE, CATEGORY_VALUE);
SweField field = checkCommon(json, true);
assertThat(field.getElement(), is(instanceOf(SweCategory.class)));
SweCategory swe = (SweCategory) field.getElement();
errors.checkThat(swe.getValue(), is(CATEGORY_VALUE));
errors.checkThat(swe.getCodeSpace(), is(CODESPACE));
}
use of org.n52.shetland.ogc.swe.SweField in project arctic-sea by 52North.
the class FieldDecoderTest method testObservablePropertyWithValue.
@Test
public void testObservablePropertyWithValue() throws DecodingException {
ObjectNode json = createField().put(JSONConstants.TYPE, JSONConstants.OBSERVABLE_PROPERTY_TYPE).put(JSONConstants.VALUE, OBSERVED_PROPERTY_VALUE);
SweField field = checkCommon(json, true);
assertThat(field.getElement(), is(instanceOf(SweObservableProperty.class)));
SweObservableProperty swe = (SweObservableProperty) field.getElement();
errors.checkThat(swe.getValue(), is(OBSERVED_PROPERTY_VALUE));
}
use of org.n52.shetland.ogc.swe.SweField in project arctic-sea by 52North.
the class FieldDecoderTest method testObservableProperty.
@Test
public void testObservableProperty() throws DecodingException {
ObjectNode json = createField().put(JSONConstants.TYPE, JSONConstants.OBSERVABLE_PROPERTY_TYPE);
SweField field = checkCommon(json, false);
assertThat(field.getElement(), is(instanceOf(SweObservableProperty.class)));
SweObservableProperty swe = (SweObservableProperty) field.getElement();
errors.checkThat(swe.getValue(), is(nullValue()));
}
use of org.n52.shetland.ogc.swe.SweField in project arctic-sea by 52North.
the class FieldDecoderTest method testTextWithValue.
@Test
public void testTextWithValue() throws DecodingException {
ObjectNode json = createField().put(JSONConstants.TYPE, JSONConstants.TEXT_TYPE).put(JSONConstants.VALUE, TEXT_VALUE);
SweField field = checkCommon(json, true);
assertThat(field.getElement(), is(instanceOf(SweText.class)));
SweText swe = (SweText) field.getElement();
errors.checkThat(swe.getValue(), is(TEXT_VALUE));
}
Aggregations