|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.testng.Assert
org.apache.tapestry.TestBase
org.apache.tapestry.BaseComponentTestCase
public class BaseComponentTestCase
Base class for testing components, or testing classes that operate on components. Simplifies creating much of the infrastructure around the components.
| Field Summary | |
|---|---|
protected CharArrayWriter |
_charArrayWriter
|
| Constructor Summary | |
|---|---|
BaseComponentTestCase()
|
|
| Method Summary | |
|---|---|
protected void |
assertBuffer(String expected)
|
protected void |
assertExceptionSubstring(Throwable t,
String msg)
|
static boolean |
assertListEquals(Object[] expected,
List actual)
|
static boolean |
assertListEquals(Object[] expected,
Object[] actual)
|
protected Registry |
buildFrameworkRegistry(ModuleDescriptorProvider customProvider)
Builds a registry, containing only the modules delivered by the specified ModuleDescriptorProvider, plus the master module descriptor
(i.e., those visible on the classpath). |
protected Registry |
buildFrameworkRegistry(String file)
Convienience method for invoking buildFrameworkRegistry(String[]) with only a single
file. |
protected Registry |
buildFrameworkRegistry(String[] files)
Builds a minimal registry, containing only the specified files, plus the master module descriptor (i.e., those visible on the classpath). |
protected Registry |
buildMinimalRegistry(Resource l)
Builds a registry from exactly the provided resource; this registry will not include the hivemind module. |
protected Location |
fabricateLocation(int line)
|
protected ClassResolver |
getClassResolver()
|
protected org.apache.tapestry.test.Creator |
getCreator()
|
protected Resource |
getResource(String file)
Returns the given file as a Resource from the classpath. |
protected org.apache.tapestry.IAsset |
newAsset()
|
protected org.apache.tapestry.IBinding |
newBinding()
|
protected org.apache.tapestry.IBinding |
newBinding(Location location)
|
protected org.apache.tapestry.IBinding |
newBinding(Object value)
|
protected org.apache.tapestry.IRender |
newBody()
|
protected org.apache.tapestry.json.IJSONWriter |
newBufferJSONWriter()
|
protected org.apache.tapestry.IMarkupWriter |
newBufferWriter()
|
protected org.apache.tapestry.IComponent |
newComponent()
|
protected org.apache.tapestry.IComponent |
newComponent(String extendedId,
Location location)
|
protected org.apache.tapestry.IRequestCycle |
newCycle()
|
protected org.apache.tapestry.IRequestCycle |
newCycle(boolean rewinding)
|
protected org.apache.tapestry.IRequestCycle |
newCycle(boolean rewinding,
boolean trainWriter)
|
protected org.apache.tapestry.IRequestCycle |
newCycle(boolean rewinding,
org.apache.tapestry.IMarkupWriter writer)
|
protected org.apache.tapestry.IRequestCycle |
newCycle(org.apache.tapestry.IMarkupWriter writer)
|
protected org.apache.tapestry.IRequestCycle |
newCycleGetPage(String pageName,
org.apache.tapestry.IPage page)
|
protected org.apache.tapestry.IRequestCycle |
newCycleGetParameter(String name,
String value)
|
protected org.apache.tapestry.IRequestCycle |
newCycleGetUniqueId(String id,
String uniqueId)
|
protected org.apache.tapestry.IEngine |
newEngine(ClassResolver resolver)
|
protected org.apache.tapestry.engine.IEngineService |
newEngineService()
|
protected org.apache.tapestry.IForm |
newForm()
|
protected Object |
newInstance(Class componentClass)
|
protected Object |
newInstance(Class componentClass,
String propertyName,
Object propertyValue)
|
protected org.apache.tapestry.engine.ILink |
newLink()
|
protected Location |
newLocation()
|
protected Log |
newLog()
|
protected org.apache.tapestry.NestedMarkupWriter |
newNestedWriter()
|
protected org.apache.tapestry.IPage |
newPage()
|
protected org.apache.tapestry.IPage |
newPage(String name)
|
protected org.apache.tapestry.IPage |
newPage(String name,
int count)
|
protected org.apache.tapestry.PageRenderSupport |
newPageRenderSupport()
|
protected org.apache.tapestry.IRender |
newRender()
|
protected org.apache.tapestry.web.WebRequest |
newRequest()
|
protected Resource |
newResource()
|
protected org.apache.tapestry.spec.IComponentSpecification |
newSpec()
|
protected org.apache.tapestry.spec.IComponentSpecification |
newSpec(String parameterName,
org.apache.tapestry.spec.IParameterSpecification pspec)
|
protected org.apache.tapestry.IMarkupWriter |
newWriter()
|
static void |
notEquals(Object expected,
Object actual)
|
protected void |
trainBuildURL(org.apache.tapestry.IAsset asset,
org.apache.tapestry.IRequestCycle cycle,
String URL)
|
protected void |
trainEncodeURL(org.apache.tapestry.IRequestCycle rc,
String URL,
String encodedURL)
|
protected void |
trainExtractBrowserEvent(org.apache.tapestry.IRequestCycle cycle)
|
protected void |
trainGetAttribute(org.apache.tapestry.IRequestCycle cycle,
String attributeName,
Object attribute)
|
protected void |
trainGetBinding(org.apache.tapestry.IComponent component,
String name,
org.apache.tapestry.IBinding binding)
|
protected void |
trainGetComponent(org.apache.tapestry.IComponent container,
String componentId,
org.apache.tapestry.IComponent containee)
|
protected void |
trainGetEngine(org.apache.tapestry.IPage page,
org.apache.tapestry.IEngine engine)
|
protected void |
trainGetEngine(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.IEngine engine)
|
protected void |
trainGetExtendedId(org.apache.tapestry.IComponent component,
String extendedId)
|
protected void |
trainGetId(org.apache.tapestry.IComponent component,
String id)
|
protected void |
trainGetIdPath(org.apache.tapestry.IComponent component,
String idPath)
|
protected void |
trainGetLink(org.apache.tapestry.engine.IEngineService service,
org.apache.tapestry.IRequestCycle cycle,
boolean post,
Object parameter,
org.apache.tapestry.engine.ILink link)
|
protected void |
trainGetLink(org.apache.tapestry.components.ILinkComponent component,
org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.engine.ILink link)
|
protected void |
trainGetLinkCheckIgnoreParameter(org.apache.tapestry.engine.IEngineService service,
org.apache.tapestry.IRequestCycle cycle,
boolean post,
Object parameter,
org.apache.tapestry.engine.ILink link)
|
protected void |
trainGetLocation(Locatable locatable,
Location location)
|
protected void |
trainGetNestedWriter(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.NestedMarkupWriter nested)
|
protected void |
trainGetPage(org.apache.tapestry.IComponent component,
org.apache.tapestry.IPage page)
|
protected void |
trainGetPageName(org.apache.tapestry.IPage page,
String pageName)
|
protected void |
trainGetPageRenderSupport(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.PageRenderSupport support)
|
protected void |
trainGetParameter(org.apache.tapestry.IRequestCycle cycle,
String name,
String value)
|
protected void |
trainGetParameterNames(org.apache.tapestry.engine.ILink link,
String[] names)
|
protected void |
trainGetParameterValues(org.apache.tapestry.engine.ILink link,
String parameterName,
String[] values)
|
protected void |
trainGetScheme(org.apache.tapestry.web.WebRequest request,
String scheme)
|
protected void |
trainGetServerName(org.apache.tapestry.web.WebRequest request,
String serverName)
|
protected void |
trainGetServerPort(org.apache.tapestry.web.WebRequest request,
int port)
|
protected void |
trainGetSpecification(org.apache.tapestry.IComponent component,
org.apache.tapestry.spec.IComponentSpecification spec)
|
protected void |
trainGetSupport(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.PageRenderSupport support)
|
protected void |
trainGetUniqueId(org.apache.tapestry.IRequestCycle cycle,
String id,
String uniqueId)
|
protected void |
trainGetURL(org.apache.tapestry.engine.ILink link,
String URL)
|
protected void |
trainGetURL(org.apache.tapestry.engine.ILink link,
String scheme,
String anchor,
String URL)
|
protected void |
trainGetURL(org.apache.tapestry.engine.ILink link,
String scheme,
String anchor,
String URL,
int port)
|
protected void |
trainIsRewinding(org.apache.tapestry.IRequestCycle cycle,
boolean rewinding)
|
protected void |
trainResponseBuilder(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.IMarkupWriter writer)
|
| Methods inherited from class org.apache.tapestry.TestBase |
|---|
cleanupControlSource, getMocksControl, newInstance, newMarkupWriter, newMock, newRequestCycle, replay, setReturnValue, setThrowable, unreachable, verify |
| Methods inherited from class org.testng.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsNoOrder, assertEqualsNoOrder, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CharArrayWriter _charArrayWriter
| Constructor Detail |
|---|
public BaseComponentTestCase()
| Method Detail |
|---|
protected org.apache.tapestry.test.Creator getCreator()
protected ClassResolver getClassResolver()
protected org.apache.tapestry.IMarkupWriter newBufferWriter()
protected org.apache.tapestry.json.IJSONWriter newBufferJSONWriter()
protected void assertBuffer(String expected)
protected void assertExceptionSubstring(Throwable t,
String msg)
protected Object newInstance(Class componentClass)
protected Object newInstance(Class componentClass,
String propertyName,
Object propertyValue)
protected org.apache.tapestry.IRequestCycle newCycle()
protected org.apache.tapestry.IRequestCycle newCycle(org.apache.tapestry.IMarkupWriter writer)
protected org.apache.tapestry.IRequestCycle newCycle(boolean rewinding)
protected org.apache.tapestry.IRequestCycle newCycle(boolean rewinding,
boolean trainWriter)
protected org.apache.tapestry.IRequestCycle newCycle(boolean rewinding,
org.apache.tapestry.IMarkupWriter writer)
protected void trainResponseBuilder(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.IMarkupWriter writer)
protected void trainIsRewinding(org.apache.tapestry.IRequestCycle cycle,
boolean rewinding)
protected org.apache.tapestry.IRequestCycle newCycleGetPage(String pageName,
org.apache.tapestry.IPage page)
protected org.apache.tapestry.IRequestCycle newCycleGetUniqueId(String id,
String uniqueId)
protected org.apache.tapestry.IRequestCycle newCycleGetParameter(String name,
String value)
protected org.apache.tapestry.IMarkupWriter newWriter()
protected org.apache.tapestry.IBinding newBinding(Object value)
protected org.apache.tapestry.IBinding newBinding(Location location)
protected org.apache.tapestry.IComponent newComponent(String extendedId,
Location location)
protected org.apache.tapestry.spec.IComponentSpecification newSpec(String parameterName,
org.apache.tapestry.spec.IParameterSpecification pspec)
protected org.apache.tapestry.IRender newRender()
protected org.apache.tapestry.IPage newPage()
protected org.apache.tapestry.IPage newPage(String name)
protected org.apache.tapestry.IPage newPage(String name,
int count)
protected org.apache.tapestry.IForm newForm()
protected org.apache.tapestry.IRender newBody()
protected org.apache.tapestry.PageRenderSupport newPageRenderSupport()
protected void trainGetSupport(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.PageRenderSupport support)
protected void trainGetAttribute(org.apache.tapestry.IRequestCycle cycle,
String attributeName,
Object attribute)
protected void trainGetUniqueId(org.apache.tapestry.IRequestCycle cycle,
String id,
String uniqueId)
protected void trainGetIdPath(org.apache.tapestry.IComponent component,
String idPath)
protected void trainGetParameter(org.apache.tapestry.IRequestCycle cycle,
String name,
String value)
protected void trainGetPageName(org.apache.tapestry.IPage page,
String pageName)
protected void trainBuildURL(org.apache.tapestry.IAsset asset,
org.apache.tapestry.IRequestCycle cycle,
String URL)
protected org.apache.tapestry.IAsset newAsset()
protected org.apache.tapestry.IEngine newEngine(ClassResolver resolver)
protected void trainGetEngine(org.apache.tapestry.IPage page,
org.apache.tapestry.IEngine engine)
protected org.apache.tapestry.IComponent newComponent()
protected void trainGetPage(org.apache.tapestry.IComponent component,
org.apache.tapestry.IPage page)
protected void trainGetExtendedId(org.apache.tapestry.IComponent component,
String extendedId)
protected void trainGetLocation(Locatable locatable,
Location location)
protected org.apache.tapestry.IBinding newBinding()
protected void trainGetComponent(org.apache.tapestry.IComponent container,
String componentId,
org.apache.tapestry.IComponent containee)
protected org.apache.tapestry.engine.IEngineService newEngineService()
protected void trainGetLink(org.apache.tapestry.engine.IEngineService service,
org.apache.tapestry.IRequestCycle cycle,
boolean post,
Object parameter,
org.apache.tapestry.engine.ILink link)
protected void trainGetLinkCheckIgnoreParameter(org.apache.tapestry.engine.IEngineService service,
org.apache.tapestry.IRequestCycle cycle,
boolean post,
Object parameter,
org.apache.tapestry.engine.ILink link)
protected void trainGetURL(org.apache.tapestry.engine.ILink link,
String URL)
protected void trainGetPageRenderSupport(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.PageRenderSupport support)
protected org.apache.tapestry.spec.IComponentSpecification newSpec()
protected Resource newResource()
protected org.apache.tapestry.web.WebRequest newRequest()
protected Location newLocation()
protected Location fabricateLocation(int line)
protected void trainEncodeURL(org.apache.tapestry.IRequestCycle rc,
String URL,
String encodedURL)
protected void trainGetServerPort(org.apache.tapestry.web.WebRequest request,
int port)
protected void trainGetServerName(org.apache.tapestry.web.WebRequest request,
String serverName)
protected void trainGetScheme(org.apache.tapestry.web.WebRequest request,
String scheme)
protected org.apache.tapestry.NestedMarkupWriter newNestedWriter()
protected void trainGetNestedWriter(org.apache.tapestry.IMarkupWriter writer,
org.apache.tapestry.NestedMarkupWriter nested)
protected void trainGetURL(org.apache.tapestry.engine.ILink link,
String scheme,
String anchor,
String URL)
protected void trainGetURL(org.apache.tapestry.engine.ILink link,
String scheme,
String anchor,
String URL,
int port)
protected org.apache.tapestry.engine.ILink newLink()
protected void trainGetLink(org.apache.tapestry.components.ILinkComponent component,
org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.engine.ILink link)
protected void trainGetEngine(org.apache.tapestry.IRequestCycle cycle,
org.apache.tapestry.IEngine engine)
protected void trainGetParameterValues(org.apache.tapestry.engine.ILink link,
String parameterName,
String[] values)
protected void trainGetParameterNames(org.apache.tapestry.engine.ILink link,
String[] names)
protected void trainGetSpecification(org.apache.tapestry.IComponent component,
org.apache.tapestry.spec.IComponentSpecification spec)
protected void trainGetBinding(org.apache.tapestry.IComponent component,
String name,
org.apache.tapestry.IBinding binding)
protected Log newLog()
protected void trainGetId(org.apache.tapestry.IComponent component,
String id)
protected void trainExtractBrowserEvent(org.apache.tapestry.IRequestCycle cycle)
protected Registry buildFrameworkRegistry(String file)
throws Exception
buildFrameworkRegistry(String[]) with only a single
file.
file - The path to the hivemind xml configuration file.
Exception - When file can't be found or parsed.
protected Registry buildFrameworkRegistry(String[] files)
throws Exception
files - The path to the hivemind xml configuration files to parse.
Exception - When file can't be found or parsed.protected Registry buildFrameworkRegistry(ModuleDescriptorProvider customProvider)
ModuleDescriptorProvider, plus the master module descriptor
(i.e., those visible on the classpath).
customProvider - The custom module provider that should be added to the configuration.
Registry.
protected Registry buildMinimalRegistry(Resource l)
throws Exception
hivemind module.
l - The resource to build the registry from.
Registry instance.
Exception - If error building registry.protected Resource getResource(String file)
Resource from the classpath. Typically, this is to find
files in the same folder as the invoking class.
file - Gets a resource object for the file representing the path specified.
Resource object.
public static boolean assertListEquals(Object[] expected,
Object[] actual)
public static boolean assertListEquals(Object[] expected,
List actual)
public static void notEquals(Object expected,
Object actual)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||