org.pentaho.test.platform.engine.core
Class BaseTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.pentaho.test.platform.engine.core.GenericPentahoTest
              extended by org.pentaho.test.platform.engine.core.BaseTest
All Implemented Interfaces:
junit.framework.Test, IActionCompleteListener, ILogger

public abstract class BaseTest
extends GenericPentahoTest
implements IActionCompleteListener, ILogger

A Base class for platform integration tests. Uses Spring to populate required PentahoSystem dependencies (admin plugins, system listeners, object factory, system settings, etc) and uses the StandaloneSpringPentahoObjectFactory as the object factory implementation. Also inits the system.


Field Summary
 
Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
 
Constructor Summary
BaseTest()
           
BaseTest(String arg0)
           
 
Method Summary
 void actionComplete(IRuntimeContext runtimeContext)
          Invoked when a Component execution has completed
 void debug(String message)
          Log a message object with the DEBUG Level.
 void debug(String message, Throwable error)
          Log a message with the DEBUG level including the stack trace of the Throwable error passed as parameter.
 void dispose()
           
 void error(String message)
          Log a message object with the ERROR Level.
 void error(String message, Throwable error)
          Log a message with the ERROR level including the stack trace of the Throwable error passed as parameter.
 void fatal(String message)
          Log a message object with the FATAL Level.
 void fatal(String message, Throwable error)
          Log a message with the FATAL level including the stack trace of the Throwable error passed as parameter.
 String getBaseUrl()
           
 int getLoggingLevel()
          Return the logging level for this Logger.
 List<String> getMessages()
           
 IOutputHandler getOutputHandler(IContentItem contentItem)
           
 IOutputHandler getOutputHandler(OutputStream stream)
           
 void info(String message)
          Log a message object with the INFO Level.
 void info(String message, Throwable error)
          Log a message with the INFO level including the stack trace of the Throwable error passed as parameter.
 IRuntimeContext run(ISolutionEngine solutionEngine, String solutionId, String path, String actionName, String instanceId, boolean persisted, IParameterProvider parameterProvider, IOutputHandler outputHandler)
           
 IRuntimeContext run(String solutionId, String path, String actionName)
           
 IRuntimeContext run(String solutionId, String path, String actionName, IParameterProvider parameterProvider)
           
 IRuntimeContext run(String solutionId, String path, String actionName, IParameterProvider parameterProvider, String testName, String fileExtension)
           
 IRuntimeContext run(String solutionId, String path, String actionName, String instanceId, boolean persisted, IParameterProvider parameterProvider, IOutputHandler outputHandler, IPentahoSession session)
           
 IPentahoSession sessionStartup(IPentahoSession session)
           
 void setLoggingLevel(int logLevel)
          Set the logging level for this Logger.
 void setUp()
           
static void shutdown()
           
 void tearDown()
           
 void trace(String message)
          Log a message object with the TRACE Level.
 void trace(String message, Throwable error)
          Log a message with the TRACE level including the stack trace of the Throwable error passed as parameter.
 void warn(String message)
          Log a message object with the WARN Level.
 void warn(String message, Throwable error)
          Log a message with the WARN level including the stack trace of the Throwable error passed as parameter.
 
Methods inherited from class org.pentaho.test.platform.engine.core.GenericPentahoTest
compare, getSolutionEngine, getSolutionPath
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseTest

public BaseTest(String arg0)

BaseTest

public BaseTest()
Method Detail

getMessages

public List<String> getMessages()

getBaseUrl

public String getBaseUrl()

setUp

public void setUp()
Overrides:
setUp in class junit.framework.TestCase

actionComplete

public void actionComplete(IRuntimeContext runtimeContext)
Description copied from interface: IActionCompleteListener
Invoked when a Component execution has completed

Specified by:
actionComplete in interface IActionCompleteListener
Parameters:
runtimeContext - the runtime context associated with this action

tearDown

public void tearDown()
Overrides:
tearDown in class junit.framework.TestCase

shutdown

public static void shutdown()

dispose

public void dispose()

run

public IRuntimeContext run(String solutionId,
                           String path,
                           String actionName)

run

public IRuntimeContext run(String solutionId,
                           String path,
                           String actionName,
                           IParameterProvider parameterProvider)

getOutputHandler

public IOutputHandler getOutputHandler(OutputStream stream)

getOutputHandler

public IOutputHandler getOutputHandler(IContentItem contentItem)

sessionStartup

public IPentahoSession sessionStartup(IPentahoSession session)

run

public IRuntimeContext run(String solutionId,
                           String path,
                           String actionName,
                           IParameterProvider parameterProvider,
                           String testName,
                           String fileExtension)

run

public IRuntimeContext run(String solutionId,
                           String path,
                           String actionName,
                           String instanceId,
                           boolean persisted,
                           IParameterProvider parameterProvider,
                           IOutputHandler outputHandler,
                           IPentahoSession session)

run

public IRuntimeContext run(ISolutionEngine solutionEngine,
                           String solutionId,
                           String path,
                           String actionName,
                           String instanceId,
                           boolean persisted,
                           IParameterProvider parameterProvider,
                           IOutputHandler outputHandler)

getLoggingLevel

public int getLoggingLevel()
Description copied from interface: ILogger
Return the logging level for this Logger.

Specified by:
getLoggingLevel in interface ILogger
Returns:
logging level

setLoggingLevel

public void setLoggingLevel(int logLevel)
Description copied from interface: ILogger
Set the logging level for this Logger.

Valid logging levels are TRACE, DEBUG, INFO, WARN, ERROR, and FATAL.

Specified by:
setLoggingLevel in interface ILogger

trace

public void trace(String message)
Description copied from interface: ILogger
Log a message object with the TRACE Level.

Specified by:
trace in interface ILogger
Parameters:
message - the message object to log.

debug

public void debug(String message)
Description copied from interface: ILogger
Log a message object with the DEBUG Level.

Specified by:
debug in interface ILogger
Parameters:
message - the message object to log.

info

public void info(String message)
Description copied from interface: ILogger
Log a message object with the INFO Level.

Specified by:
info in interface ILogger
Parameters:
message - the message object to log.

warn

public void warn(String message)
Description copied from interface: ILogger
Log a message object with the WARN Level.

Specified by:
warn in interface ILogger
Parameters:
message - the message object to log.

error

public void error(String message)
Description copied from interface: ILogger
Log a message object with the ERROR Level.

Specified by:
error in interface ILogger
Parameters:
message - the message object to log.

fatal

public void fatal(String message)
Description copied from interface: ILogger
Log a message object with the FATAL Level.

Specified by:
fatal in interface ILogger
Parameters:
message - the message object to log.

trace

public void trace(String message,
                  Throwable error)
Description copied from interface: ILogger
Log a message with the TRACE level including the stack trace of the Throwable error passed as parameter.

Specified by:
trace in interface ILogger
Parameters:
message - the message object to log.
error - the exception to log, including its stack trace.

debug

public void debug(String message,
                  Throwable error)
Description copied from interface: ILogger
Log a message with the DEBUG level including the stack trace of the Throwable error passed as parameter.

Specified by:
debug in interface ILogger
Parameters:
message - the message object to log.
error - the exception to log, including its stack trace.

info

public void info(String message,
                 Throwable error)
Description copied from interface: ILogger
Log a message with the INFO level including the stack trace of the Throwable error passed as parameter.

Specified by:
info in interface ILogger
Parameters:
message - the message object to log.
error - the exception to log, including its stack trace.

warn

public void warn(String message,
                 Throwable error)
Description copied from interface: ILogger
Log a message with the WARN level including the stack trace of the Throwable error passed as parameter.

Specified by:
warn in interface ILogger
Parameters:
message - the message object to log.
error - the exception to log, including its stack trace.

error

public void error(String message,
                  Throwable error)
Description copied from interface: ILogger
Log a message with the ERROR level including the stack trace of the Throwable error passed as parameter.

Specified by:
error in interface ILogger
Parameters:
message - the message object to log.
error - the exception to log, including its stack trace.

fatal

public void fatal(String message,
                  Throwable error)
Description copied from interface: ILogger
Log a message with the FATAL level including the stack trace of the Throwable error passed as parameter.

Specified by:
fatal in interface ILogger
Parameters:
message - the message object to log.
error - the exception to log, including its stack trace.