org.apache.tapestry.junit.mock
Class TestMockApplications

java.lang.Object
  extended by org.apache.tapestry.junit.mock.TestMockApplications

public class TestMockApplications
extends Object

A complex class that reads an XML description of a test involving the Mock objects and executes it, pretending to be a running servlet container.

The XML format is pretty simple, it contains declarations similar to a web.xml deployment descriptor, a description of the active HttpSession (if any), a description of the HttpRequest, and then a set of expectations for the output stream from the request.

Since:
2.2
Author:
Howard Lewis Ship

Field Summary
static String DEFAULT_BASE_DIR
           
static String LOGS_DIR
           
static String SCRIPTS_DIR
           
 
Constructor Summary
TestMockApplications()
           
 
Method Summary
 Object[][] createTestParameters()
           
static void deleteDir()
           
 void execute(String testRootDirectory, String path, String fileName)
          Invoked to execute the request cycle.
static String getBaseDirectory()
           
 MockContext getContext()
           
 MockRequest getRequest()
           
 MockResponse getResponse()
           
 ApplicationServlet getServlet()
           
 void tearDown()
          Closes System.out and System.err, then restores them to their original values.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGS_DIR

public static final String LOGS_DIR
See Also:
Constant Field Values

DEFAULT_BASE_DIR

public static final String DEFAULT_BASE_DIR
See Also:
Constant Field Values

SCRIPTS_DIR

public static final String SCRIPTS_DIR
See Also:
Constant Field Values
Constructor Detail

TestMockApplications

public TestMockApplications()
Method Detail

tearDown

public void tearDown()
              throws Exception
Closes System.out and System.err, then restores them to their original values.

Throws:
Exception

createTestParameters

public Object[][] createTestParameters()

toString

public String toString()
Overrides:
toString in class Object

execute

public void execute(String testRootDirectory,
                    String path,
                    String fileName)
             throws Exception
Invoked to execute the request cycle.

Throws:
Exception

getContext

public MockContext getContext()

getRequest

public MockRequest getRequest()

getResponse

public MockResponse getResponse()

getServlet

public ApplicationServlet getServlet()

deleteDir

public static void deleteDir()

getBaseDirectory

public static String getBaseDirectory()


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.