Package c8y

Examples of c8y.SpeedMeasurement


       
        MeasurementValue sValue= new MeasurementValue();
        sValue.setValue(new BigDecimal(9.8));
        sValue.setUnit("m/s");

        measurement = new SpeedMeasurement();
        measurement.setMotion(mValue);
        measurement.setSpeed(sValue);
    }
View Full Code Here


    @Test
    public final void shouldSerializeAndDeserializeCorrectly() {

        String serialized = JSON.defaultJSON().forValue(measurement);
        SpeedMeasurement newMeasurement = JSONParser.defaultJSONParser().parse(SpeedMeasurement.class, serialized);
        assertTrue(serialized.contains("\"motionDetected\":"));    // According to wiki page
        assertTrue(serialized.contains("\"speed\":"));    // According to wiki page
        assertEquals(measurement.getSpeed().getValue(), newMeasurement.getSpeed().getValue());
        assertEquals(measurement.getMotion().getValue(), newMeasurement.getMotion().getValue());
    }
View Full Code Here

TOP

Related Classes of c8y.SpeedMeasurement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.