org.jboss.test
Class AbstractTestDelegate

java.lang.Object
  extended by org.jboss.test.AbstractTestDelegate
Direct Known Subclasses:
JBossTestServices

public class AbstractTestDelegate
extends Object

An AbstractTestDelegate.

Version:
$Revision: 62656 $
Author:
Adrian Brock

Field Summary
protected  Class clazz
          The class
 boolean enableSecurity
          Whether security is enabled
protected  org.jboss.logging.Logger log
          The log
protected  LoggingPlugin logging
          The logging plugin
protected  PolicyPlugin policy
          The policy plugin
 String securityPolicyName
          The security policy name
 
Constructor Summary
AbstractTestDelegate(Class clazz)
          Create a new test delegate
 
Method Summary
protected  void enableTrace(String name)
          Enable trace
protected static AbstractTestDelegate getDelegate(Class clazz)
          Get the test delegate.
protected  org.jboss.logging.Logger getLog()
          Get the log
protected  void log(String context)
          Log an event with the given context
 void setUp()
          Setup callback.
 void setUpLogging()
          Setup the logging
protected  void setUpSecurity()
          Setup the security
 void tearDown()
          Teardown.
 void tearDownLogging()
          Teardown the logging
 void tearDownSecurity()
          Teardown the security
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

protected Class clazz
The class


enableSecurity

public boolean enableSecurity
Whether security is enabled


securityPolicyName

public String securityPolicyName
The security policy name


policy

protected PolicyPlugin policy
The policy plugin


logging

protected LoggingPlugin logging
The logging plugin


log

protected org.jboss.logging.Logger log
The log

Constructor Detail

AbstractTestDelegate

public AbstractTestDelegate(Class clazz)
Create a new test delegate

Parameters:
clazz - the class
Method Detail

getDelegate

protected static AbstractTestDelegate getDelegate(Class clazz)
                                           throws Exception
Get the test delegate. This queries the clazz, and its superclasses for a static getDelegate(Class) method to allow for testclass specific delegates.

Parameters:
clazz - the test class
Returns:
the delegate
Throws:
Exception - for any error

getLog

protected org.jboss.logging.Logger getLog()
Get the log

Returns:
the log

enableTrace

protected void enableTrace(String name)
Enable trace

Parameters:
name - the logging context

setUp

public void setUp()
           throws Exception
Setup callback. This calls setUpLogging and if enableSecurity is true, setUpSecurity.

Throws:
Exception - for any error

tearDown

public void tearDown()
              throws Exception
Teardown. If enableSecurity is true, this calls tearDownSecurity. The tearDownLogging is then called regardless.

Throws:
Exception - for any error

setUpLogging

public void setUpLogging()
                  throws Exception
Setup the logging

Throws:
Exception - for any error

tearDownLogging

public void tearDownLogging()
                     throws Exception
Teardown the logging

Throws:
Exception - for any error

setUpSecurity

protected void setUpSecurity()
                      throws Exception
Setup the security

Throws:
Exception - for any error

tearDownSecurity

public void tearDownSecurity()
                      throws Exception
Teardown the security

Throws:
Exception - for any error

log

protected void log(String context)
Log an event with the given context

Parameters:
context - the context


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.