[jboss-cvs] JBossAS SVN: r112197 - branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Sep 2 04:08:14 EDT 2011
Author: jiwils
Date: 2011-09-02 04:08:14 -0400 (Fri, 02 Sep 2011)
New Revision: 112197
Modified:
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/CommonsLoggingBaseTestCase.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLFalseTestCase.java
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLTrueTestCase.java
Log:
Convert test cases to use JBossTestCase for JBPAPP-6524.
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/CommonsLoggingBaseTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/CommonsLoggingBaseTestCase.java 2011-09-02 07:15:06 UTC (rev 112196)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/CommonsLoggingBaseTestCase.java 2011-09-02 08:08:14 UTC (rev 112197)
@@ -28,52 +28,38 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Properties;
+import org.jboss.test.JBossTestCase;
-import javax.management.MalformedObjectNameException;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import junit.framework.TestCase;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.MainDeployerMBean;
-
-import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
-
/**
* Base test class for commons logging tests.
* <p>
- * This class includes funcitonality to interact with the MainDeployer so that it
- * can be reused for both EAP 4 and EAP 5.
- * <p>
* This class includes URL status checking funcitonality as well.
*
* @author jiwils
*/
-public abstract class CommonsLoggingBaseTestCase extends TestCase
+public abstract class CommonsLoggingBaseTestCase extends JBossTestCase
{
- private final String DEPLOYMENT_URL =
- "file://" + new File("lib/jbpapp6523.war").getAbsolutePath();
+ private final String DEPLOYMENT_URL = "jbpapp6523.war";
+ public CommonsLoggingBaseTestCase(String name)
+ {
+ super(name);
+ }
+
/* TestCase Overrides */
protected void setUp()
- throws DeploymentException, MalformedObjectNameException,
- MalformedURLException, NamingException
+ throws Exception
{
- getMainDeployer().deploy(DEPLOYMENT_URL);
+ super.setUp();
+ deploy(DEPLOYMENT_URL);
}
protected void tearDown()
- throws DeploymentException, MalformedObjectNameException,
- MalformedURLException, NamingException
+ throws Exception
{
- getMainDeployer().undeploy(DEPLOYMENT_URL);
+ super.tearDown();
+ undeploy(DEPLOYMENT_URL);
}
/**
@@ -92,44 +78,4 @@
return responseCode;
}
-
- /**
- * Retrieves the MainDeployer MBean proxy.
- */
- private MainDeployerMBean getMainDeployer()
- throws MalformedObjectNameException, NamingException
- {
- final String MAIN_DEPLOYER_OBJECT_NAME_STR =
- "jboss.system:service=MainDeployer";
-
- final ObjectName MAIN_DEPLOYER_OBJECT_NAME =
- ObjectName.getInstance(MAIN_DEPLOYER_OBJECT_NAME_STR);
-
- MBeanServerConnection server = getRMIServer();
-
- Object proxy =
- MBeanServerInvocationHandler.newProxyInstance(server, MAIN_DEPLOYER_OBJECT_NAME,
- MainDeployerMBean.class, false);
-
- MainDeployerMBean mainDeployer = (MainDeployerMBean) proxy;
-
- return mainDeployer;
- }
-
- /**
- * Retrieves the RMIAdapter from JNDI.
- */
- private MBeanServerConnection getRMIServer()
- throws NamingException
- {
- final String CONNECTOR_NAME = "jmx/rmi/RMIAdaptor";
-
- // Uses system property java.naming.provider.url which is set by
- // the test framework.
- InitialContext context = new InitialContext();
-
- RMIAdaptor server = (RMIAdaptor) context.lookup(CONNECTOR_NAME);
-
- return server;
- }
}
\ No newline at end of file
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLFalseTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLFalseTestCase.java 2011-09-02 07:15:06 UTC (rev 112196)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLFalseTestCase.java 2011-09-02 08:08:14 UTC (rev 112197)
@@ -33,6 +33,11 @@
*/
public class UseTCCLFalseTestCase extends CommonsLoggingBaseTestCase
{
+ public UseTCCLFalseTestCase(String name)
+ {
+ super(name);
+ }
+
public void testUseTCCLFalse()
throws IOException
{
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLTrueTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLTrueTestCase.java 2011-09-02 07:15:06 UTC (rev 112196)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/commons_logging/jbpapp6523/test/UseTCCLTrueTestCase.java 2011-09-02 08:08:14 UTC (rev 112197)
@@ -33,6 +33,11 @@
*/
public class UseTCCLTrueTestCase extends CommonsLoggingBaseTestCase
{
+ public UseTCCLTrueTestCase(String name)
+ {
+ super(name);
+ }
+
public void testUseTCCLTrue()
throws IOException
{
More information about the jboss-cvs-commits
mailing list