| java.lang.Object net.sourceforge.groboutils.junit.v1.AssertConstructor
AssertConstructor | public class AssertConstructor (Code) | | A set of assert methods that test a class for implementation of specific
constructor types.
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/02/10 22:52:19 $ since: July 21, 2002 |
Field Summary | |
final public static int | ANY_PROTECTION Bit-mask that allows the constructor to have any protection. | final public static int | PACKAGE Bit-mask that allows for the constructor to have package-private access. | final public static int | PRIVATE Bit-mask that allows for the constructor to have private access. | final public static int | PROTECTED Bit-mask that allows for the constructor to have protected access. | final public static int | PUBLIC Bit-mask that allows for the constructor to have public access. |
Method Summary | |
public static void | assertHasConstructor(String message, Class c, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: message - message that describes what failed if the assertionfails. Parameters: c - the class check for a constructor. Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(Class c, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(String message, Class c, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(Class c, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(String message, Object o, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(Object o, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(String message, Object o, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasConstructor(Object o, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasDefaultConstructor(String message, Class c) Ensures that the class c has a default (no-arg), public
constructor. | public static void | assertHasDefaultConstructor(Class c) Ensures that the class c has a default (no-arg), public
constructor. | public static void | assertHasDefaultConstructor(String message, Object o) Ensures that the class for object o has a default (no-arg),
public constructor. | public static void | assertHasDefaultConstructor(Object o) Ensures that the class for object o has a default (no-arg),
public constructor. | public static void | assertHasSameConstructor(String message, Class c, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(Class c, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(String message, Class c, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(Class c, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(String message, Object o, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(Object o, Class[] arguments, int protection) Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(String message, Object o, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static void | assertHasSameConstructor(Object o, Class[] arguments) Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static Constructor | getConstructor(Class c, Class[] arguments, int protection) Retrieves the first constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list, or null if
there is no such constructor.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. | public static Constructor | getSameConstructor(Class c, Class[] arguments, int protection) Retrieves the constructor in class c that
accepts the exact argument list given in arguments, or
null if there is no such constructor. | protected static boolean | hasCorrectProtection(Constructor cntr, int protection) | protected static boolean | isInheritedParameters(Constructor cntr, Class[] arguments) |
ANY_PROTECTION | final public static int ANY_PROTECTION(Code) | | Bit-mask that allows the constructor to have any protection.
|
PACKAGE | final public static int PACKAGE(Code) | | Bit-mask that allows for the constructor to have package-private access.
|
PRIVATE | final public static int PRIVATE(Code) | | Bit-mask that allows for the constructor to have private access.
|
PROTECTED | final public static int PROTECTED(Code) | | Bit-mask that allows for the constructor to have protected access.
|
PUBLIC | final public static int PUBLIC(Code) | | Bit-mask that allows for the constructor to have public access.
|
assertHasConstructor | public static void assertHasConstructor(String message, Class c, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: message - message that describes what failed if the assertionfails. Parameters: c - the class check for a constructor. Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasConstructor(String,Class,Class[]) See Also: AssertConstructor.assertHasConstructor(String,Object,Class[],int) See Also: AssertConstructor.assertHasSameConstructor(String,Class,Class[],int) |
assertHasConstructor | public static void assertHasConstructor(Class c, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasConstructor(Class,Class[]) See Also: AssertConstructor.assertHasConstructor(Object,Class[],int) See Also: AssertConstructor.assertHasSameConstructor(Class,Class[],int) |
assertHasConstructor | public static void assertHasConstructor(String message, Class c, Class[] arguments)(Code) | | Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). See Also: AssertConstructor.assertHasConstructor(String,Class,Class[],int) See Also: AssertConstructor.assertHasConstructor(String,Object,Class[]) See Also: AssertConstructor.assertHasSameConstructor(String,Class,Class[]) |
assertHasConstructor | public static void assertHasConstructor(String message, Object o, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasConstructor(String,Object,Class[]) See Also: AssertConstructor.assertHasConstructor(String,Class,Class[],int) See Also: AssertConstructor.assertHasSameConstructor(String,Object,Class[],int) |
assertHasConstructor | public static void assertHasConstructor(Object o, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasConstructor(Object,Class[]) See Also: AssertConstructor.assertHasConstructor(Class,Class[],int) See Also: AssertConstructor.assertHasSameConstructor(Object,Class[],int) |
assertHasConstructor | public static void assertHasConstructor(String message, Object o, Class[] arguments)(Code) | | Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). See Also: AssertConstructor.assertHasConstructor(String,Object,Class[],int) See Also: AssertConstructor.assertHasConstructor(String,Class,Class[]) See Also: AssertConstructor.assertHasSameConstructor(String,Object,Class[]) |
assertHasDefaultConstructor | public static void assertHasDefaultConstructor(String message, Class c)(Code) | | Ensures that the class c has a default (no-arg), public
constructor.
Parameters: message - message that describes what failed if the assertionfails. Parameters: c - the class check for a constructor. |
assertHasDefaultConstructor | public static void assertHasDefaultConstructor(Class c)(Code) | | Ensures that the class c has a default (no-arg), public
constructor.
Parameters: c - the class check for a constructor. |
assertHasDefaultConstructor | public static void assertHasDefaultConstructor(String message, Object o)(Code) | | Ensures that the class for object o has a default (no-arg),
public constructor.
Parameters: message - message that describes what failed if the assertionfails. Parameters: o - the object to check the class's constructor. |
assertHasDefaultConstructor | public static void assertHasDefaultConstructor(Object o)(Code) | | Ensures that the class for object o has a default (no-arg),
public constructor.
Parameters: o - the object to check the class's constructor. |
assertHasSameConstructor | public static void assertHasSameConstructor(String message, Class c, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasSameConstructor(String,Class,Class[]) See Also: AssertConstructor.assertHasSameConstructor(String,Object,Class[],int) See Also: AssertConstructor.assertHasConstructor(String,Class,Class[],int) |
assertHasSameConstructor | public static void assertHasSameConstructor(Class c, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasSameConstructor(Class,Class[]) See Also: AssertConstructor.assertHasSameConstructor(Object,Class[],int) See Also: AssertConstructor.assertHasConstructor(Class,Class[],int) |
assertHasSameConstructor | public static void assertHasSameConstructor(String message, Class c, Class[] arguments)(Code) | | Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). See Also: AssertConstructor.assertHasSameConstructor(String,Class,Class[],int) See Also: AssertConstructor.assertHasSameConstructor(String,Object,Class[]) See Also: AssertConstructor.assertHasConstructor(String,Class,Class[]) |
assertHasSameConstructor | public static void assertHasSameConstructor(String message, Object o, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasSameConstructor(String,Object,Class[]) See Also: AssertConstructor.assertHasSameConstructor(String,Class,Class[],int) See Also: AssertConstructor.assertHasConstructor(String,Object,Class[],int) |
assertHasSameConstructor | public static void assertHasSameConstructor(Object o, Class[] arguments, int protection)(Code) | | Ensures that there exists a constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.assertHasSameConstructor(Object,Class[]) See Also: AssertConstructor.assertHasSameConstructor(Class,Class[],int) See Also: AssertConstructor.assertHasConstructor(Object,Class[],int) |
assertHasSameConstructor | public static void assertHasSameConstructor(String message, Object o, Class[] arguments)(Code) | | Ensures that there exists a public constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). See Also: AssertConstructor.assertHasSameConstructor(String,Object,Class[],int) See Also: AssertConstructor.assertHasSameConstructor(String,Class,Class[]) See Also: AssertConstructor.assertHasConstructor(String,Object,Class[]) |
getConstructor | public static Constructor getConstructor(Class c, Class[] arguments, int protection)(Code) | | Retrieves the first constructor in class c that
accepts the same number of arguments given in arguments,
and that the constructor has the same class or an instance of the
class in each position of the argument list, or null if
there is no such constructor.
Parameters: arguments - list of classes which the constructor must haveas parameters, or subclasses of the arguments. A nullargument index indicates that any type is allowed (equivalentto specifying Object.class in the argument). Ifthe array is null, then the argument list will onlymatch the default (no-argument) constructor (which is thesame as setting arguments to new Class[0]). Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: AssertConstructor.getSameConstructor(Class,Class[],int) |
getSameConstructor | public static Constructor getSameConstructor(Class c, Class[] arguments, int protection)(Code) | | Retrieves the constructor in class c that
accepts the exact argument list given in arguments, or
null if there is no such constructor.
Parameters: protection - a bitwise ORed value containing one or more of theconstants PUBLIC, PROTECTED, PACKAGE,or PRIVATE. See Also: Class.getConstructor(Class[]) |
hasCorrectProtection | protected static boolean hasCorrectProtection(Constructor cntr, int protection)(Code) | | |
isInheritedParameters | protected static boolean isInheritedParameters(Constructor cntr, Class[] arguments)(Code) | | |
|
|