|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.extensions.TestDecorator
junit.extensions.TestSetup
org.jboss.test.AbstractTestSetup
org.jboss.test.JBossTestSetup
public class JBossTestSetup
This is a TestSetup class for jboss junit test cases that provides the jboss test services. It supplies access to jboss logging, the jboss jmx server, jndi, and a method for deploying ejb packages. You may supply the name of the machine the jboss server is on with the system property jbosstest.server.name (default getInetAddress().getLocalHost().getHostName()) and the directory for deployable packages with the system property jbosstest.deploy.dir (default ../lib). Should be sublassed to derive junit support for specific services integrated into JBoss.
Field Summary | |
---|---|
protected JBossTestServices |
delegate
|
Fields inherited from class org.jboss.test.AbstractTestSetup |
---|
clazz |
Fields inherited from class junit.extensions.TestDecorator |
---|
fTest |
Constructor Summary | |
---|---|
JBossTestSetup(Class clazz,
junit.framework.Test test)
Constructor for the JBossTestCase object |
|
JBossTestSetup(junit.framework.Test test)
|
Method Summary | |
---|---|
protected void |
deploy(String name)
Deploy a package with the main deployer. |
protected void |
flushAuthCache()
|
protected void |
flushAuthCache(String domain)
|
protected int |
getBeanCount()
|
protected ObjectName |
getDeployerName()
Gets the DeployerName attribute of the JBossTestCase object |
protected URL |
getDeployURL(String filename)
Returns the deployment directory to use. |
protected InitialContext |
getInitialContext()
Gets the InitialContext attribute of the JBossTestCase object |
protected int |
getIterationCount()
|
protected String |
getJndiInitFactory()
|
protected String |
getJndiURL()
|
protected org.jboss.logging.Logger |
getLog()
Gets the Log attribute of the JBossTestCase object |
protected String |
getResourceURL(String path)
|
protected MBeanServerConnection |
getServer()
Gets the Server attribute of the JBossTestCase object |
String |
getServerHost()
Get the JBoss server host from system property "jbosstest.host.name" This defaults to "localhost" |
protected int |
getThreadCount()
|
protected Object |
invoke(ObjectName name,
String method,
Object[] args,
String[] sig)
invoke wraps an invoke call to the mbean server in a lot of exception unwrapping. |
protected void |
redeploy(String name)
|
protected void |
restartDBPool()
Restart the connection pool associated with the DefaultDS |
protected void |
setUp()
Create a delegate by calling AbstractTestDelegate.getDelegate(clazz) to allow for a test specific delegate. |
protected void |
tearDown()
This method then delegates to the AbstractTestDelegate.tearDown method. |
protected void |
undeploy(String name)
Undeploy a package with the main deployer. |
Methods inherited from class junit.extensions.TestSetup |
---|
run |
Methods inherited from class junit.extensions.TestDecorator |
---|
basicRun, countTestCases, getTest, 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, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected JBossTestServices delegate
Constructor Detail |
---|
public JBossTestSetup(Class clazz, junit.framework.Test test) throws Exception
clazz
- the classtest
- the test
Exception
- for any errorpublic JBossTestSetup(junit.framework.Test test) throws Exception
Exception
Method Detail |
---|
protected void setUp() throws Exception
AbstractTestSetup
setUp
in class AbstractTestSetup
Exception
protected void tearDown() throws Exception
AbstractTestSetup
tearDown
in class AbstractTestSetup
Exception
protected InitialContext getInitialContext() throws Exception
Exception
- for any errorprotected MBeanServerConnection getServer() throws Exception
Exception
- for any errorprotected org.jboss.logging.Logger getLog()
protected ObjectName getDeployerName() throws MalformedObjectNameException
MalformedObjectNameException
- Description of Exceptionprotected URL getDeployURL(String filename) throws MalformedURLException
filename
- name of the file/url you want
MalformedURLException
- Description of Exceptionprotected String getResourceURL(String path)
protected Object invoke(ObjectName name, String method, Object[] args, String[] sig) throws Exception
name
- ObjectName of the mbean to be calledmethod
- mbean method to be calledargs
- Object[] of arguments for the mbean method.sig
- String[] of types for the mbean methods parameters.
Exception
- Description of Exceptionprotected void deploy(String name) throws Exception
name
- filename/url of package to deploy.
Exception
- Description of Exceptionprotected void redeploy(String name) throws Exception
Exception
protected void undeploy(String name) throws Exception
name
- filename/url of package to undeploy.
Exception
- Description of Exceptionprotected void flushAuthCache() throws Exception
Exception
protected void flushAuthCache(String domain) throws Exception
Exception
protected void restartDBPool() throws Exception
Exception
- on failureprotected String getJndiURL()
protected String getJndiInitFactory()
protected int getThreadCount()
protected int getIterationCount()
protected int getBeanCount()
public String getServerHost()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |