|
JBoss Test 1.2.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.jboss.test.AbstractTestCase
org.jboss.test.AbstractTestCaseWithSetup
org.jboss.test.JBossTestCase
public class JBossTestCase
This is the standard base test case for jboss junit test cases. 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).
Field Summary | |
---|---|
protected JBossTestServices |
delegate
|
protected static Exception |
deploymentException
Saved exception from deployment. |
protected org.jboss.logging.Logger |
log
Local variable for backward compatibility |
Constructor Summary | |
---|---|
JBossTestCase(String name)
Constructor for the JBossTestCase object |
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()
|
static AbstractTestDelegate |
getDelegate(Class clazz)
Overriden to return JBossTestServices as the test delegate. |
protected ObjectName |
getDeployerName()
Gets the DeployerName attribute of the JBossTestCase object |
static junit.framework.Test |
getDeploySetup(Class clazz,
String jarName)
|
static junit.framework.Test |
getDeploySetup(Class clazz,
junit.framework.Test test,
String jarNames)
Get a JBossTestSetup that does login and deployment in setUp/tearDown |
static junit.framework.Test |
getDeploySetup(junit.framework.Test test,
String jarName)
|
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()
|
org.jboss.logging.Logger |
getLog()
Overriden to restore the old behavior where the log was initialized post ctor rather than post setUp. |
protected String |
getResourceURL(String resource)
Get a URL string to a resource in the testsuite/output/resources dir. |
protected MBeanServerConnection |
getServer()
Gets the Server attribute of the JBossTestCase object |
String |
getServerHost()
Get the JBoss server host from system property "jbosstest.server.host" This defaults to "localhost" |
String |
getServerHostForURL()
Get the JBoss server host as above, but in a form suitable for embedding in URLs - IPv6 literals will be enclosed in square brackets (see RFC 2732). |
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)
Redeploy a package with the main deployer. |
void |
resetDelegate()
|
protected void |
restartDBPool()
Restart the connection pool associated with the DefaultDS |
void |
serverFound()
This just checks the server is there... |
protected void |
setUp()
Create a delegate by calling AbstractTestDelegate.getDelegate(clazz) to allow for a test specific delegate. |
protected void |
sleep(long interval)
|
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 org.jboss.test.AbstractTestCaseWithSetup |
---|
enableTrace, getDelegate, resumeSecurity, suite, suspendSecurity |
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, failNotEquals, failNotSame, failSame, format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static Exception deploymentException
protected JBossTestServices delegate
protected org.jboss.logging.Logger log
Constructor Detail |
---|
public JBossTestCase(String name)
name
- Test case nameMethod Detail |
---|
public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
clazz
- the test class
Exception
- for any errorprotected void setUp() throws Exception
setUp
in class AbstractTestCaseWithSetup
Exception
protected void tearDown() throws Exception
tearDown
in class AbstractTestCaseWithSetup
Exception
public org.jboss.logging.Logger getLog()
getLog
in class AbstractTestCaseWithSetup
public void resetDelegate()
public void serverFound() throws Exception
Exception
- Description of Exceptionprotected InitialContext getInitialContext() throws Exception
Exception
- for any errorprotected MBeanServerConnection getServer() throws Exception
Exception
- for any errorprotected 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 resource) throws MalformedURLException
resource
- the resource name
MalformedURLException
- for an invalid urlprotected 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
name
- filename/url of package to deploy.
Exception
- Description of Exceptionprotected void undeploy(String name) throws Exception
name
- filename/url of package to undeploy.
Exception
- Description of Exceptionpublic static junit.framework.Test getDeploySetup(Class clazz, junit.framework.Test test, String jarNames) throws Exception
clazz
- the test classtest
- a TestjarNames
- is a comma seperated list of deployments
Exception
- for any errorpublic static junit.framework.Test getDeploySetup(junit.framework.Test test, String jarName) throws Exception
Exception
public static junit.framework.Test getDeploySetup(Class clazz, String jarName) throws Exception
Exception
protected String getJndiURL()
protected String getJndiInitFactory()
protected int getThreadCount()
protected int getIterationCount()
protected int getBeanCount()
public String getServerHost()
public String getServerHostForURL()
protected void flushAuthCache() throws Exception
Exception
protected void flushAuthCache(String domain) throws Exception
Exception
protected void restartDBPool() throws Exception
Exception
- on failureprotected void sleep(long interval) throws InterruptedException
InterruptedException
|
JBoss Test 1.2.0.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |