package org.opentrafficsim.road.network; import static org.junit.Assert.assertEquals; import org.djunits.unit.UNITS; import org.djunits.value.vdouble.scalar.Length; import org.junit.Test; import org.opentrafficsim.core.dsol.OTSSimulatorInterface; import org.opentrafficsim.core.geometry.OTSGeometryException; import org.opentrafficsim.core.geometry.OTSLine3D; import org.opentrafficsim.core.geometry.OTSPoint3D; import org.opentrafficsim.core.network.LinkLocation; import org.opentrafficsim.core.network.LinkType; import org.opentrafficsim.core.network.LongitudinalDirectionality; import org.opentrafficsim.core.network.Network; import org.opentrafficsim.core.network.NetworkException; import org.opentrafficsim.core.network.OTSNetwork; import org.opentrafficsim.core.network.OTSNode; import org.opentrafficsim.road.network.lane.CrossSectionLink; import org.opentrafficsim.road.network.lane.changing.LaneKeepingPolicy; import mockit.MockUp; /** * Test the LinkLocation class. *
* Copyright (c) 2013-2016 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 20 jan. 2015
* @author Peter Knoppers
*/
public class LinkLocationTest implements UNITS
{
/**
* Test constructor and verify all getters.
* @throws OTSGeometryException if that happens this test has failed
* @throws NetworkException if that happens this test has failed
*/
@Test
public void linkLocationTest() throws OTSGeometryException, NetworkException
{
// Preparations
Network network = new OTSNetwork("link location test network");
OTSNode nodeFrom = new OTSNode(network, "From", new OTSPoint3D(0, 0, 0));
OTSNode nodeTo = new OTSNode(network, "To", new OTSPoint3D(1000, 0, 0));
OTSLine3D line = new OTSLine3D(new OTSPoint3D[] { new OTSPoint3D(0, 0, 0), new OTSPoint3D(1000, 0, 0) });
OTSSimulatorInterface simulator = new MockUp