Class TransceiverTest


  • public class TransceiverTest
    extends Object
    Unit tests.

    Copyright (c) 2020-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2020-02-13 11:08:16 +0100 (Thu, 13 Feb 2020) $, @version $Revision: 6383 $, by $Author: pknoppers $,

    Author:
    Peter Knoppers
    • Field Detail

      • lastAckNack

        Boolean lastAckNack
        Storage for the last ACK or NACK value submitted to the ReturnWrapper.
      • lastPayload

        Object[] lastPayload
        Storage for the last payload submitted to the ReturnWrapper.
      • lastContent

        Serializable lastContent
        Storage for last content submitted to notify method in EventListenerInterface.
      • lastTime

        Time lastTime
        Time stamp of last notify event.
    • Constructor Detail

      • TransceiverTest

        public TransceiverTest()
    • Method Detail

      • checkAckNack

        public Object[] checkAckNack​(TransceiverInterface transceiver,
                                     Object[] address,
                                     Boolean expectedAckNack,
                                     String expectedInPayload)
                              throws RemoteException,
                                     Sim0MQException,
                                     SerializationException
        Call the get method of a TransceiverInterface and verify most of the results.
        Parameters:
        transceiver - TransceiverInterface; the transceiver to test
        address - Object[]; the argument of the get method of the transceiver
        expectedAckNack - Boolean; null if neither an ACK nor a NACK is expected, Boolean.FALSE if a NACK is expected, Boolean.TRUE if an ACK is expected
        expectedInPayload - String; text that should occur in the payload of the ACK or NACK, or null if no ACK or NACK is expected
        Returns:
        Object[]; the result of the get method should be null if an ACK or a NACK was received; non-null otherwise
        Throws:
        SerializationException - if that happens, this test has failed
        Sim0MQException - if that happens, this test has failed
        RemoteException - if that happens, this test has failed
      • testNoTransceiver

        public void testNoTransceiver()
        Test the constructResultFields method for a class that it cannot handle.
      • testVerifyMetaData

        public void testVerifyMetaData()
        Test the static verifyMetaData method in AbstractTransceiver.