Class TransceiverTest


  • public class TransceiverTest
    extends java.lang.Object
    Unit tests.

    Copyright (c) 2020-2020 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
    • Constructor Summary

      Constructors 
      Constructor Description
      TransceiverTest()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] checkAckNack​(TransceiverInterface transceiver, java.lang.Object[] address, java.lang.Boolean expectedAckNack, java.lang.String expectedInPayload)
      Call the get method of a TransceiverInterface and verify most of the results.
      void testGTUIdTransceiver()
      Test the GTUIdTransceiver and the GTUTransceiver.
      void testNoTransceiver()
      Test the constructResultFields method for a class that it cannot handle.
      void testVerifyMetaData()
      Test the static verifyMetaData method in AbstractTransceiver.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TransceiverTest

        public TransceiverTest()
    • Method Detail

      • checkAckNack

        public java.lang.Object[] checkAckNack​(TransceiverInterface transceiver,
                                               java.lang.Object[] address,
                                               java.lang.Boolean expectedAckNack,
                                               java.lang.String expectedInPayload)
                                        throws java.rmi.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
        java.rmi.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.