use of org.opensmartgridplatform.simulator.protocol.iec60870.domain.defaultcontrolledstation.DefaultControlledStationAsduFactory in project open-smart-grid-platform by OSGP.
the class ScenarioHooks method initMockServerDefaultControlledStation.
@Before("@Iec60870MockServerDefaultControlledStation")
public void initMockServerDefaultControlledStation() {
ScenarioContext.current().put(PROFILE, Iec60870ProfileType.DEFAULT_CONTROLLED_STATION);
final Iec60870AsduFactory factory = new DefaultControlledStationAsduFactory();
factory.setIec60870Server(this.mockServer.getRtuSimulator());
this.mockServer.addIec60870ASduHandler(ASduType.C_IC_NA_1, new Iec60870InterrogationCommandAsduHandler(factory));
}
use of org.opensmartgridplatform.simulator.protocol.iec60870.domain.defaultcontrolledstation.DefaultControlledStationAsduFactory in project open-smart-grid-platform by OSGP.
the class DefaultControlledStationAsduFactoryTest method testCreateSingleCommand.
@Test
void testCreateSingleCommand() {
// Arrange
final DefaultControlledStationAsduFactory defaultControlledAsduFactory = new DefaultControlledStationAsduFactory();
final ASdu expected = new ASdu(ASduType.C_SC_NA_1, false, CauseOfTransmission.SPONTANEOUS, false, false, 0, 1, new InformationObject[] { new InformationObject(0, this.informationElementFactory.createInformationElements(Iec60870InformationObjectType.QUALIFIER_OF_INTERROGATION, 20)) });
// Act
final ASdu actual = defaultControlledAsduFactory.createSingleCommandAsdu();
// Assert
assertThat(actual).usingRecursiveComparison().isEqualTo(expected);
}
Aggregations