Search in sources :

Example 96 with Data

use of com.microsoft.applicationinsights.smoketest.schemav2.Data in project geotoolkit by Geomatys.

the class HTMLAdaptor method toWPS2Input.

@Override
public DataInput toWPS2Input(String candidate) throws UnconvertibleObjectException {
    final ComplexData cdt = new ComplexData();
    cdt.getContent().add(new org.geotoolkit.wps.xml.v200.Format(encoding, mimeType, schema, null));
    cdt.getContent().add(candidate);
    final Data data = new Data();
    data.getContent().add(cdt);
    final DataInput dit = new DataInput();
    dit.setData(data);
    return dit;
}
Also used : Format(org.geotoolkit.wps.xml.v200.Format) DataInput(org.geotoolkit.wps.xml.v200.DataInput) ComplexData(org.geotoolkit.wps.xml.v200.ComplexData) Data(org.geotoolkit.wps.xml.v200.Data) ComplexData(org.geotoolkit.wps.xml.v200.ComplexData)

Example 97 with Data

use of com.microsoft.applicationinsights.smoketest.schemav2.Data in project geotoolkit by Geomatys.

the class JSONAdaptor method toWPS2Input.

@Override
public DataInput toWPS2Input(TreeNode candidate) throws UnconvertibleObjectException {
    if (candidate instanceof ReferenceProxy)
        return super.toWPS2Input(candidate);
    final ComplexData cdt = new ComplexData();
    cdt.getContent().add(new org.geotoolkit.wps.xml.v200.Format(encoding, mimeType, schema, null));
    cdt.getContent().add(candidate);
    final Data data = new Data();
    data.getContent().add(cdt);
    final DataInput dit = new DataInput();
    dit.setData(data);
    return dit;
}
Also used : ReferenceProxy(org.geotoolkit.wps.xml.ReferenceProxy) Format(org.geotoolkit.wps.xml.v200.Format) DataInput(org.geotoolkit.wps.xml.v200.DataInput) ComplexData(org.geotoolkit.wps.xml.v200.ComplexData) Data(org.geotoolkit.wps.xml.v200.Data) ComplexData(org.geotoolkit.wps.xml.v200.ComplexData)

Example 98 with Data

use of com.microsoft.applicationinsights.smoketest.schemav2.Data in project geotoolkit by Geomatys.

the class KMLAdaptor method toWPS2Input.

@Override
public DataInput toWPS2Input(Path candidate) throws UnconvertibleObjectException {
    if (candidate instanceof ReferenceProxy)
        return super.toWPS2Input(candidate);
    final byte[] bytes;
    try {
        bytes = Files.readAllBytes(candidate);
    } catch (IOException ex) {
        throw new UnconvertibleObjectException(ex.getMessage(), ex);
    }
    final String cdata = new String(bytes, Charset.forName("UTF-8"));
    final DataInput dit = new DataInput();
    final Data data = new Data();
    data.getContent().add("<![CDATA[" + cdata + "]]>");
    dit.setData(data);
    return dit;
}
Also used : ReferenceProxy(org.geotoolkit.wps.xml.ReferenceProxy) DataInput(org.geotoolkit.wps.xml.v200.DataInput) UnconvertibleObjectException(org.apache.sis.util.UnconvertibleObjectException) Data(org.geotoolkit.wps.xml.v200.Data) IOException(java.io.IOException)

Example 99 with Data

use of com.microsoft.applicationinsights.smoketest.schemav2.Data in project geotoolkit by Geomatys.

the class LiteralAdaptor method toWPS2Input.

public DataInput toWPS2Input(Object candidate, boolean rawLiteral) {
    final Data data = new Data();
    final LiteralValue litValue = new LiteralValue();
    litValue.setDataType(WPSConvertersUtils.getDataTypeString("2.0.0", getValueClass()));
    litValue.setValue(String.valueOf(candidate));
    litValue.setUom(unit == null ? null : unit.getName());
    if (rawLiteral) {
        data.getContent().add(String.valueOf(candidate));
    } else {
        data.getContent().add(litValue);
    }
    final DataInput dit = new DataInput();
    dit.setData(data);
    return dit;
}
Also used : DataInput(org.geotoolkit.wps.xml.v200.DataInput) Data(org.geotoolkit.wps.xml.v200.Data) LiteralValue(org.geotoolkit.wps.xml.v200.LiteralValue)

Example 100 with Data

use of com.microsoft.applicationinsights.smoketest.schemav2.Data in project geotoolkit by Geomatys.

the class TextAdaptor method toWPS2Input.

@Override
public DataInput toWPS2Input(CharSequence candidate) throws UnconvertibleObjectException {
    if (candidate instanceof ReferenceProxy) {
        return super.toWPS2Input(candidate);
    }
    final ComplexData cdt = new ComplexData();
    cdt.getContent().add(new org.geotoolkit.wps.xml.v200.Format(encoding, mimeType, schema, null));
    cdt.getContent().add("<![CDATA[" + candidate + "]]>");
    final Data data = new Data();
    data.getContent().add(cdt);
    final DataInput dit = new DataInput();
    dit.setData(data);
    return dit;
}
Also used : ReferenceProxy(org.geotoolkit.wps.xml.ReferenceProxy) Format(org.geotoolkit.wps.xml.v200.Format) DataInput(org.geotoolkit.wps.xml.v200.DataInput) ComplexData(org.geotoolkit.wps.xml.v200.ComplexData) Data(org.geotoolkit.wps.xml.v200.Data) ComplexData(org.geotoolkit.wps.xml.v200.ComplexData)

Aggregations

Test (org.junit.Test)65 Envelope (com.microsoft.applicationinsights.smoketest.schemav2.Envelope)53 RequestData (com.microsoft.applicationinsights.smoketest.schemav2.RequestData)45 Data (org.geotoolkit.wps.xml.v200.Data)42 RemoteDependencyData (com.microsoft.applicationinsights.smoketest.schemav2.RemoteDependencyData)26 UnconvertibleObjectException (org.apache.sis.util.UnconvertibleObjectException)20 IOException (java.io.IOException)16 DataInput (org.geotoolkit.wps.xml.v200.DataInput)15 Format (org.geotoolkit.wps.xml.v200.Format)12 AiSmokeTest (com.microsoft.applicationinsights.smoketest.AiSmokeTest)10 TargetUri (com.microsoft.applicationinsights.smoketest.TargetUri)10 MessageData (com.microsoft.applicationinsights.smoketest.schemav2.MessageData)10 ComplexData (org.geotoolkit.wps.xml.v200.ComplexData)10 ExceptionData (com.microsoft.applicationinsights.smoketest.schemav2.ExceptionData)9 ReferenceProxy (org.geotoolkit.wps.xml.ReferenceProxy)9 Data (com.microsoft.applicationinsights.smoketest.schemav2.Data)8 DataStoreException (org.apache.sis.storage.DataStoreException)8 LiteralValue (org.geotoolkit.wps.xml.v200.LiteralValue)7 EventData (com.microsoft.applicationinsights.smoketest.schemav2.EventData)6 MetricData (com.microsoft.applicationinsights.smoketest.schemav2.MetricData)6