Class MessageCaptor<T extends com.google.protobuf.Message>

java.lang.Object
org.yamcs.tests.MessageCaptor<T>

public class MessageCaptor<T extends com.google.protobuf.Message> extends Object
Utility class for queueing original messages as they are received from a subscription to Yamcs. This is intended for use in unit tests only.
  • Method Details

    • poll

      public T poll()
      Returns the next received message. Or null, if nothing was received yet.
    • poll

      public T poll(long timeout) throws InterruptedException
      Throws:
      InterruptedException
    • expectTimely

      public T expectTimely() throws InterruptedException, TimeoutException
      Throws:
      InterruptedException
      TimeoutException
    • clear

      public void clear()
    • isEmpty

      public boolean isEmpty()
      Returns true if there are not currently any unprocessed messages.
    • getPendingCount

      public int getPendingCount()
      Returns the number of unprocessed messages.
    • of

      public static <T extends com.google.protobuf.Message> MessageCaptor<T> of(org.yamcs.client.Subscription<?,T> subscription)