Search in sources :

Example 1 with SwesExtension

use of org.n52.shetland.ogc.swes.SwesExtension in project arctic-sea by 52North.

the class SwesExtensionsTest method containsExtension_for_string_created_with_enum_schould_return_true.

@Test
public void containsExtension_for_string_created_with_enum_schould_return_true() {
    final Extensions extensions = new Extensions();
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_1).setValue(new SweText()));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_2).setValue(new SweText()));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_3).setValue(new SweText()));
    assertThat(extensions.containsExtension(DEFINITION_1), is(TRUE));
    assertThat(extensions.containsExtension(DEFINITION_2), is(TRUE));
    assertThat(extensions.containsExtension(DEFINITION_3), is(TRUE));
}
Also used : SweText(org.n52.shetland.ogc.swe.simpleType.SweText) Extensions(org.n52.shetland.ogc.ows.extension.Extensions) Test(org.junit.Test)

Example 2 with SwesExtension

use of org.n52.shetland.ogc.swes.SwesExtension in project arctic-sea by 52North.

the class SwesExtensionsTest method getExtension_for_enum_schould_return_true.

@Test
public void getExtension_for_enum_schould_return_true() {
    final Extensions extensions = new Extensions();
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_1).setValue(VALUE_1));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_2).setValue(VALUE_2));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_3).setValue(VALUE_3));
    assertThat(extensions.getExtension(DEFINITION_1).orElse(null).getValue(), instanceOf(VALUE_1.getClass()));
    assertThat(extensions.getExtension(DEFINITION_2).orElse(null).getValue(), instanceOf(VALUE_2.getClass()));
    assertThat(extensions.getExtension(DEFINITION_3).orElse(null).getValue(), instanceOf(VALUE_3.getClass()));
}
Also used : Extensions(org.n52.shetland.ogc.ows.extension.Extensions) Test(org.junit.Test)

Example 3 with SwesExtension

use of org.n52.shetland.ogc.swes.SwesExtension in project arctic-sea by 52North.

the class SwesExtensionsTest method containsExtension_for_string_schould_return_true.

@Test
public void containsExtension_for_string_schould_return_true() {
    final Extensions extensions = new Extensions();
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_1).setValue(new SweText()));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_2).setValue(new SweText()));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_3).setValue(new SweText()));
    assertThat(extensions.containsExtension(DEFINITION_1), is(TRUE));
    assertThat(extensions.containsExtension(DEFINITION_2), is(TRUE));
    assertThat(extensions.containsExtension(DEFINITION_3), is(TRUE));
}
Also used : SweText(org.n52.shetland.ogc.swe.simpleType.SweText) Extensions(org.n52.shetland.ogc.ows.extension.Extensions) Test(org.junit.Test)

Example 4 with SwesExtension

use of org.n52.shetland.ogc.swes.SwesExtension in project arctic-sea by 52North.

the class SwesExtensionsTest method getExtension_for_string_schould_return_true.

@Test
public void getExtension_for_string_schould_return_true() {
    final Extensions extensions = new Extensions();
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_1).setValue(VALUE_1));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_2).setValue(VALUE_2));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_3).setValue(VALUE_3));
    assertThat(extensions.getExtension(DEFINITION_1).orElse(null).getValue(), instanceOf(VALUE_1.getClass()));
    assertThat(extensions.getExtension(DEFINITION_2).orElse(null).getValue(), instanceOf(VALUE_2.getClass()));
    assertThat(extensions.getExtension(DEFINITION_3).orElse(null).getValue(), instanceOf(VALUE_3.getClass()));
}
Also used : Extensions(org.n52.shetland.ogc.ows.extension.Extensions) Test(org.junit.Test)

Example 5 with SwesExtension

use of org.n52.shetland.ogc.swes.SwesExtension in project arctic-sea by 52North.

the class SwesExtensionsTest method containsExtension_for_enum_created_with_string_schould_return_true.

@Test
public void containsExtension_for_enum_created_with_string_schould_return_true() {
    final Extensions extensions = new Extensions();
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_1).setValue(new SweText()));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_2).setValue(new SweText()));
    extensions.addExtension(new SwesExtension<>().setDefinition(DEFINITION_3).setValue(new SweText()));
    assertThat(extensions.containsExtension(DEFINITION_1), is(TRUE));
    assertThat(extensions.containsExtension(DEFINITION_2), is(TRUE));
    assertThat(extensions.containsExtension(DEFINITION_3), is(TRUE));
}
Also used : SweText(org.n52.shetland.ogc.swe.simpleType.SweText) Extensions(org.n52.shetland.ogc.ows.extension.Extensions) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 Extensions (org.n52.shetland.ogc.ows.extension.Extensions)10 SweText (org.n52.shetland.ogc.swe.simpleType.SweText)4 XmlObject (org.apache.xmlbeans.XmlObject)3 SweBoolean (org.n52.shetland.ogc.swe.simpleType.SweBoolean)3 SwesExtension (org.n52.shetland.ogc.swes.SwesExtension)3 BooleanPropertyType (net.opengis.swe.x20.BooleanPropertyType)2 BooleanType (net.opengis.swe.x20.BooleanType)2 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)2 GetFeatureOfInterestType (net.opengis.sos.x20.GetFeatureOfInterestType)1 InsertObservationDocument (net.opengis.sos.x20.InsertObservationDocument)1 InsertObservationType (net.opengis.sos.x20.InsertObservationType)1 GetFeatureOfInterestRequest (org.n52.shetland.ogc.sos.request.GetFeatureOfInterestRequest)1 InsertObservationRequest (org.n52.shetland.ogc.sos.request.InsertObservationRequest)1 UnsupportedDecoderXmlInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderXmlInputException)1