nl.ivonet.beanunit
Class Asserter

java.lang.Object
  extended by nl.ivonet.beanunit.Asserter
Direct Known Subclasses:
BuilderBeanAsserter, ConstructorImmutableBeanAsserter, SimplePojoContractAsserter

public abstract class Asserter
extends java.lang.Object

Parent class for all Asserters. This class implements all the plumbing code to make the work of the other Asserters easier.

One can (de)register basic type arguments

Note that if used in a test with the Before annotation to register new type it is good practice to de-register them in the After annotation.

Author:
Ivo Woltring

Constructor Summary
Asserter()
           
 
Method Summary
static void deregisterType(java.lang.Class<?> type)
          Removes the specified type, so that there wil no longer be a default argument for the type.
static void registerTypeAndDefaultArgument(java.lang.Class<?> type, java.lang.Object defaultArgument)
          Registers the specified type that will default to the specified defaultArgument as the argument to setter methods.
static void resetToDefaultTypes()
          Resets the types and default arguments to the original list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asserter

public Asserter()
Method Detail

registerTypeAndDefaultArgument

public static void registerTypeAndDefaultArgument(java.lang.Class<?> type,
                                                  java.lang.Object defaultArgument)
Registers the specified type that will default to the specified defaultArgument as the argument to setter methods. Note this method will override any existing default arguments for a type.

Parameters:
type - the type to register
defaultArgument - the default argument to use in setters

deregisterType

public static void deregisterType(java.lang.Class<?> type)
Removes the specified type, so that there wil no longer be a default argument for the type.

Parameters:
type - the type to deregister.

resetToDefaultTypes

public static void resetToDefaultTypes()
Resets the types and default arguments to the original list.



Copyright © 2011 IvoNet. All Rights Reserved.