Interface PortTestBench

All Superinterfaces:
AutoCloseable, org.refcodes.component.Openable
All Known Implementing Classes:
LoopbackPortTestBench

public interface PortTestBench extends AutoCloseable, org.refcodes.component.Openable
The PortTestBench provides a test bench merely for diagnostic purposes. Test code using the PortTestBench can be tested against exchangeable implementation of the PortTestBench.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.component.Openable

    org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Port<?>
    Retrieves the loopback's "receiver" port.
    Port<?>
    Retrieves the loopback's "transmitter" port.
    boolean
    Tests whether a pair of loopback ports can be provided.
    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 interface org.refcodes.component.Openable

    open, openUnchecked
  • Method Details

    • hasPorts

      boolean hasPorts()
      Tests whether a pair of loopback ports can be provided.
      Returns:
      True in case there is a pair of corresponding ports.
    • getReceiverPort

      Port<?> getReceiverPort() throws IOException
      Retrieves the loopback's "receiver" port.
      Returns:
      The according receiver port.
      Throws:
      IOException - thrown in case acquiring the port failed.
      IllegalStateException - thrown case there is no such loopback port pair.
    • close

      void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • getTransmitterPort

      Port<?> getTransmitterPort() throws IOException
      Retrieves the loopback's "transmitter" port.
      Returns:
      The according transmitter port.
      Throws:
      IOException - thrown in case acquiring the port failed.
      IllegalStateException - thrown case there is no such loopback port pair.
    • waitShortestForPortCatchUp

      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).
    • waitShortForPortCatchUp

      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).
    • waitForPortCatchUp

      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).
    • waitLongForPortCatchUp

      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).
    • waitLongestForPortCatchUp

      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).
    • waitForPortCatchUp

      void waitForPortCatchUp(long aSleepTimeMillis)
      Custom wait time for the given implementsation's ports to catch up after issuing a specific port operation.
      Parameters:
      aSleepTimeMillis - The sleep time in milliseconds.