|
JBoss Test 1.1.9.GA-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.test.AbstractTestDelegate
org.jboss.test.JBossTestServices
public class JBossTestServices
This is provides services for jboss junit test cases and TestSetups. It supplies access to jboss logging, the jboss jmx server, jndi, and a method for deploying ejb packages. You may supply the JNDI name under which the RMIAdaptor interface is located via the system property jbosstest.server.name default (jmx/rmi/RMIAdaptor) and the directory for deployable packages with the system property jbosstest.deploy.dir (default output/lib). Should be subclassed to derive junit support for specific services integrated into jboss.
Field Summary | |
---|---|
static int |
DEFAULT_BEANCOUNT
|
static int |
DEFAULT_ITERATIONCOUNT
|
static String |
DEFAULT_LOGIN_CONFIG
|
static String |
DEFAULT_PASSWORD
|
static int |
DEFAULT_THREADCOUNT
|
static String |
DEFAULT_USERNAME
|
static String |
DEPLOYER_NAME
|
protected InitialContext |
initialContext
|
protected Hashtable |
jndiEnv
|
protected LoginContext |
lc
|
protected MBeanServerConnection |
server
|
Fields inherited from class org.jboss.test.AbstractTestDelegate |
---|
clazz, enableSecurity, log, logging, policy, securityPolicyName |
Constructor Summary | |
---|---|
JBossTestServices(Class clazz)
|
|
JBossTestServices(String className)
Constructor for the JBossTestCase object |
Method Summary | |
---|---|
void |
deploy(String name)
Deploy a package with the main deployer. |
protected URL |
getDeployURL(String filename)
Returns the deployment directory to use. |
InitialContext |
getInitialContext()
Gets the InitialContext attribute of the JBossTestCase object |
MBeanServerConnection |
getServer()
Gets the Server attribute of the JBossTestCase object |
String |
getServerHost()
Returns the JBoss server host from system property "jbosstest.server.host" This defaults to "localhost" |
void |
init()
Initializes the InitialContext if not set. |
protected Object |
invoke(MBeanServerConnection server,
ObjectName name,
String method,
Object[] args,
String[] sig)
|
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. |
void |
login()
Do a JAAS login with the current username, password and login config. |
void |
logout()
|
void |
redeploy(String name)
|
void |
reinit()
Re-initializes the InitialContext . |
void |
setUp()
The JUnit setup method |
void |
tearDown()
The teardown method for JUnit |
void |
undeploy(String name)
Undeploy a package with the main deployer. |
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 |
---|
public static final String DEPLOYER_NAME
public static final String DEFAULT_USERNAME
public static final String DEFAULT_PASSWORD
public static final String DEFAULT_LOGIN_CONFIG
public static final int DEFAULT_THREADCOUNT
public static final int DEFAULT_ITERATIONCOUNT
public static final int DEFAULT_BEANCOUNT
protected MBeanServerConnection server
protected InitialContext initialContext
protected Hashtable jndiEnv
protected LoginContext lc
Constructor Detail |
---|
public JBossTestServices(String className)
className
- Test case namepublic JBossTestServices(Class clazz)
Method Detail |
---|
public void setUp() throws Exception
setUp
in class AbstractTestDelegate
Exception
- for any errorpublic void tearDown() throws Exception
tearDown
in class AbstractTestDelegate
Exception
- for any errorpublic InitialContext getInitialContext() throws Exception
Exception
- for any errorpublic MBeanServerConnection getServer() throws Exception
Exception
- for any errorprotected URL getDeployURL(String filename) throws MalformedURLException
filename
- name of the file/url you want
MalformedURLException
- Description of Exceptionprotected 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 Object invoke(MBeanServerConnection server, ObjectName name, String method, Object[] args, String[] sig) throws Exception
Exception
public void deploy(String name) throws Exception
name
- filename/url of package to deploy.
Exception
- Description of Exceptionpublic void redeploy(String name) throws Exception
Exception
public void login() throws Exception
Exception
public void logout()
public void undeploy(String name) throws Exception
name
- filename/url of package to undeploy.
Exception
- Description of Exceptionpublic void init() throws Exception
InitialContext
if not set.
Exception
- for any errorpublic void reinit() throws Exception
InitialContext
.
Exception
- for any errorpublic String getServerHost()
|
JBoss Test 1.1.9.GA-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |