Package org.glassfish.tests.utils
Class ReflectionUtils
java.lang.Object
org.glassfish.tests.utils.ReflectionUtils
Deprecated.
Using reflection in tests is considered as bad practice. Use it only if you don't
have another option.
Utilities to create a configured Habitat and cache them
- Author:
- David Matejcek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TDeprecated.static <T> TDeprecated.static <T> TgetStaticField(Class<?> clazz, String fieldName) Deprecated.static voidDeprecated.Sets the field of the instance to the given value.static voidsetStaticField(Class<?> clazz, String fieldName, Object value) Deprecated.Sets the static field of the class to the given value.
-
Constructor Details
-
ReflectionUtils
public ReflectionUtils()Deprecated.
-
-
Method Details
-
setStaticField
Deprecated.Sets the static field of the class to the given value. -
getStaticField
Deprecated.- Type Parameters:
T- an expected assignable type of the field value.- Returns:
- a value of the static field of the clazz
-
setField
Deprecated.Sets the field of the instance to the given value. -
getField
Deprecated.- Type Parameters:
T- an expected assignable type of the field value.- Parameters:
fieldName- a field declared in the instance's class- Returns:
- a value of the field of the instance
-
getField
Deprecated.- Type Parameters:
T- an expected assignable type of the field value.- Parameters:
fieldName- a field declared in the ancestor of the instance- Returns:
- a value of the field of the instance
-