jbeantester.framework
Class JBeanTestResults

java.lang.Object
  |
  +--jbeantester.framework.JBeanTestResults

public class JBeanTestResults
extends Object

This object is returned from the test methods of JBeanTester. When returned, they are already populated with all of the raw data from the tests. The class also contains a number of 'convenience' methods which process/analyse this data.


Field Summary
protected  List equalsMPassed
          The properties that passed the test of algorithmic equality.
protected  List equalsPassed
          The properties that passed the test of native (==) equality.
protected  List inputs
          The inputs used in tests.
static JBeanTestResults NO_DFLT_CONSTRUCTOR
          This instance is returned when no default constructor is available.
static JBeanTestResults NO_SUCH_CONSTRUCTOR
          This instance is returned when a specified constructor does not exist.
protected  int numPassedEquals
          The number of properties that passed the test of native (==) equality.
protected  int numPassedEqualsM
          The number of properties that passed the test of algorithmic equality.
protected  List outputs
          The outputs used in tests.
protected  List properties
          The properties found and tested.
protected  HashMap propertyToIndex
          Map of properties to their respective index.
 
Constructor Summary
protected JBeanTestResults(List properties, List inputs, List outputs)
          Construct an object to contain a set of JavaBean test results.
 
Method Summary
 boolean getAllPassedEquals()
          Determine if all of the properties passed the (==) test.
 boolean getAllPassedEqualsM()
          Determine if all of the properties passed the (.equals( )) test.
 boolean getEqualsMPassed(int index)
          Gets the value of the specified equalsMPassed.
 boolean getEqualsPassed(int index)
          Gets the value of the specified equalsPassed.
 int getIndexForProperty(String propName)
          Obtain the location of the specified property within the result.
 Object getInput(int index)
          Gets the value of the specified input.
 int getNumPassedEquals()
          Determine the number of properties that passed the native equality (==) test.
 int getNumPassedEqualsM()
          Determine the number of properties that passed the algorithmic equality (.equals( )) test.
 int getNumPropsTested()
          Determine the number of properties that were tested.
 Object getOutput(int index)
          Gets the value of the specified output.
 String getProperty(int index)
          Gets the value of the specified property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_SUCH_CONSTRUCTOR

public static final JBeanTestResults NO_SUCH_CONSTRUCTOR
This instance is returned when a specified constructor does not exist. Any attempt to invoke a method on this instance will result in UnsupportedThrowableException.


NO_DFLT_CONSTRUCTOR

public static final JBeanTestResults NO_DFLT_CONSTRUCTOR
This instance is returned when no default constructor is available. The lack of a default constructor renders a class invalid as a JavaBean and prevents the execution of some test methods. Any attempt to invoke a method on this instance will result in UnsupportedThrowableException.


properties

protected final List properties
The properties found and tested.


inputs

protected final List inputs
The inputs used in tests.


outputs

protected final List outputs
The outputs used in tests.


equalsPassed

protected final List equalsPassed
The properties that passed the test of native (==) equality.


equalsMPassed

protected final List equalsMPassed
The properties that passed the test of algorithmic equality.


numPassedEquals

protected int numPassedEquals
The number of properties that passed the test of native (==) equality.


numPassedEqualsM

protected int numPassedEqualsM
The number of properties that passed the test of algorithmic equality.


propertyToIndex

protected final HashMap propertyToIndex
Map of properties to their respective index.

Constructor Detail

JBeanTestResults

protected JBeanTestResults(List properties,
                           List inputs,
                           List outputs)
Construct an object to contain a set of JavaBean test results. This Object is initialised with all of it's data -- each in its own correlated set.

Parameters:
properties - a list of the String names of the properties.
inputs - a list of the input objects.
outputs - a list of the output objects.
Method Detail

getNumPropsTested

public int getNumPropsTested()
Determine the number of properties that were tested.

Returns:
the number of properties that were tested.

getIndexForProperty

public int getIndexForProperty(String propName)
Obtain the location of the specified property within the result.

Parameters:
propName - the property to look for.
Returns:
the location of the property; -1 if not found.

getAllPassedEquals

public boolean getAllPassedEquals()
Determine if all of the properties passed the (==) test. This test is unlikely to pass as properties requiring primitive data types as parameters will fail.

Returns:
the number of properties that passed.

getAllPassedEqualsM

public boolean getAllPassedEqualsM()
Determine if all of the properties passed the (.equals( )) test. This test should return true on a properly formed JavaBean.

Returns:
the number of properties that passed.

getNumPassedEquals

public int getNumPassedEquals()
Determine the number of properties that passed the native equality (==) test.

Returns:
the number of properties that passed.

getNumPassedEqualsM

public int getNumPassedEqualsM()
Determine the number of properties that passed the algorithmic equality (.equals( )) test.

Returns:
the number of properties that passed.

getProperty

public String getProperty(int index)
Gets the value of the specified property.

Parameters:
index - the location of the element.
Returns:
the value of properties.

getInput

public Object getInput(int index)
Gets the value of the specified input.

Returns:
the value of inputs.

getOutput

public Object getOutput(int index)
Gets the value of the specified output.

Parameters:
index - the location of the element.
Returns:
the value of outputs.

getEqualsPassed

public boolean getEqualsPassed(int index)
Gets the value of the specified equalsPassed. This indicates whether or not the corresponding input and output passed the native equality (==) test.

Parameters:
index - the location of the element.
Returns:
the value of equalsPassed.

getEqualsMPassed

public boolean getEqualsMPassed(int index)
Gets the value of the specified equalsMPassed. This indicates whether or not the corresponding input and output passed the algorithmic equality (.equals( )) test.

Parameters:
index - the location of the element.
Returns:
the value of equalsMPassed.