org.apache.sling.testing.tools.sling
Class SlingTestBase

java.lang.Object
  extended by org.apache.sling.testing.tools.sling.SlingTestBase

public class SlingTestBase
extends java.lang.Object

Base class for running tests against a Sling instance, takes care of starting Sling and waiting for it to be ready.


Field Summary
static java.lang.String ADDITONAL_BUNDLES_PATH
           
static java.lang.String ADMIN
           
static java.lang.String BUNDLE_TO_INSTALL_PREFIX
           
static java.lang.String KEEP_JAR_RUNNING_PROP
           
static java.lang.String SERVER_HOSTNAME_PROP
           
static java.lang.String SERVER_READY_PROP_PREFIX
           
static java.lang.String SERVER_READY_TIMEOUT_PROP
           
static java.lang.String TEST_SERVER_URL_PROP
           
 
Constructor Summary
SlingTestBase()
          Get configuration but do not start server yet, that's done on demand
 
Method Summary
protected  void blockIfRequested()
          Optionally block here so that the runnable jar stays up - we can then run tests against it from another VM.
protected  org.apache.http.client.HttpClient getHttpClient()
           
protected  RequestBuilder getRequestBuilder()
          Start server if needed, and return a RequestBuilder that points to it
protected  RequestExecutor getRequestExecutor()
           
protected  java.lang.String getServerBaseUrl()
          Start server if needed, and return its base URL
protected  WebconsoleClient getWebconsoleClient()
           
protected  void installExtraBundles()
          Install all bundles found under our additional bundles path
protected  boolean isServerStartedByThisClass()
           
protected  void waitForServerReady()
          Check a number of server URLs for readyness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_SERVER_URL_PROP

public static final java.lang.String TEST_SERVER_URL_PROP
See Also:
Constant Field Values

SERVER_READY_TIMEOUT_PROP

public static final java.lang.String SERVER_READY_TIMEOUT_PROP
See Also:
Constant Field Values

SERVER_READY_PROP_PREFIX

public static final java.lang.String SERVER_READY_PROP_PREFIX
See Also:
Constant Field Values

KEEP_JAR_RUNNING_PROP

public static final java.lang.String KEEP_JAR_RUNNING_PROP
See Also:
Constant Field Values

SERVER_HOSTNAME_PROP

public static final java.lang.String SERVER_HOSTNAME_PROP
See Also:
Constant Field Values

ADDITONAL_BUNDLES_PATH

public static final java.lang.String ADDITONAL_BUNDLES_PATH
See Also:
Constant Field Values

BUNDLE_TO_INSTALL_PREFIX

public static final java.lang.String BUNDLE_TO_INSTALL_PREFIX
See Also:
Constant Field Values

ADMIN

public static final java.lang.String ADMIN
See Also:
Constant Field Values
Constructor Detail

SlingTestBase

public SlingTestBase()
Get configuration but do not start server yet, that's done on demand

Method Detail

getRequestBuilder

protected RequestBuilder getRequestBuilder()
Start server if needed, and return a RequestBuilder that points to it


getServerBaseUrl

protected java.lang.String getServerBaseUrl()
Start server if needed, and return its base URL


blockIfRequested

protected void blockIfRequested()
Optionally block here so that the runnable jar stays up - we can then run tests against it from another VM.


waitForServerReady

protected void waitForServerReady()
                           throws java.lang.Exception
Check a number of server URLs for readyness

Throws:
java.lang.Exception

installExtraBundles

protected void installExtraBundles()
                            throws java.lang.Exception
Install all bundles found under our additional bundles path

Throws:
java.lang.Exception

isServerStartedByThisClass

protected boolean isServerStartedByThisClass()

getHttpClient

protected org.apache.http.client.HttpClient getHttpClient()

getRequestExecutor

protected RequestExecutor getRequestExecutor()

getWebconsoleClient

protected WebconsoleClient getWebconsoleClient()


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.