org.jboss.test.kernel.junit
Class MicrocontainerTestDelegate

java.lang.Object
  extended by org.jboss.test.AbstractTestDelegate
      extended by org.jboss.test.kernel.junit.MicrocontainerTestDelegate

public class MicrocontainerTestDelegate
extends org.jboss.test.AbstractTestDelegate

A MicrocontainerTestDelegate.

Version:
$Revision: 1.5 $
Author:
Adrian Brock

Field Summary
protected  BeanXMLDeployer deployer
          The deployer
protected  List deployments
          The deployments
protected  Kernel kernel
          The kernel
 
Fields inherited from class org.jboss.test.AbstractTestDelegate
clazz, enableSecurity, log, logging, policy, securityPolicyName
 
Constructor Summary
MicrocontainerTestDelegate(Class clazz)
          Create a new MicrocontainerTestDelegate.
 
Method Summary
protected  void deploy()
          Deploy the beans
protected  KernelDeployment deploy(URL url)
          Deploy a url
protected  Object getBean(Object name, ControllerState state)
          Get a bean
protected  AbstractBootstrap getBootstrap()
          Get the kernel bootstrap
protected  KernelControllerContext getControllerContext(Object name, ControllerState state)
          Get a context
 void setUp()
           
 void tearDown()
           
protected  void undeploy()
          Undeploy all
protected  void undeploy(KernelDeployment deployment)
          Undeploy a deployment
protected  void validate()
          Validate
 
Methods inherited from class org.jboss.test.AbstractTestDelegate
enableTrace, getDelegate, getLog, log, setUpLogging, setUpSecurity, tearDownLogging, tearDownSecurity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kernel

protected Kernel kernel
The kernel


deployer

protected BeanXMLDeployer deployer
The deployer


deployments

protected List deployments
The deployments

Constructor Detail

MicrocontainerTestDelegate

public MicrocontainerTestDelegate(Class clazz)
                           throws Exception
Create a new MicrocontainerTestDelegate.

Parameters:
clazz - the test class
Throws:
Exception - for any error
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class org.jboss.test.AbstractTestDelegate
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Overrides:
tearDown in class org.jboss.test.AbstractTestDelegate
Throws:
Exception

getBootstrap

protected AbstractBootstrap getBootstrap()
                                  throws Exception
Get the kernel bootstrap

Returns:
the bootstrap
Throws:
Exception

getBean

protected Object getBean(Object name,
                         ControllerState state)
Get a bean

Parameters:
name - the name of the bean
state - the state of the bean
Returns:
the bean
Throws:
IllegalStateException - when the bean does not exist at that state

getControllerContext

protected KernelControllerContext getControllerContext(Object name,
                                                       ControllerState state)
Get a context

Parameters:
name - the name of the bean
state - the state of the bean
Returns:
the context
Throws:
IllegalStateException - when the context does not exist at that state

validate

protected void validate()
                 throws Exception
Validate

Throws:
Exception

deploy

protected KernelDeployment deploy(URL url)
                           throws Exception
Deploy a url

Parameters:
url - the deployment url
Returns:
the deployment
Throws:
Throwable - for any error
Exception

undeploy

protected void undeploy(KernelDeployment deployment)
Undeploy a deployment

Parameters:
deployment - the deployment

deploy

protected void deploy()
               throws Exception
Deploy the beans

Throws:
Exception - for any error

undeploy

protected void undeploy()
Undeploy all



Copyright © 2004 JBoss Inc. All Rights Reserved.