User: d_jencks
Date: 01/09/17 10:33:54
Modified: src/main/org/jboss/test/web/test
WebIntegrationUnitTestCase.java
Log:
Finished converting to JBossTestCase for deploy and logging. Security tests still
do not work due to deploy problems
Revision Changes Path
1.2 +31 -17
jbosstest/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java
Index: WebIntegrationUnitTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/web/test/WebIntegrationUnitTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WebIntegrationUnitTestCase.java 2001/09/12 04:55:41 1.1
+++ WebIntegrationUnitTestCase.java 2001/09/17 17:33:54 1.2
@@ -1,3 +1,10 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
package org.jboss.test.web.test;
import java.io.IOException;
@@ -13,7 +20,7 @@
import junit.framework.TestSuite;
import org.jboss.jmx.connector.rmi.RMIConnector;
-import org.jboss.test.util.Deploy;
+import org.jboss.test.JBossTestCase;
/** Tests of servlet container integration into the JBoss server. This test
requires than a web container be integrated into the JBoss server. The tests
@@ -26,9 +33,9 @@
with a role of 'AuthorizedUser' in the servlet container.
@author [EMAIL PROTECTED]
- @version $Revision: 1.1 $
+ @version $Revision: 1.2 $
*/
-public class WebIntegrationUnitTestCase extends TestCase
+public class WebIntegrationUnitTestCase extends JBossTestCase
{
private static boolean setUp;
private static boolean webServerAvailable;
@@ -44,34 +51,35 @@
*/
protected void setUp() throws Exception
{
- if( setUp == true )
+ super.setUp();
+ /*if( setUp == true )
return;
setUp = true;
-
+ */
Integer port = Integer.getInteger("web.port", 8080);
baseURL = "http://jduke:theduke@localhost:" + port + '/';
try
{
- String serverName = InetAddress.getLocalHost().getHostName();
- String connectorName = "jmx:" +serverName+ ":rmi";
- RMIConnector server = (RMIConnector) new
InitialContext().lookup(connectorName);
- ObjectName deployerName = new ObjectName("J2EE:service=J2eeDeployer");
+ //String serverName = InetAddress.getLocalHost().getHostName();
+ //String connectorName = "jmx:" +serverName+ ":rmi";
+ //RMIConnector server = (RMIConnector) new
InitialContext().lookup(connectorName);
+ //ObjectName deployerName = new ObjectName("J2EE:service=J2eeDeployer");
// Ask the deployer for the getWarDeployerName
Object[] params =
{};
String[] signature =
{};
- String warDeployerName = (String) server.invoke(deployerName,
- "getWarDeployerName", params, signature);
+ String warDeployerName = (String) invoke(getJ2eeDeployerName(),
+ "getWarDeployerName", params, signature);
// See if the warDeployerName exists
- deployerName = new ObjectName(warDeployerName);
- webServerAvailable = server.isRegistered(deployerName);
+ ObjectName deployerName = new ObjectName(warDeployerName);
+ webServerAvailable = getServer().isRegistered(deployerName);
if( webServerAvailable == true )
{
System.out.println("Found warDeployer named: "+warDeployerName);
try
{
- Deploy.deploy("jbosstest-web.ear");
+ deployJ2ee("jbosstest-web.ear");
}
catch(Exception e)
{
@@ -84,7 +92,7 @@
{"other"};
signature = new String[]
{"java.lang.String"};
- server.invoke(jaasMgr, "flushAuthenticationCache", params, signature);
+ invoke(jaasMgr, "flushAuthenticationCache", params, signature);
}
else
{
@@ -102,6 +110,12 @@
System.out.println("No war deployer found, skipping tests");
}
}
+
+ protected void tearDown() throws Exception
+ {
+ undeployJ2ee("jbosstest-web.ear");
+ super.tearDown();
+ }
/** Access the http://localhost/jbosstest/EJBOnStartupServlet
*/
@@ -220,7 +234,7 @@
throw e;
}
}
-
+ /*
public static void main(java.lang.String[] args)
{
System.setErr(System.out);
@@ -253,5 +267,5 @@
return suite;
}
-
+ */
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development