Search in sources :

Example 1 with IeSinglePointWithQuality

use of org.openmuc.j60870.ie.IeSinglePointWithQuality in project open-smart-grid-platform by OSGP.

the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityOn.

@Test
public void testConvertIeSinglePointWithQualityOn() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_ON);
    final IeSinglePointWithQuality source = new IeSinglePointWithQuality(true, false, 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 2 with IeSinglePointWithQuality

use of org.openmuc.j60870.ie.IeSinglePointWithQuality in project open-smart-grid-platform by OSGP.

the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualityOff.

@Test
public void testConvertIeSinglePointWithQualityOff() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_OFF);
    final IeSinglePointWithQuality source = new IeSinglePointWithQuality(false, false, 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 3 with IeSinglePointWithQuality

use of org.openmuc.j60870.ie.IeSinglePointWithQuality in project open-smart-grid-platform by OSGP.

the class IeSinglePointWithQualityConverterTest method testConvertIeSinglePointWithQualitySubstituted.

@Test
public void testConvertIeSinglePointWithQualitySubstituted() {
    // Arrange
    final BitmaskMeasurementElementDto expected = new BitmaskMeasurementElementDto((byte) IE_QUALITY_SUBSTITUTED);
    final IeSinglePointWithQuality source = new IeSinglePointWithQuality(false, false, true, 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 4 with IeSinglePointWithQuality

use of org.openmuc.j60870.ie.IeSinglePointWithQuality 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 5 with IeSinglePointWithQuality

use of org.openmuc.j60870.ie.IeSinglePointWithQuality 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)

Aggregations

IeSinglePointWithQuality (org.openmuc.j60870.ie.IeSinglePointWithQuality)9 Test (org.junit.jupiter.api.Test)7 BitmaskMeasurementElementDto (org.opensmartgridplatform.dto.da.measurements.elements.BitmaskMeasurementElementDto)7 IeTime56 (org.openmuc.j60870.ie.IeTime56)2 When (io.cucumber.java.en.When)1 TimeZone (java.util.TimeZone)1 ASdu (org.openmuc.j60870.ASdu)1 InformationElement (org.openmuc.j60870.ie.InformationElement)1 InformationObject (org.openmuc.j60870.ie.InformationObject)1