Class LaneTest

  • All Implemented Interfaces:
    UNITS

    public class LaneTest
    extends java.lang.Object
    implements UNITS
    Test the Lane class.

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

    $LastChangedDate: 2015-09-16 19:20:07 +0200 (Wed, 16 Sep 2015) $, @version $Revision: 1405 $, by $Author: averbraeck $, initial version 21 jan. 2015

    Author:
    Peter Knoppers
    • Constructor Detail

      • LaneTest

        public LaneTest()
    • Method Detail

      • laneConstructorTest

        public void laneConstructorTest()
                                 throws java.lang.Exception
        Test the constructor.
        Throws:
        java.lang.Exception - when something goes wrong (should not happen)
      • sensorTest

        public final void sensorTest​(Lane lane)
                              throws NetworkException
        Add/Remove some sensor to/from a lane and see if the expected events occur.
        Parameters:
        lane - Lane; the lane to manipulate
        Throws:
        NetworkException - when this happens uncaught; this test has failed
      • lateralOffsetTest

        public final void lateralOffsetTest()
                                     throws NetworkException,
                                            SimRuntimeException,
                                            javax.naming.NamingException,
                                            OTSGeometryException
        Test that gradually varying lateral offsets have gradually increasing angles (with respect to the design line) in the first half and gradually decreasing angles in the second half.
        Throws:
        NetworkException - when that happens uncaught; this test has failed
        javax.naming.NamingException - when that happens uncaught; this test has failed
        SimRuntimeException - when that happens uncaught; this test has failed
        OTSGeometryException - when that happens uncaught; this test has failed
      • contourTest

        public final void contourTest()
                               throws java.lang.Exception
        Test that the contour of a constructed lane covers the expected area. Tests are only performed for straight lanes, but the orientation of the link and the offset of the lane from the link is varied in many ways.
        Throws:
        java.lang.Exception - when something goes wrong (should not happen)