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

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

public class SlingTestBase
extends 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 String ADDITONAL_BUNDLES_PATH
           
static String ADMIN
           
static String BUNDLE_INSTALL_TIMEOUT_SECONDS
           
static String BUNDLE_TO_INSTALL_PREFIX
           
static String KEEP_JAR_RUNNING_PROP
           
static String SERVER_HOSTNAME_PROP
           
static String SERVER_READY_PROP_PREFIX
           
static String SERVER_READY_TIMEOUT_PROP
           
static String START_BUNDLES_TIMEOUT_SECONDS
           
static String TEST_SERVER_PASSWORD
           
static String TEST_SERVER_URL_PROP
           
static String TEST_SERVER_USERNAME
           
 
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  List<File> getBundlesToInstall(String additionalBundlesPath)
          Get the list of additional bundles to install, as specified by path parameter
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  String getServerBaseUrl()
          Start server if needed, and return its base URL
protected  String getServerPassword()
          Return password configured for execution of HTTP requests
protected  String getServerUsername()
          Return username configured for execution of HTTP requests
protected  WebconsoleClient getWebconsoleClient()
           
protected  void installAdditionalBundles()
           
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 String TEST_SERVER_URL_PROP
See Also:
Constant Field Values

TEST_SERVER_USERNAME

public static final String TEST_SERVER_USERNAME
See Also:
Constant Field Values

TEST_SERVER_PASSWORD

public static final String TEST_SERVER_PASSWORD
See Also:
Constant Field Values

SERVER_READY_TIMEOUT_PROP

public static final String SERVER_READY_TIMEOUT_PROP
See Also:
Constant Field Values

SERVER_READY_PROP_PREFIX

public static final String SERVER_READY_PROP_PREFIX
See Also:
Constant Field Values

KEEP_JAR_RUNNING_PROP

public static final String KEEP_JAR_RUNNING_PROP
See Also:
Constant Field Values

SERVER_HOSTNAME_PROP

public static final String SERVER_HOSTNAME_PROP
See Also:
Constant Field Values

ADDITONAL_BUNDLES_PATH

public static final String ADDITONAL_BUNDLES_PATH
See Also:
Constant Field Values

BUNDLE_TO_INSTALL_PREFIX

public static final String BUNDLE_TO_INSTALL_PREFIX
See Also:
Constant Field Values

START_BUNDLES_TIMEOUT_SECONDS

public static final String START_BUNDLES_TIMEOUT_SECONDS
See Also:
Constant Field Values

BUNDLE_INSTALL_TIMEOUT_SECONDS

public static final String BUNDLE_INSTALL_TIMEOUT_SECONDS
See Also:
Constant Field Values

ADMIN

public static final 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

installAdditionalBundles

protected void installAdditionalBundles()

getRequestBuilder

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


getServerBaseUrl

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


getServerUsername

protected String getServerUsername()
Return username configured for execution of HTTP requests


getServerPassword

protected String getServerPassword()
Return password configured for execution of HTTP requests


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 Exception
Check a number of server URLs for readyness

Throws:
Exception

getBundlesToInstall

protected List<File> getBundlesToInstall(String additionalBundlesPath)
Get the list of additional bundles to install, as specified by path parameter


isServerStartedByThisClass

protected boolean isServerStartedByThisClass()

getHttpClient

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

getRequestExecutor

protected RequestExecutor getRequestExecutor()

getWebconsoleClient

protected WebconsoleClient getWebconsoleClient()


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