use of org.apache.plc4x.java.spi.generation.ByteOrder in project plc4x by apache.
the class Testcase method run.
public void run() throws DriverTestsuiteException {
assert driverTestsuite != null;
LOGGER.info("Starting testcase: {}", name);
final PlcConnection plcConnection = connectionManager.getConnection(driverTestsuite.getDriverTestsuiteConfiguration().getDriverName(), driverTestsuite.getDriverTestsuiteConfiguration().getDriverParameters());
final Plc4xEmbeddedChannel embeddedChannel = connectionManager.getEmbeddedChannel(plcConnection);
final ByteOrder byteOrder = driverTestsuite.getDriverTestsuiteConfiguration().getByteOrder();
// Be sure this is reset, just in case a previous testcase failed.
synchronizer.responseFuture = null;
if (!driverTestsuite.getSetupSteps().isEmpty()) {
LOGGER.info("Running setup steps");
for (TestStep setupStep : driverTestsuite.getSetupSteps()) {
setupStep.execute(plcConnection, embeddedChannel, byteOrder);
}
LOGGER.info("Finished setup steps");
}
LOGGER.info("Running test steps");
for (TestStep step : steps) {
step.execute(plcConnection, embeddedChannel, byteOrder);
}
LOGGER.info("Finished test steps");
if (!driverTestsuite.getTeardownSteps().isEmpty()) {
LOGGER.info("Running teardown steps");
for (TestStep teardownStep : driverTestsuite.getTeardownSteps()) {
teardownStep.execute(plcConnection, embeddedChannel, byteOrder);
}
LOGGER.info("Finished teardown steps");
}
try {
plcConnection.close();
} catch (Exception e) {
LOGGER.warn("Error closing connection", e);
}
LOGGER.info("Finished testcase: {}", driverTestsuite.getName());
}
Aggregations