D - the internal data type of the connector under testpublic abstract class AbstractInformationModelConnectorTest<D> extends Object implements MachineCommandInputTranslator.InputCustomizer, MachineDataOutputTranslator.OutputCustomizer
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractInformationModelConnectorTest.Step |
| Modifier and Type | Field and Description |
|---|---|
private Class<? extends D> |
dataType |
private static org.slf4j.Logger |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractInformationModelConnectorTest(Class<? extends D> dataType)
Creates an instance and sets the internal data type.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
afterActions(de.iip_ecosphere.platform.connectors.Connector<D,Object,MachineData,MachineCommand> connector)
Do additional actions after testing.
|
protected abstract void |
assertAdditionalProperties(AbstractInformationModelConnectorTest.Step step,
MachineData received)
Asserts additional properties for the given step of testing.
|
protected void |
block(AtomicInteger count,
int receptions)
Blocks until a certain number of (accumulated) receptions is reached or fails after 4s.
|
protected abstract de.iip_ecosphere.platform.connectors.Connector<D,Object,MachineData,MachineCommand> |
createConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<D,Object,MachineData,MachineCommand> adapter)
Creates the connector to be tested.
|
protected abstract Class<? extends de.iip_ecosphere.platform.connectors.ConnectorDescriptor> |
getConnectorDescriptor()
Returns the connector descriptor for
createConnector(ProtocolAdapter). |
protected abstract de.iip_ecosphere.platform.connectors.ConnectorParameter |
getConnectorParameter()
Returns the connector parameters for
Connector.connect(ConnectorParameter). |
void |
testConnector(boolean withNotifications)
Tests the connector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadditionalFromActions, getQNameOperationStartMachine, getQNameOperationStopMachine, getQNameVarLotSize, getTopLevelModelPartNamegetQNameVarLotSize, getQNameVarPowerConsumption, getTopLevelModelPartName, getVendor, initializeModelAccessprotected abstract Class<? extends de.iip_ecosphere.platform.connectors.ConnectorDescriptor> getConnectorDescriptor()
createConnector(ProtocolAdapter).protected abstract void assertAdditionalProperties(AbstractInformationModelConnectorTest.Step step, MachineData received)
step - the testing stepreceived - the received machine data from the connectorprotected abstract void afterActions(de.iip_ecosphere.platform.connectors.Connector<D,Object,MachineData,MachineCommand> connector)
connector - the connector instanceprotected abstract de.iip_ecosphere.platform.connectors.Connector<D,Object,MachineData,MachineCommand> createConnector(de.iip_ecosphere.platform.connectors.types.ProtocolAdapter<D,Object,MachineData,MachineCommand> adapter)
adapter - the protocol adapter to useprotected abstract de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()
Connector.connect(ConnectorParameter).public void testConnector(boolean withNotifications)
throws IOException
withNotifications - operate with/without notifications (for testing)IOException - in case that creating the connector failsprotected void block(AtomicInteger count, int receptions)
count - the counterreceptions - the expected number of receptionsCopyright © 2022. All rights reserved.