org.apache.tapestry.test
Class Creator

java.lang.Object
  |
  +--org.apache.tapestry.test.Creator

public class Creator
extends java.lang.Object

A utility class that is used to instantiate abstract Tapestry pages and components. It creates, at runtime, a subclass where all abstract properties are filled in (complete with instance variable, accessor and mutator methods). This isn't the same as how the class is enhanced at runtime, but is sufficient to unit test the class, especially listener methods.

Since:
3.1
Author:
Howard Lewis Ship

Constructor Summary
Creator()
           
 
Method Summary
 java.lang.Object newInstance(java.lang.Class abstractClass)
          Given a particular abstract class; will create an instance of that class.
 java.lang.Object newInstance(java.lang.Class abstractClass, java.util.Map properties)
          Creates a new instance of a given class, and then initializes properties of the instance.
 java.lang.Object newInstance(java.lang.Class abstractClass, java.lang.Object[] properties)
          A convienience (useful in test code) for invoking newInstance(Class, Map).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Creator

public Creator()
Method Detail

newInstance

public java.lang.Object newInstance(java.lang.Class abstractClass)
Given a particular abstract class; will create an instance of that class. A subclass is created with all abstract properties filled in with ordinary implementations.


newInstance

public java.lang.Object newInstance(java.lang.Class abstractClass,
                                    java.util.Map properties)
Creates a new instance of a given class, and then initializes properties of the instance. The map contains string keys that are property names, and object values.


newInstance

public java.lang.Object newInstance(java.lang.Class abstractClass,
                                    java.lang.Object[] properties)
A convienience (useful in test code) for invoking newInstance(Class, Map). The Map is constructed from the properties array, which consists of alternating keys and values.