Search in sources :

Example 1 with SweDataComponentVisitor

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

the class SweCommonEncoderv101Test method should_throw_NoApplicableCodeException_with_DataRecord_and_field_with_not_supported_element.

@Test
public void should_throw_NoApplicableCodeException_with_DataRecord_and_field_with_not_supported_element() throws EncodingException {
    thrown.expect(EncodingException.class);
    thrown.expectMessage("The element type '" + getClass().getName() + "$1' " + "of the received '" + SweField.class.getName() + "' is not supported" + " by this encoder '" + SweCommonEncoderv101.class.getName() + "'.");
    sweCommonEncoderv101.encode(new SweDataRecord().addField(new SweField("test", new SweAbstractDataComponent() {

        @Override
        public SweDataComponentType getDataComponentType() {
            return null;
        }

        @Override
        public <T, X extends Throwable> T accept(SweDataComponentVisitor<T, X> visitor) {
            return null;
        }

        @Override
        public <X extends Throwable> void accept(VoidSweDataComponentVisitor<X> visitor) {
        }

        @Override
        public SweAbstractDataComponent copy() {
            return null;
        }
    })));
}
Also used : SweDataRecord(org.n52.shetland.ogc.swe.SweDataRecord) SweField(org.n52.shetland.ogc.swe.SweField) SweDataComponentType(org.n52.shetland.ogc.swe.SweConstants.SweDataComponentType) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)1 SweDataComponentType (org.n52.shetland.ogc.swe.SweConstants.SweDataComponentType)1 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)1 SweField (org.n52.shetland.ogc.swe.SweField)1