Class LoopbackPortTestBench

java.lang.Object
org.refcodes.serial.LoopbackPortTestBench
All Implemented Interfaces:
AutoCloseable, Openable, PortTestBench

public class LoopbackPortTestBench extends Object implements PortTestBench
The LoopbackPortTestBench implements the PortTestBench for the LoopbackPort type.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface Openable

    Openable.OpenAutomaton, Openable.OpenBuilder<B>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new loopback port test bench.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Retrieves the loopback's "receiver" port.
    Retrieves the loopback's "transmitter" port.
    boolean
    Tests whether a pair of loopback ports can be provided.
    void
    void
    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).
    void
    waitForPortCatchUp(long aSleepTimeMillis)
    Custom wait time for the given implementsation's ports to catch up after issuing a specific port operation.
    void
    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).
    void
    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).
    void
    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).
    void
    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).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      hasPorts in interface PortTestBench
      Returns:
      True in case there is a pair of corresponding ports.
    • getReceiverPort

      public LoopbackPort getReceiverPort() throws IOException
      Retrieves the loopback's "receiver" port.
      Specified by:
      getReceiverPort in interface PortTestBench
      Returns:
      The according receiver port.
      Throws:
      IOException - thrown in case acquiring the port failed.
    • getTransmitterPort

      public LoopbackPort getTransmitterPort() throws IOException
      Retrieves the loopback's "transmitter" port.
      Specified by:
      getTransmitterPort in interface PortTestBench
      Returns:
      The according transmitter port.
      Throws:
      IOException - thrown in case acquiring the port failed.
    • open

      public void open() throws IOException
      Specified by:
      open in interface Openable
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface PortTestBench
      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:
      waitShortestForPortCatchUp in interface PortTestBench
    • 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:
      waitShortForPortCatchUp in interface PortTestBench
    • 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:
      waitForPortCatchUp in interface PortTestBench
    • 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:
      waitLongForPortCatchUp in interface PortTestBench
    • 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:
      waitLongestForPortCatchUp in interface PortTestBench
    • 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:
      waitForPortCatchUp in interface PortTestBench
      Parameters:
      aSleepTimeMillis - The sleep time in milliseconds.