Class TransceiverTest
java.lang.Object
org.opentrafficsim.sim0mq.publisher.TransceiverTest
Unit tests.
Copyright (c) 2020-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Peter Knoppers
-
Method Summary
Modifier and TypeMethodDescriptionObject[]checkAckNack(TransceiverInterface transceiver, Object[] address, Boolean expectedAckNack, String expectedInPayload) Call the get method of a TransceiverInterface and verify most of the results.voidTest the GtuIdTransceiver and the GtuTransceiver.voidTest the constructResultFields method for a class that it cannot handle.voidTest the static verifyMetaData method in AbstractTransceiver.
-
Method Details
-
testGtuIdTransceiver
@Test public void testGtuIdTransceiver() throws RemoteException, Sim0MQException, SerializationException, NetworkException, OtsGeometryException, nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, GtuExceptionTest the GtuIdTransceiver and the GtuTransceiver.- Throws:
RemoteException- if the happens, this test has failedSerializationException- on errorSim0MQException- on errorNetworkException- on errorOtsGeometryException- on errorNamingException- on errornl.tudelft.simulation.dsol.SimRuntimeException- on errorGtuException- on error
-
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- the transceiver to testaddress- the argument of the get method of the transceiverexpectedAckNack- null if neither an ACK nor a NACK is expected, Boolean.FALSE if a NACK is expected, Boolean.TRUE if an ACK is expectedexpectedInPayload- text that should occur in the payload of the ACK or NACK, or null if no ACK or NACK is expected- Returns:
- 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 failedSim0MQException- if that happens, this test has failedRemoteException- if that happens, this test has failed
-
testNoTransceiver
Test the constructResultFields method for a class that it cannot handle. -
testVerifyMetaData
Test the static verifyMetaData method in AbstractTransceiver.
-