Search in sources :

Example 1 with DescribeSensorResponseEncoder

use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.

the class DescribeSensorResponseEncoderTest method should_add_own_prefix_to_prefixMap.

@Test
public void should_add_own_prefix_to_prefixMap() {
    Map<String, String> prefixMap = Maps.newHashMap();
    new DescribeSensorResponseEncoder().addNamespacePrefixToMap(prefixMap);
    assertThat(prefixMap.isEmpty(), is(FALSE));
    assertThat(prefixMap.containsKey(SwesConstants.NS_SWES_20), is(TRUE));
    assertThat(prefixMap.containsValue(SwesConstants.NS_SWES_PREFIX), is(TRUE));
}
Also used : DescribeSensorResponseEncoder(org.n52.svalbard.encode.DescribeSensorResponseEncoder) Test(org.junit.Test)

Example 2 with DescribeSensorResponseEncoder

use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.

the class DescribeSensorResponseEncoderTest method should_return_exception_if_received_null.

@Test(expected = UnsupportedEncoderInputException.class)
public void should_return_exception_if_received_null() throws OwsExceptionReport, EncodingException {
    new DescribeSensorResponseEncoder().encode(null);
    new DescribeSensorResponseEncoder().encode(null, new ByteArrayOutputStream());
    new DescribeSensorResponseEncoder().encode(null, EncodingContext.empty());
}
Also used : ByteArrayOutputStream(java.io.ByteArrayOutputStream) DescribeSensorResponseEncoder(org.n52.svalbard.encode.DescribeSensorResponseEncoder) Test(org.junit.Test)

Example 3 with DescribeSensorResponseEncoder

use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.

the class DescribeSensorResponseEncoderTest method should_return_correct_encoder_keys.

@Test
public void should_return_correct_encoder_keys() {
    Set<EncoderKey> returnedKeySet = new DescribeSensorResponseEncoder().getKeys();
    assertThat(returnedKeySet.size(), is(3));
    assertThat(returnedKeySet, hasItem(new XmlEncoderKey(SwesConstants.NS_SWES_20, DescribeSensorResponse.class)));
    assertThat(returnedKeySet, hasItem(new OperationResponseEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, SosConstants.Operations.DescribeSensor, MediaTypes.TEXT_XML)));
    assertThat(returnedKeySet, hasItem(new OperationResponseEncoderKey(SosConstants.SOS, Sos2Constants.SERVICEVERSION, SosConstants.Operations.DescribeSensor, MediaTypes.APPLICATION_XML)));
}
Also used : EncoderKey(org.n52.svalbard.encode.EncoderKey) OperationResponseEncoderKey(org.n52.svalbard.encode.OperationResponseEncoderKey) XmlEncoderKey(org.n52.svalbard.encode.XmlEncoderKey) XmlEncoderKey(org.n52.svalbard.encode.XmlEncoderKey) OperationResponseEncoderKey(org.n52.svalbard.encode.OperationResponseEncoderKey) DescribeSensorResponseEncoder(org.n52.svalbard.encode.DescribeSensorResponseEncoder) Test(org.junit.Test)

Example 4 with DescribeSensorResponseEncoder

use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.

the class DescribeSensorResponseEncoderTest method should_return_emptySet_for_conformanceClasses.

@Test
public void should_return_emptySet_for_conformanceClasses() {
    assertThat(new DescribeSensorResponseEncoder().getConformanceClasses(SosConstants.SOS, Sos2Constants.SERVICEVERSION), is(not(nullValue())));
    assertThat(new DescribeSensorResponseEncoder().getConformanceClasses(SosConstants.SOS, Sos2Constants.SERVICEVERSION).isEmpty(), is(TRUE));
}
Also used : DescribeSensorResponseEncoder(org.n52.svalbard.encode.DescribeSensorResponseEncoder) Test(org.junit.Test)

Example 5 with DescribeSensorResponseEncoder

use of org.n52.svalbard.encode.DescribeSensorResponseEncoder in project arctic-sea by 52North.

the class DescribeSensorResponseEncoderTest method should_return_emptyMap_for_supportedTypes.

@Test
public void should_return_emptyMap_for_supportedTypes() {
    assertThat(new DescribeSensorResponseEncoder().getSupportedTypes(), is(not(nullValue())));
    assertThat(new DescribeSensorResponseEncoder().getSupportedTypes().isEmpty(), is(TRUE));
}
Also used : DescribeSensorResponseEncoder(org.n52.svalbard.encode.DescribeSensorResponseEncoder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 DescribeSensorResponseEncoder (org.n52.svalbard.encode.DescribeSensorResponseEncoder)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 SchemaLocation (org.n52.shetland.w3c.SchemaLocation)1 EncoderKey (org.n52.svalbard.encode.EncoderKey)1 OperationResponseEncoderKey (org.n52.svalbard.encode.OperationResponseEncoderKey)1 XmlEncoderKey (org.n52.svalbard.encode.XmlEncoderKey)1