use of org.n52.svalbard.decode.DecoderRepository in project arctic-sea by 52North.
the class BatchRequestDecodingTest method before.
@Before
public void before() throws DecodingException {
DecoderRepository decoderRepository = new DecoderRepository();
this.decoder = new BatchRequestDecoder();
this.decoder.setDecoderRepository(decoderRepository);
InsertSensorRequestDecoder insertSensorRequestDecoder = new InsertSensorRequestDecoder();
insertSensorRequestDecoder.setDecoderRepository(decoderRepository);
InsertObservationRequestDecoder insertObservationRequestDecoder = new InsertObservationRequestDecoder();
insertObservationRequestDecoder.setDecoderRepository(decoderRepository);
SensorMLDecoderV101 sensorMLDecoder = new SensorMLDecoderV101();
sensorMLDecoder.setXmlOptions(XmlOptions::new);
sensorMLDecoder.setDecoderRepository(decoderRepository);
SweCommonDecoderV101 sweCommonDecoder = new SweCommonDecoderV101();
sweCommonDecoder.setXmlOptions(XmlOptions::new);
sweCommonDecoder.setDecoderRepository(decoderRepository);
GmlDecoderv311 gmlDecoderv311 = new GmlDecoderv311();
ObservationDecoder observationDecoder = new ObservationDecoder();
observationDecoder.setDecoderRepository(decoderRepository);
InsertResultTemplateRequestDecoder insertResultTemplateRequestDecoder = new InsertResultTemplateRequestDecoder();
insertResultTemplateRequestDecoder.setDecoderRepository(decoderRepository);
InsertResultRequestDecoder insertResultRequestDecoder = new InsertResultRequestDecoder();
insertResultRequestDecoder.setDecoderRepository(decoderRepository);
FieldDecoder fieldDecoder = new FieldDecoder();
fieldDecoder.setDecoderRepository(decoderRepository);
decoderRepository.setDecoders(Arrays.asList(decoder, insertSensorRequestDecoder, insertObservationRequestDecoder, insertResultTemplateRequestDecoder, insertResultRequestDecoder, sensorMLDecoder, sweCommonDecoder, observationDecoder, fieldDecoder, gmlDecoderv311));
decoderRepository.init();
this.request = decoder.decodeJSON(json, true);
}
use of org.n52.svalbard.decode.DecoderRepository in project arctic-sea by 52North.
the class GetObservationRequestDecoderTest method before.
@Before
public void before() {
DecoderRepository decoderRepository = new DecoderRepository();
this.decoder = new GetObservationRequestDecoder();
this.decoder.setDecoderRepository(decoderRepository);
SpatialFilterDecoder spatialFilterDecoder = new SpatialFilterDecoder();
spatialFilterDecoder.setDecoderRepository(decoderRepository);
TemporalFilterDecoder temporalFilterDecoder = new TemporalFilterDecoder();
temporalFilterDecoder.setDecoderRepository(decoderRepository);
GeoJSONDecoder geoJSONDecoder = new GeoJSONDecoder();
geoJSONDecoder.setDecoderRepository(decoderRepository);
decoderRepository.setDecoders(Arrays.asList(decoder, spatialFilterDecoder, temporalFilterDecoder, geoJSONDecoder));
decoderRepository.init();
}
use of org.n52.svalbard.decode.DecoderRepository in project arctic-sea by 52North.
the class InsertObservationRequestDecoderTest method before.
@Before
public void before() {
DecoderRepository decoderRepository = new DecoderRepository();
this.decoder = new InsertObservationRequestDecoder();
this.decoder.setDecoderRepository(decoderRepository);
ObservationDecoder observationDecoder = new ObservationDecoder();
observationDecoder.setDecoderRepository(decoderRepository);
decoderRepository.setDecoders(Arrays.asList(decoder, observationDecoder));
decoderRepository.init();
}
use of org.n52.svalbard.decode.DecoderRepository in project arctic-sea by 52North.
the class InsertResultTemplateRequestDecoderTest method before.
@Before
public void before() {
DecoderRepository decoderRepository = new DecoderRepository();
this.decoder = new InsertResultTemplateRequestDecoder();
this.decoder.setDecoderRepository(decoderRepository);
FieldDecoder fieldDecoder = new FieldDecoder();
fieldDecoder.setDecoderRepository(decoderRepository);
decoderRepository.setDecoders(Arrays.asList(this.decoder, fieldDecoder));
decoderRepository.init();
}
use of org.n52.svalbard.decode.DecoderRepository in project arctic-sea by 52North.
the class InsertSensorRequestDecoderTest method setUp.
@Before
public void setUp() throws DecodingException, IOException {
DecoderRepository decoderRepository = new DecoderRepository();
this.decoder = new InsertSensorRequestDecoder();
this.decoder.setDecoderRepository(decoderRepository);
SensorMLDecoderV101 sensorMLDecoder = new SensorMLDecoderV101();
sensorMLDecoder.setXmlOptions(XmlOptions::new);
sensorMLDecoder.setDecoderRepository(decoderRepository);
SweCommonDecoderV101 sweCommonDecoder = new SweCommonDecoderV101();
sweCommonDecoder.setXmlOptions(XmlOptions::new);
sweCommonDecoder.setDecoderRepository(decoderRepository);
GmlDecoderv311 gmlDecoderv311 = new GmlDecoderv311();
decoderRepository.setDecoders(Arrays.asList(decoder, sensorMLDecoder, sweCommonDecoder, gmlDecoderv311));
decoderRepository.init();
final JsonNode json = JsonLoader.fromResource("/examples/sos/InsertSensorRequest.json");
this.req = decoder.decode(json);
assertThat(req, is(notNullValue()));
}
Aggregations