Search in sources :

Example 1 with AmrProfileStatusCodeHelper

use of org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.AmrProfileStatusCodeHelper in project open-smart-grid-platform by OSGP.

the class GetPeriodicMeterReadsCommandExecutorIntegrationTest method setUp.

@BeforeEach
public void setUp() {
    final TimeZone defaultTimeZone = TimeZone.getDefault();
    final DateTimeZone defaultDateTimeZone = DateTimeZone.getDefault();
    // all time based tests must use UTC time.
    TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
    DateTimeZone.setDefault(DateTimeZone.UTC);
    this.initDates();
    this.dlmsHelper = new DlmsHelper();
    this.amrProfileStatusCodeHelper = new AmrProfileStatusCodeHelper();
    final DlmsObjectConfigConfiguration dlmsObjectConfigConfiguration = new DlmsObjectConfigConfiguration();
    this.dlmsObjectConfigService = new DlmsObjectConfigService(this.dlmsHelper, dlmsObjectConfigConfiguration.getDlmsObjectConfigs());
    this.executor = new GetPeriodicMeterReadsCommandExecutor(this.dlmsHelper, this.amrProfileStatusCodeHelper, this.dlmsObjectConfigService);
    this.connectionStub = new DlmsConnectionStub();
    this.connectionManagerStub = new DlmsConnectionManagerStub(this.connectionStub);
    this.connectionStub.setDefaultReturnValue(DataObject.newArrayData(Collections.emptyList()));
    // reset to original TimeZone
    TimeZone.setDefault(defaultTimeZone);
    DateTimeZone.setDefault(defaultDateTimeZone);
}
Also used : DlmsHelper(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.DlmsHelper) DlmsObjectConfigConfiguration(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.DlmsObjectConfigConfiguration) DateTimeZone(org.joda.time.DateTimeZone) TimeZone(java.util.TimeZone) DlmsObjectConfigService(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.DlmsObjectConfigService) DlmsConnectionManagerStub(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.stub.DlmsConnectionManagerStub) AmrProfileStatusCodeHelper(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.AmrProfileStatusCodeHelper) DlmsConnectionStub(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.stub.DlmsConnectionStub) DateTimeZone(org.joda.time.DateTimeZone) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with AmrProfileStatusCodeHelper

use of org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.AmrProfileStatusCodeHelper in project open-smart-grid-platform by OSGP.

the class GetPeriodicMeterReadsGasCommandExecutorIntegrationTest method setUp.

@BeforeEach
public void setUp() {
    final TimeZone defaultTimeZone = TimeZone.getDefault();
    final DateTimeZone defaultDateTimeZone = DateTimeZone.getDefault();
    // all time based tests must use UTC time.
    TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
    DateTimeZone.setDefault(DateTimeZone.UTC);
    this.initDates();
    this.dlmsHelper = new DlmsHelper();
    this.amrProfileStatusCodeHelper = new AmrProfileStatusCodeHelper();
    final DlmsObjectConfigConfiguration dlmsObjectConfigConfiguration = new DlmsObjectConfigConfiguration();
    this.dlmsObjectConfigService = new DlmsObjectConfigService(this.dlmsHelper, dlmsObjectConfigConfiguration.getDlmsObjectConfigs());
    this.executor = new GetPeriodicMeterReadsGasCommandExecutor(this.dlmsHelper, this.amrProfileStatusCodeHelper, this.dlmsObjectConfigService);
    this.connectionStub = new DlmsConnectionStub();
    this.connectionManagerStub = new DlmsConnectionManagerStub(this.connectionStub);
    this.connectionStub.setDefaultReturnValue(DataObject.newArrayData(Collections.emptyList()));
    // reset to original TimeZone
    TimeZone.setDefault(defaultTimeZone);
    DateTimeZone.setDefault(defaultDateTimeZone);
}
Also used : DlmsHelper(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.DlmsHelper) DlmsObjectConfigConfiguration(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.DlmsObjectConfigConfiguration) DateTimeZone(org.joda.time.DateTimeZone) TimeZone(java.util.TimeZone) DlmsObjectConfigService(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.DlmsObjectConfigService) DlmsConnectionManagerStub(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.stub.DlmsConnectionManagerStub) AmrProfileStatusCodeHelper(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.AmrProfileStatusCodeHelper) DlmsConnectionStub(org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.stub.DlmsConnectionStub) DateTimeZone(org.joda.time.DateTimeZone) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

TimeZone (java.util.TimeZone)2 DateTimeZone (org.joda.time.DateTimeZone)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 DlmsObjectConfigConfiguration (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.DlmsObjectConfigConfiguration)2 DlmsObjectConfigService (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.dlmsobjectconfig.DlmsObjectConfigService)2 DlmsConnectionManagerStub (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.stub.DlmsConnectionManagerStub)2 DlmsConnectionStub (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.stub.DlmsConnectionStub)2 AmrProfileStatusCodeHelper (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.AmrProfileStatusCodeHelper)2 DlmsHelper (org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.DlmsHelper)2