Search in sources :

Example 1 with SolarStatusPacket

use of me.retrodaredevil.solarthing.solar.SolarStatusPacket in project solarthing by wildmountainfarms.

the class RenogyTest method testRoverExisting.

@Test
void testRoverExisting() throws IOException {
    assertTrue(DIRECTORY_ROVER.isDirectory());
    ObjectMapper mapper = JacksonUtil.defaultMapper();
    for (File file : requireNonNull(DIRECTORY_ROVER.listFiles())) {
        SolarStatusPacket packet = mapper.readValue(file, SolarStatusPacket.class);
        assertTrue(packet instanceof RoverStatusPacket, "Got packet: " + packet);
    }
}
Also used : File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) SolarStatusPacket(me.retrodaredevil.solarthing.solar.SolarStatusPacket) Test(org.junit.jupiter.api.Test)

Example 2 with SolarStatusPacket

use of me.retrodaredevil.solarthing.solar.SolarStatusPacket in project solarthing by wildmountainfarms.

the class TracerTest method testTracerExisting.

@Test
void testTracerExisting() throws IOException {
    assertTrue(DIRECTORY_TRACER.isDirectory());
    ObjectMapper mapper = JacksonUtil.defaultMapper();
    for (File file : requireNonNull(DIRECTORY_TRACER.listFiles())) {
        SolarStatusPacket packet = mapper.readValue(file, SolarStatusPacket.class);
        assertTrue(packet instanceof TracerStatusPacket, "Got packet: " + packet);
    }
}
Also used : File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) SolarStatusPacket(me.retrodaredevil.solarthing.solar.SolarStatusPacket) Test(org.junit.jupiter.api.Test)

Example 3 with SolarStatusPacket

use of me.retrodaredevil.solarthing.solar.SolarStatusPacket in project solarthing by wildmountainfarms.

the class OutbackPacketsTest method testExistingPackets.

@Test
void testExistingPackets() throws IOException {
    assertTrue(DIRECTORY_FX.isDirectory());
    assertTrue(DIRECTORY_MX.isDirectory());
    ObjectMapper mapper = JacksonUtil.defaultMapper();
    for (File file : requireNonNull(DIRECTORY_FX.listFiles())) {
        SolarStatusPacket packet = mapper.readValue(file, SolarStatusPacket.class);
        assertTrue(packet instanceof FXStatusPacket);
    }
    for (File file : requireNonNull(DIRECTORY_MX.listFiles())) {
        SolarStatusPacket packet = mapper.readValue(file, SolarStatusPacket.class);
        assertTrue(packet instanceof MXStatusPacket);
    }
}
Also used : FXStatusPacket(me.retrodaredevil.solarthing.solar.outback.fx.FXStatusPacket) MXStatusPacket(me.retrodaredevil.solarthing.solar.outback.mx.MXStatusPacket) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) SolarStatusPacket(me.retrodaredevil.solarthing.solar.SolarStatusPacket) Test(org.junit.jupiter.api.Test)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 File (java.io.File)3 SolarStatusPacket (me.retrodaredevil.solarthing.solar.SolarStatusPacket)3 Test (org.junit.jupiter.api.Test)3 FXStatusPacket (me.retrodaredevil.solarthing.solar.outback.fx.FXStatusPacket)1 MXStatusPacket (me.retrodaredevil.solarthing.solar.outback.mx.MXStatusPacket)1