Modifier and Type | Method and Description |
---|---|
static void |
assertValue(String section,
Object value,
String methodName,
Object instance)
Checks the returned value, when calling a given method.
|
static javax.money.MonetaryAmount |
createAmountWithPrecision(int precision)
Creates an amount with the given precision.
|
static javax.money.MonetaryAmount |
createAmountWithScale(int scale)
Creates an amount with the given scale.
|
static BigDecimal |
createNumberWithPrecision(int precision)
Creates a new number with the given precision.
|
static BigDecimal |
createNumberWithScale(int scale)
Creates a corresponding number with the required scale.
|
static String |
getWarnings()
Get the collected WARNINGS.
|
static void |
resetWarnings()
Reset all collected WARNINGS.
|
static void |
testComparable(String section,
Class type)
Tests if the given type is comparable.
|
static void |
testHasNotPublicMethod(String section,
Class type,
Class returnType,
String name,
Class... paramTypes)
Tests if the given type has not a public method with the given signature.
|
static void |
testHasPublicMethod(String section,
Class type,
Class returnType,
String name,
Class... paramTypes)
Tests if the given type has a public method with the given signature.
|
static void |
testHasPublicStaticMethod(String section,
Class type,
Class returnType,
String name,
Class... paramTypes)
Tests if the given type has a public static method with the given signature.
|
static boolean |
testHasPublicStaticMethodOpt(String section,
Class type,
Class returnType,
String methodName,
Class... paramTypes)
Tests if instance has a pipublic static method.
|
static void |
testImmutable(String section,
Class c)
Tests the given class being immutable.
|
static boolean |
testImmutableOpt(String section,
Class type)
Test for immutability (optional recommendation), writes a warning if not given.
|
static void |
testImplementsInterface(String section,
Class type,
Class iface)
Tests the given class implements a given interface.
|
static void |
testSerializable(String section,
Class c)
Tests the given class being serializable.
|
static void |
testSerializable(String section,
Object o)
Tests the given object being (effectively) serializable by serializing it.
|
static boolean |
testSerializableOpt(String section,
Class type)
Test for serializable (optional recommendation), writes a warning if not given.
|
static boolean |
testSerializableOpt(String section,
Object instance)
Tests if an instance is effectively serializable.
|
public static BigDecimal createNumberWithPrecision(int precision)
precision
- the precisionpublic static BigDecimal createNumberWithScale(int scale)
scale
- the target scale.public static void testSerializable(String section, Class c)
section
- the section of the spec under testc
- the class to be checked.TCKValidationException
- if test fails.public static void testImmutable(String section, Class c)
section
- the section of the spec under testc
- the class to be checked.TCKValidationException
- if test fails.public static void testSerializable(String section, Object o)
section
- the section of the spec under testo
- the object to be checked.TCKValidationException
- if test fails.public static void testImplementsInterface(String section, Class type, Class iface)
section
- the section of the spec under testtype
- the type to be checked.iface
- the interface to be checked for.TCKValidationException
- if test fails.public static void testHasPublicMethod(String section, Class type, Class returnType, String name, Class... paramTypes)
section
- the section of the spec under testtype
- the type to be checked.returnType
- the method return type.name
- the method nameparamTypes
- the parametr types.TCKValidationException
- if test fails.public static void testHasPublicStaticMethod(String section, Class type, Class returnType, String name, Class... paramTypes)
section
- the section of the spec under testtype
- the type to be checked.returnType
- the method return type.name
- the method nameparamTypes
- the parametr types.TCKValidationException
- if test fails.public static void testHasNotPublicMethod(String section, Class type, Class returnType, String name, Class... paramTypes)
section
- the section of the spec under testtype
- the type to be checked.returnType
- the method return type.name
- the method nameparamTypes
- the parametr types.TCKValidationException
- if test fails.public static void testComparable(String section, Class type)
section
- the section of the spec under testtype
- the type to be checked.TCKValidationException
- if test fails.public static void assertValue(String section, Object value, String methodName, Object instance) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
section
- the section of the spec under testvalue
- the expected valuemethodName
- the target method nameinstance
- the instance to callNoSuchMethodException
SecurityException
IllegalAccessException
IllegalArgumentException
InvocationTargetException
TCKValidationException
- if test fails.public static boolean testImmutableOpt(String section, Class type)
section
- the section of the spec under testtype
- the type to be checked.public static boolean testSerializableOpt(String section, Class type)
section
- the section of the spec under testtype
- the type to be checked.public static boolean testHasPublicStaticMethodOpt(String section, Class type, Class returnType, String methodName, Class... paramTypes)
section
- the section of the spec under testtype
- the type to be checked.returnType
- the method return type.methodName
- the target method nameparamTypes
- the parametr types.public static boolean testSerializableOpt(String section, Object instance)
section
- the section of the spec under testinstance
- the instance to callpublic static void resetWarnings()
public static String getWarnings()
public static javax.money.MonetaryAmount createAmountWithScale(int scale)
scale
- the target scalepublic static javax.money.MonetaryAmount createAmountWithPrecision(int precision)
precision
- the target precisionCopyright © 2012-2015 JavaMoney. All Rights Reserved.