Keel 2.1RC2

org.apache.commons.collections
Class BulkTestSuiteMaker

java.lang.Object
  extended byorg.apache.commons.collections.BulkTestSuiteMaker

class BulkTestSuiteMaker
extends java.lang.Object


Field Summary
private  java.util.List ignored
          List of ignored simple test names.
private  java.lang.String prefix
          The prefix for simple test methods.
private  junit.framework.TestSuite result
          The TestSuite we're currently populating.
private  java.lang.Class startingClass
          The class that defines simple and bulk tests methods.
 
Constructor Summary
BulkTestSuiteMaker(java.lang.Class startingClass)
          Constructor.
 
Method Summary
(package private)  void addBulk(BulkTest bulk, java.lang.reflect.Method m)
          Adds a whole new suite of tests that are defined by the result of the given bulk test method.
(package private)  void addTest(BulkTest bulk, java.lang.reflect.Method m)
          Adds the simple test defined by the given method to the TestSuite.
private static java.lang.String getBaseName(java.lang.Class c)
          Returns the base name of the given class.
private static java.lang.reflect.Constructor getTestCaseConstructor(java.lang.Class c)
           
private static boolean isBulk(java.lang.reflect.Method m)
          Returns true if the given method is a bulk test method.
private static boolean isTest(java.lang.reflect.Method m)
          Returns true if the given method is a simple test method.
 junit.framework.TestSuite make()
          Makes a hierarchal TestSuite based on the starting class.
(package private)  void make(BulkTest bulk)
          Appends all the simple tests and bulk tests defined by the given instance's class to the current TestSuite.
private static BulkTest makeFirstTestCase(java.lang.Class c)
           
private static BulkTest makeTestCase(java.lang.Class c, java.lang.reflect.Method m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startingClass

private java.lang.Class startingClass
The class that defines simple and bulk tests methods.


ignored

private java.util.List ignored
List of ignored simple test names.


result

private junit.framework.TestSuite result
The TestSuite we're currently populating. Can change over time.


prefix

private java.lang.String prefix
The prefix for simple test methods. Used to check if a test is in the ignored list.

Constructor Detail

BulkTestSuiteMaker

public BulkTestSuiteMaker(java.lang.Class startingClass)
Constructor.

Parameters:
startingClass - the starting class
Method Detail

make

public junit.framework.TestSuite make()
Makes a hierarchal TestSuite based on the starting class.

Returns:
the hierarchal TestSuite for startingClass

make

void make(BulkTest bulk)
Appends all the simple tests and bulk tests defined by the given instance's class to the current TestSuite.

Parameters:
bulk - An instance of the class that defines simple and bulk tests for us to append

addTest

void addTest(BulkTest bulk,
             java.lang.reflect.Method m)
Adds the simple test defined by the given method to the TestSuite.

Parameters:
bulk - The instance of the class that defined the method (I know it's wierd. But the point is, we can clone the instance and not have to worry about constructors.)
m - The simple test method

addBulk

void addBulk(BulkTest bulk,
             java.lang.reflect.Method m)
Adds a whole new suite of tests that are defined by the result of the given bulk test method. In other words, the given bulk test method is invoked, and the resulting BulkTest instance is examined for yet more simple and bulk tests.

Parameters:
bulk - The instance of the class that defined the method
m - The bulk test method

getBaseName

private static java.lang.String getBaseName(java.lang.Class c)
Returns the base name of the given class.

Parameters:
c - the class
Returns:
the name of that class, minus any package names

getTestCaseConstructor

private static java.lang.reflect.Constructor getTestCaseConstructor(java.lang.Class c)

makeTestCase

private static BulkTest makeTestCase(java.lang.Class c,
                                     java.lang.reflect.Method m)

makeFirstTestCase

private static BulkTest makeFirstTestCase(java.lang.Class c)

isTest

private static boolean isTest(java.lang.reflect.Method m)
Returns true if the given method is a simple test method.


isBulk

private static boolean isBulk(java.lang.reflect.Method m)
Returns true if the given method is a bulk test method.


Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.