com.scooterframework.test
Class FunctionalTestHelper

java.lang.Object
  extended by com.scooterframework.test.FunctionalTestHelper

public class FunctionalTestHelper
extends java.lang.Object

FunctionalTestHelper class is super class of all functional test classes for an application. Scooter uses a real, not simulated, web server to run functional tests.

By default, Scooter starts an embedded web server for functional tests on port 8080. You can change the default testing server port or use an existing external server by specifying the system property appPort or webStarted respectively.

It is very easy to run functional tests with Scooter. Just run one of the following Ant commands:

Run blog application's functional tests on default port 8080:

 >ant app_test_functional -DappPath=webapps/blog
 

Run blog application's functional tests on port 9999:

 >ant app_test_functional -DappPath=webapps/blog -DappPort=9999
 

Run blog application's functional tests with an existing web server:

 >ant app_test_functional -DappPath=webapps/blog -DwebStarted=true
 


Field Summary
protected static ApplicationConfig ac
           
protected static java.lang.String contextName
           
protected static EnvConfig wc
           
 
Constructor Summary
FunctionalTestHelper()
           
 
Method Summary
protected static void assertRedirectSuccess(HTTPResponse response)
           
protected static void assertSuccess(HTTPResponse response)
           
protected  HTTPResponse fireHttpDeleteRequest(java.lang.String uri)
           
protected  HTTPResponse fireHttpGetRequest(java.lang.String uri)
           
protected  HTTPResponse fireHttpPostRequest(java.lang.String uri)
           
protected  HTTPResponse fireHttpPostRequest(java.lang.String uri, java.util.Map<java.lang.String,java.lang.String> params)
           
protected  HTTPResponse fireHttpPutRequest(java.lang.String uri)
           
protected  HTTPResponse fireHttpPutRequest(java.lang.String uri, java.util.Map<java.lang.String,java.lang.String> params)
           
 void refreshHttpConnection()
           
 void setUp()
           
static void setUpBeforeClass()
           
 void tearDown()
           
static void tearDownAfterClass()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ac

protected static ApplicationConfig ac

contextName

protected static java.lang.String contextName

wc

protected static EnvConfig wc
Constructor Detail

FunctionalTestHelper

public FunctionalTestHelper()
Method Detail

setUpBeforeClass

public static void setUpBeforeClass()

tearDownAfterClass

public static void tearDownAfterClass()

setUp

public void setUp()

tearDown

public void tearDown()

refreshHttpConnection

public void refreshHttpConnection()

fireHttpGetRequest

protected HTTPResponse fireHttpGetRequest(java.lang.String uri)

fireHttpPostRequest

protected HTTPResponse fireHttpPostRequest(java.lang.String uri)

fireHttpPostRequest

protected HTTPResponse fireHttpPostRequest(java.lang.String uri,
                                           java.util.Map<java.lang.String,java.lang.String> params)

fireHttpPutRequest

protected HTTPResponse fireHttpPutRequest(java.lang.String uri)

fireHttpPutRequest

protected HTTPResponse fireHttpPutRequest(java.lang.String uri,
                                          java.util.Map<java.lang.String,java.lang.String> params)

fireHttpDeleteRequest

protected HTTPResponse fireHttpDeleteRequest(java.lang.String uri)

assertSuccess

protected static void assertSuccess(HTTPResponse response)

assertRedirectSuccess

protected static void assertRedirectSuccess(HTTPResponse response)