net.craftforge.essential.testsuite
Class ClientTest

java.lang.Object
  extended by net.craftforge.essential.testsuite.ClientTest

public abstract class ClientTest
extends Object

Provides a predefined client test with test suite using a local and an HTTP client.

Since:
07.07.11
Author:
Christian Bick

Constructor Summary
ClientTest()
           
 
Method Summary
protected  void configureHttpClient(String address, int port, String context)
          Configures the HTTP client.
protected  void configureLocalClient(String packagePath)
          Configures the local client.
protected  String getAddress()
          Gets the server address.
protected  String getAuthenticationProvider()
          Gets the controller's authentication provider.
protected  String getContext()
          Gets the server context.
protected  String getLoggingProvider()
          Gets the controller's logging provider.
protected  String getPackagePath()
          Gets the controller's package path.
protected  int getPort()
          Gets the server port.
protected  RequestTestSuite getTestSuite()
          Gets the test suite.
 void setUp()
          Initializes a test suite, using a local client and an HTTP client
 void testAuthentication()
          Tests a request with authorization.
 void testBasics()
          Tests a simple request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientTest

public ClientTest()
Method Detail

configureHttpClient

protected void configureHttpClient(String address,
                                   int port,
                                   String context)
Configures the HTTP client.

Parameters:
address - The server address.
port - The server port.
context - The server context

configureLocalClient

protected void configureLocalClient(String packagePath)
Configures the local client.

Parameters:
packagePath - The controller's package path.

getAddress

protected String getAddress()
Gets the server address.

Returns:
The server address

getPort

protected int getPort()
Gets the server port.

Returns:
The server port

getContext

protected String getContext()
Gets the server context.

Returns:
The server context

getPackagePath

protected String getPackagePath()
Gets the controller's package path.

Returns:
The controller's package path

getLoggingProvider

protected String getLoggingProvider()
Gets the controller's logging provider.

Returns:
The controller's logging provider

getAuthenticationProvider

protected String getAuthenticationProvider()
Gets the controller's authentication provider.

Returns:
The controller's authentication provider

getTestSuite

protected RequestTestSuite getTestSuite()
Gets the test suite.

Returns:
The test suite

setUp

public void setUp()
           throws Exception

Initializes a test suite, using a local client and an HTTP client

Throws:
Exception - if an unexpected exception occurs

testBasics

public void testBasics()
                throws Exception
Tests a simple request.

Throws:
Exception - if an unexpected exception occurs

testAuthentication

public void testAuthentication()
                        throws Exception
Tests a request with authorization.

Throws:
Exception - if an unexpected exception occurs


Copyright © 2011. All Rights Reserved.