Package org.jboss.metadata.test
Class AbstractTestDelegate
- java.lang.Object
-
- org.jboss.metadata.test.AbstractTestDelegate
-
public class AbstractTestDelegate extends Object
An AbstractTestDelegate.- Version:
- $Revision: 102121 $
- Author:
- Adrian Brock, Ales Justin
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassclazzThe classbooleanenableSecurityWhether security is enabledStringsecurityPolicyNameThe security policy name
-
Constructor Summary
Constructors Constructor Description AbstractTestDelegate(Class clazz)Create a new test delegate
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidenableTrace(String name)Enable traceprotected static AbstractTestDelegategetDelegate(Class clazz)Get the test delegate.protected voidlog(String context)Log an event with the given contextvoidsetUp()Setup callback.voidsetUpLogging()Setup the loggingprotected voidsetUpSecurity()Setup the securityvoidtearDown()Teardown.voidtearDownLogging()Teardown the loggingvoidtearDownSecurity()Teardown the security
-
-
-
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
-
enableTrace
protected void enableTrace(String name)
Enable trace- Parameters:
name- the logging context
-
setUp
public void setUp() throws ExceptionSetup callback. This calls setUpLogging and if enableSecurity is true, setUpSecurity.- Throws:
Exception- for any error
-
tearDown
public void tearDown() throws ExceptionTeardown. If enableSecurity is true, this calls tearDownSecurity. The tearDownLogging is then called regardless.- Throws:
Exception- for any error
-
setUpLogging
public void setUpLogging() throws ExceptionSetup the logging- Throws:
Exception- for any error
-
tearDownLogging
public void tearDownLogging() throws ExceptionTeardown the logging- Throws:
Exception- for any error
-
setUpSecurity
protected void setUpSecurity() throws ExceptionSetup the security- Throws:
Exception- for any error
-
tearDownSecurity
public void tearDownSecurity() throws ExceptionTeardown the security- Throws:
Exception- for any error
-
log
protected void log(String context)
Log an event with the given context- Parameters:
context- the context
-
-