Class ParametersTest
java.lang.Object
org.opentrafficsim.base.parameters.ParametersTest
- All Implemented Interfaces:
ConstraintInterface
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Field Summary
Fields inherited from interface org.opentrafficsim.base.parameters.constraint.ConstraintInterface
ATLEASTONE, NEGATIVE, NEGATIVEZERO, NONZERO, POSITIVE, POSITIVEZERO, UNITINTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidChecks whether default values are properly set, or not in case not given.final voidConstructor tests.final voidParameter value custom constraint tests.final voidParameter value default range tests.final voidDefaults tests.final voidTests equalizations.final voidTests the merging of parameter sets using setAll.final voidTests the set/reset mechanism.final voidTest that exceptions are thrown when trying to use null values.
-
Constructor Details
-
ParametersTest
public ParametersTest()
-
-
Method Details
-
defaultsTest
public final void defaultsTest()Defaults tests. -
constructorTest
public final void constructorTest()Constructor tests. -
defaultRangeTest
public final void defaultRangeTest()Parameter value default range tests. -
customConstraintTest
public final void customConstraintTest()Parameter value custom constraint tests. -
setResetTest
Tests the set/reset mechanism.- Throws:
ParameterException- Should not be thrown, is for untested methods (in this test) that throw the exception.
-
equalizeTest
Tests equalizations.- Throws:
ParameterException- Should not be thrown, is for untested methods (in this test) that throw the exception.
-
testNullNotAllowed
public final void testNullNotAllowed()Test that exceptions are thrown when trying to use null values. -
checkDefaultValues
public final void checkDefaultValues() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityExceptionChecks whether default values are properly set, or not in case not given.- Throws:
SecurityException- Reflection.NoSuchMethodException- Reflection.InvocationTargetException- Reflection.IllegalArgumentException- Reflection.IllegalAccessException- Reflection.InstantiationException- Reflection.
-
mergeTest
Tests the merging of parameter sets using setAll.- Throws:
ParameterException- parameter exception
-