Class LoopbackPortTestBench
java.lang.Object
org.refcodes.serial.LoopbackPortTestBench
- All Implemented Interfaces:
AutoCloseable, Openable, PortTestBench
-
Nested Class Summary
Nested classes/interfaces inherited from interface Openable
Openable.OpenAutomaton, Openable.OpenBuilder<B> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Retrieves the loopback's "receiver" port.Retrieves the loopback's "transmitter" port.booleanhasPorts()Tests whether a pair of loopback ports can be provided.voidopen()voidHeuristic (normal) wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).voidwaitForPortCatchUp(long aSleepTimeMillis) Custom wait time for the given implementsation's ports to catch up after issuing a specific port operation.voidHeuristic longest wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).voidHeuristic long wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).voidHeuristic shortest wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).voidHeuristic short wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).
-
Constructor Details
-
LoopbackPortTestBench
public LoopbackPortTestBench()Instantiates a new loopback port test bench.
-
-
Method Details
-
hasPorts
public boolean hasPorts()Tests whether a pair of loopback ports can be provided.- Specified by:
hasPortsin interfacePortTestBench- Returns:
- True in case there is a pair of corresponding ports.
-
getReceiverPort
Retrieves the loopback's "receiver" port.- Specified by:
getReceiverPortin interfacePortTestBench- Returns:
- The according receiver port.
- Throws:
IOException- thrown in case acquiring the port failed.
-
getTransmitterPort
Retrieves the loopback's "transmitter" port.- Specified by:
getTransmitterPortin interfacePortTestBench- Returns:
- The according transmitter port.
- Throws:
IOException- thrown in case acquiring the port failed.
-
open
- Specified by:
openin interfaceOpenable- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePortTestBench- Throws:
IOException
-
waitShortestForPortCatchUp
public void waitShortestForPortCatchUp()Heuristic shortest wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).- Specified by:
waitShortestForPortCatchUpin interfacePortTestBench
-
waitShortForPortCatchUp
public void waitShortForPortCatchUp()Heuristic short wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).- Specified by:
waitShortForPortCatchUpin interfacePortTestBench
-
waitForPortCatchUp
public void waitForPortCatchUp()Heuristic (normal) wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).- Specified by:
waitForPortCatchUpin interfacePortTestBench
-
waitLongForPortCatchUp
public void waitLongForPortCatchUp()Heuristic long wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).- Specified by:
waitLongForPortCatchUpin interfacePortTestBench
-
waitLongestForPortCatchUp
public void waitLongestForPortCatchUp()Heuristic longest wait time for the given implementsation's ports to catch up after issuing a specific port operation (the actual duration depends on the implementation's requirements).- Specified by:
waitLongestForPortCatchUpin interfacePortTestBench
-
waitForPortCatchUp
public void waitForPortCatchUp(long aSleepTimeMillis) Custom wait time for the given implementsation's ports to catch up after issuing a specific port operation.- Specified by:
waitForPortCatchUpin interfacePortTestBench- Parameters:
aSleepTimeMillis- The sleep time in milliseconds.
-