Search in sources :

Example 6 with BitmaskMeasurementElementDto

use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.

the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityAll.

@Test
public void testConvertIeSinglePointWithQualityAll() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_ALL);
    final IeSinglePointWithQuality source = new IeSinglePointWithQuality(true, true, true, true, true);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeSinglePointWithQuality(org.openmuc.j60870.ie.IeSinglePointWithQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 7 with BitmaskMeasurementElementDto

use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.

the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityBlocked.

@Test
public void testConvertIeSinglePointWithQualityBlocked() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_BLOCKED);
    final IeSinglePointWithQuality source = new IeSinglePointWithQuality(false, true, false, false, false);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeSinglePointWithQuality(org.openmuc.j60870.ie.IeSinglePointWithQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 8 with BitmaskMeasurementElementDto

use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.

the class IeQualityConverterTest method shouldConvertIeQualityNotTopicalToByte.

@Test
public void shouldConvertIeQualityNotTopicalToByte() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_NOT_TOPICAL);
    final IeQuality source = new IeQuality(false, false, false, true, false);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 9 with BitmaskMeasurementElementDto

use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.

the class IeQualityConverterTest method shouldConvertIeQualityInvalidToByte.

@Test
public void shouldConvertIeQualityInvalidToByte() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_INVALID);
    final IeQuality source = new IeQuality(false, false, false, false, true);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Example 10 with BitmaskMeasurementElementDto

use of org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto in project open-smart-grid-platform by OSGP.

the class IeQualityConverterTest method shouldConvertIeQualityOverflowToByte.

@Test
public void shouldConvertIeQualityOverflowToByte() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_OVERFLOW);
    final IeQuality source = new IeQuality(true, false, false, false, false);
    // Act
    final BitmaskMeasurementElementDto actual = this.converter.convert(source, null, null);
    // Assert
    assertThat(actual).isEqualTo(expected);
}
Also used : IeQuality(org.openmuc.j60870.ie.IeQuality) BitmaskMeasurementElementDto(org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto) Test(org.junit.jupiter.api.Test)

Aggregations

BitmaskMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)18 Test (org.junit.jupiter.api.Test)15 IeQuality (org.openmuc.j60870.ie.IeQuality)7 IeSinglePointWithQuality (org.openmuc.j60870.ie.IeSinglePointWithQuality)7 MeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementElementDto)3 MeasurementDto (org.opensmartgridplatform.dto.da.measurements.MeasurementDto)2 MeasurementGroupDto (org.opensmartgridplatform.dto.da.measurements.MeasurementGroupDto)2 ArrayList (java.util.ArrayList)1 BitmaskMeasurementElement (org.opensmartgridplatform.domain.da.measurements.elements.BitmaskMeasurementElement)1 FloatMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.FloatMeasurementElementDto)1 TimestampMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.TimestampMeasurementElementDto)1