Search in sources :

Example 1 with InsertResultTemplateRequestDecoder

use of org.n52.svalbard.decode.json.InsertResultTemplateRequestDecoder 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);
}
Also used : InsertResultTemplateRequestDecoder(org.n52.svalbard.decode.json.InsertResultTemplateRequestDecoder) SensorMLDecoderV101(org.n52.svalbard.decode.SensorMLDecoderV101) BatchRequestDecoder(org.n52.svalbard.decode.json.BatchRequestDecoder) SweCommonDecoderV101(org.n52.svalbard.decode.SweCommonDecoderV101) InsertResultRequestDecoder(org.n52.svalbard.decode.json.InsertResultRequestDecoder) XmlOptions(org.apache.xmlbeans.XmlOptions) ObservationDecoder(org.n52.svalbard.decode.json.ObservationDecoder) InsertSensorRequestDecoder(org.n52.svalbard.decode.json.InsertSensorRequestDecoder) InsertObservationRequestDecoder(org.n52.svalbard.decode.json.InsertObservationRequestDecoder) DecoderRepository(org.n52.svalbard.decode.DecoderRepository) FieldDecoder(org.n52.svalbard.decode.json.FieldDecoder) GmlDecoderv311(org.n52.svalbard.decode.GmlDecoderv311) Before(org.junit.Before)

Example 2 with InsertResultTemplateRequestDecoder

use of org.n52.svalbard.decode.json.InsertResultTemplateRequestDecoder 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();
}
Also used : InsertResultTemplateRequestDecoder(org.n52.svalbard.decode.json.InsertResultTemplateRequestDecoder) DecoderRepository(org.n52.svalbard.decode.DecoderRepository) FieldDecoder(org.n52.svalbard.decode.json.FieldDecoder) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 DecoderRepository (org.n52.svalbard.decode.DecoderRepository)2 FieldDecoder (org.n52.svalbard.decode.json.FieldDecoder)2 InsertResultTemplateRequestDecoder (org.n52.svalbard.decode.json.InsertResultTemplateRequestDecoder)2 XmlOptions (org.apache.xmlbeans.XmlOptions)1 GmlDecoderv311 (org.n52.svalbard.decode.GmlDecoderv311)1 SensorMLDecoderV101 (org.n52.svalbard.decode.SensorMLDecoderV101)1 SweCommonDecoderV101 (org.n52.svalbard.decode.SweCommonDecoderV101)1 BatchRequestDecoder (org.n52.svalbard.decode.json.BatchRequestDecoder)1 InsertObservationRequestDecoder (org.n52.svalbard.decode.json.InsertObservationRequestDecoder)1 InsertResultRequestDecoder (org.n52.svalbard.decode.json.InsertResultRequestDecoder)1 InsertSensorRequestDecoder (org.n52.svalbard.decode.json.InsertSensorRequestDecoder)1 ObservationDecoder (org.n52.svalbard.decode.json.ObservationDecoder)1