Package org.tudalgo.algoutils.reflect
Class TestUtils
java.lang.Object
org.tudalgo.algoutils.reflect.TestUtils
Deprecated, for removal: This API element is subject to removal in a future version.
A utility class used for JUnit tests which provides reflective access to some properties and
assertions.
This class is deprecated and will be removed in a future release.
Use the new API located in the
org.tudalgo.algoutils.tutor.general.reflections package instead.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertModifier(int expected, int actual, String name) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers are correct.static voidassertModifier(int expected, Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a class are correct.static voidassertModifier(int expected, Constructor<?> constructor) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a constructor are correct.static voidassertModifier(int expected, Field attribut) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a field are correct.static voidassertModifier(int expected, Method method) Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a method are correct.static inteditDistance(String s1, String s2) Deprecated, for removal: This API element is subject to removal in a future version.Calculates the similarity (a number within 0 and 1) between two strings.static Class<?>[]getClasses(String packageName) Deprecated, for removal: This API element is subject to removal in a future version.Scans all classes accessible from the context class loader which belong to the given package and subpackages.static booleanDeprecated, for removal: This API element is subject to removal in a future version.static doublesimilarity(String s1, String s2) Deprecated, for removal: This API element is subject to removal in a future version.Calculates the similarity (a number within 0 and 1) between two strings.
-
Field Details
-
BRIDGE
public static final int BRIDGEDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
VARARGS
public static final int VARARGSDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
SYNTHETIC
public static final int SYNTHETICDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
ANNOTATION
public static final int ANNOTATIONDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
ENUM
public static final int ENUMDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
MANDATED
public static final int MANDATEDDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Method Details
-
assertModifier
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers are correct.- Parameters:
expected- the expected modifier countactual- the actual modifier countname- the name of the field to be checked
-
assertModifier
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a class are correct.- Parameters:
expected- the expected modifier countclazz- the class to be checked
-
assertModifier
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a method are correct.- Parameters:
expected- the expected modifier countmethod- the method to be checked
-
assertModifier
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a constructor are correct.- Parameters:
expected- the expected modifier countconstructor- the constructor to be checked
-
assertModifier
Deprecated, for removal: This API element is subject to removal in a future version.Tests whether the modifiers of a field are correct.- Parameters:
expected- the expected modifier countattribut- the field to be checked
-
similarity
Deprecated, for removal: This API element is subject to removal in a future version.Calculates the similarity (a number within 0 and 1) between two strings.- Parameters:
s1- the first string used for the calculation of the similaritys2- the second string used for the calculation of the similarity- Returns:
- the similarity
-
editDistance
Deprecated, for removal: This API element is subject to removal in a future version.Calculates the similarity (a number within 0 and 1) between two strings.- Parameters:
s1- the first string used for the calculation of the similaritys2- the second string used for the calculation of the similarity- Returns:
- the calculated similarity (a number within 0 and 1) between two strings.
- See Also:
-
getClasses
Deprecated, for removal: This API element is subject to removal in a future version.Scans all classes accessible from the context class loader which belong to the given package and subpackages.- Parameters:
packageName- The base package name- Returns:
- the found classes
- Throws:
IOException- if an I/O Exception occurs
-
isAutograderRun
Deprecated, for removal: This API element is subject to removal in a future version.ReturnstrueifTestCycleResolver.getTestCycle()does not returnnull. This method is deprecated and will be removed in a future release. UseUtils.isJagrRun()instead.- Returns:
trueifTestCycleResolver.getTestCycle()does not returnnull
-