org.jboss.test.kernel.junit
Class MicrocontainerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.jboss.test.AbstractTestCase
              extended by org.jboss.test.AbstractTestCaseWithSetup
                  extended by org.jboss.test.kernel.junit.MicrocontainerTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
WiredMicrocontainerTest

public class MicrocontainerTest
extends org.jboss.test.AbstractTestCaseWithSetup

A MicrocontainerTest.

Version:
$Revision: 65898 $
Author:
Adrian Brock

Constructor Summary
MicrocontainerTest(String name)
          Create a new Microcontainer test
 
Method Summary
protected  void afterSetUp()
          Configure after set up.
 org.jboss.dependency.spi.ControllerState change(KernelControllerContext context, org.jboss.dependency.spi.ControllerState required)
          Change the context to the given state
protected  KernelDeployment deploy(String resource)
          Deploy a resource
protected  KernelDeployment deploy(URL url)
          Deploy a url
protected  Object getBean(Object name)
          Get a bean
protected  Object getBean(Object name, org.jboss.dependency.spi.ControllerState state)
          Get a bean
protected  KernelControllerContext getControllerContext(Object name)
          Get a context
protected  KernelControllerContext getControllerContext(Object name, org.jboss.dependency.spi.ControllerState state)
          Get a context
static org.jboss.test.AbstractTestDelegate getDelegate(Class clazz)
          Get the test delegate
protected  MicrocontainerTestDelegate getMCDelegate()
          Get the delegate
protected  KernelMetaDataRepository getMetaDataRepository()
          Get the metadata repository
protected  void setUp()
           
protected  void shutdown()
          Shutdown the controller
protected  void undeploy(KernelDeployment deployment)
          Undeploy a deployment
protected  void undeploy(String resource)
          Undeploy a deployment
protected  void validate()
          Validate
 
Methods inherited from class org.jboss.test.AbstractTestCaseWithSetup
enableTrace, getDelegate, getLog, resumeSecurity, suite, suspendSecurity, tearDown
 
Methods inherited from class org.jboss.test.AbstractTestCase
assertEmpty, assertEmpty, assertEmpty, assertEquals, assertEquals, assertEquals, assertEquals, assertInstanceOf, assertInstanceOf, checkDeepThrowable, checkDeepThrowableRethrow, checkThrowable, checkThrowableRethrow, configureLogging, deserialize, failure, findResource, getResource, serialize, serializeDeserialize
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MicrocontainerTest

public MicrocontainerTest(String name)
Create a new Microcontainer test

Parameters:
name - the test name
Method Detail

getDelegate

public static org.jboss.test.AbstractTestDelegate getDelegate(Class clazz)
                                                       throws Exception
Get the test delegate

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

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class org.jboss.test.AbstractTestCaseWithSetup
Throws:
Exception

afterSetUp

protected void afterSetUp()
                   throws Exception
Configure after set up.

Throws:
Exception - for any error

getBean

protected Object getBean(Object name)
Get a bean

Parameters:
name - the bean name
Returns:
the bean
Throws:
IllegalStateException - when the bean does not exist

getBean

protected Object getBean(Object name,
                         org.jboss.dependency.spi.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)
Get a context

Parameters:
name - the bean name
Returns:
the context
Throws:
IllegalStateException - when the context does not exist

getControllerContext

protected KernelControllerContext getControllerContext(Object name,
                                                       org.jboss.dependency.spi.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

change

public org.jboss.dependency.spi.ControllerState change(KernelControllerContext context,
                                                       org.jboss.dependency.spi.ControllerState required)
                                                throws Throwable
Change the context to the given state

Parameters:
context - the context
required - the required state
Returns:
the actual state
Throws:
Throwable - for any error

deploy

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

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

deploy

protected KernelDeployment deploy(String resource)
                           throws Exception
Deploy a resource

Parameters:
resource - the deployment resource
Returns:
the deployment
Throws:
Exception - for any error

undeploy

protected void undeploy(KernelDeployment deployment)
Undeploy a deployment

Parameters:
deployment - the deployment

undeploy

protected void undeploy(String resource)
Undeploy a deployment

Parameters:
resource - the url

validate

protected void validate()
                 throws Exception
Validate

Throws:
Exception - for any error

getMetaDataRepository

protected KernelMetaDataRepository getMetaDataRepository()
Get the metadata repository

Returns:
the metadata repository
Throws:
IllegalStateException - when the bean does not exist at that state

shutdown

protected void shutdown()
Shutdown the controller


getMCDelegate

protected MicrocontainerTestDelegate getMCDelegate()
Get the delegate

Returns:
the delegate


Copyright ? 2007 JBoss Inc.. All Rights Reserved.