Search in sources :

Example 6 with SweQuality

use of org.n52.shetland.ogc.swe.simpleType.SweQuality in project arctic-sea by 52North.

the class SweCommonEncoderv101Test method should_encode_count_with_quality_text.

@Test
public void should_encode_count_with_quality_text() throws EncodingException {
    final String qualityTextValue = "quality-text-value";
    final SweCount sosCount = (SweCount) new SweCount().setQuality(Lists.newArrayList((SweQuality) new SweText().setValue(qualityTextValue)));
    final XmlObject encode = sweCommonEncoderv101.encode(sosCount);
    assertThat(encode, instanceOf(Count.class));
    final Count xbCount = (Count) encode;
    assertThat(xbCount.getQualityArray(), is(not(nullValue())));
    assertThat(xbCount.getQualityArray().length, is(1));
    assertThat(xbCount.getQualityArray(0).isSetText(), is(true));
    assertThat(xbCount.getQualityArray(0).getText().getValue(), is(qualityTextValue));
}
Also used : SweText(org.n52.shetland.ogc.swe.simpleType.SweText) SweCount(org.n52.shetland.ogc.swe.simpleType.SweCount) XmlObject(org.apache.xmlbeans.XmlObject) SweCount(org.n52.shetland.ogc.swe.simpleType.SweCount) Count(net.opengis.swe.x101.CountDocument.Count) Test(org.junit.Test)

Aggregations

Count (net.opengis.swe.x101.CountDocument.Count)4 XmlObject (org.apache.xmlbeans.XmlObject)4 Test (org.junit.Test)4 SweCount (org.n52.shetland.ogc.swe.simpleType.SweCount)4 SweCategory (org.n52.shetland.ogc.swe.simpleType.SweCategory)3 SweQuantity (org.n52.shetland.ogc.swe.simpleType.SweQuantity)3 SweQuantityRange (org.n52.shetland.ogc.swe.simpleType.SweQuantityRange)3 SweText (org.n52.shetland.ogc.swe.simpleType.SweText)3 SweQuality (org.n52.shetland.ogc.swe.simpleType.SweQuality)2 BigDecimal (java.math.BigDecimal)1 QualityPropertyType (net.opengis.swe.x101.QualityPropertyType)1 QualityPropertyType (net.opengis.swe.x20.QualityPropertyType)1 RangeValue (org.n52.shetland.ogc.swe.RangeValue)1