FileDocCategorySizeDatePackage
ServiceTestCase.javaAPI DocJBoss 4.2.12893Fri Jul 13 20:53:18 BST 2007org.jboss.ejb3.test.clusteredservice.unit

ServiceTestCase

public class ServiceTestCase extends org.jboss.test.JBossTestCase
author
William DeCoste
version
$Revision: 60233 $

Fields Summary
private static String
REALM
private String
node1URL
private String
node2URL
private static final String
USE_JBOSS
Constructors Summary
public ServiceTestCase(String name)

   
     
   
      super(name);
   
Methods Summary
public static junit.framework.Testsuite()
Setup the test suite.

      return getDeploySetup(ServiceTestCase.class, "");
   
public voidtestEJBServlet()

      MBeanServerConnection server = getServer();
      ObjectName tomcat = new ObjectName("jboss.web:service=WebServer");
      
      try {
         server.setAttribute(tomcat, new Attribute(USE_JBOSS, true));
         
         assertTrue((Boolean)server.getAttribute(tomcat, USE_JBOSS));
         
         try 
         {
            URL url = new URL(node1URL+"clusteredservice/EJBServlet");
            HttpUtils.accessURL(url);
            HttpUtils.accessURL(url);
         } catch (Exception e)
         {
         }
         
         try 
         {
            URL url = new URL(node2URL+"clusteredservice/EJBServlet");
            HttpUtils.accessURL(url);
            HttpUtils.accessURL(url);
         } catch (Exception e)
         {
         }
      }
      finally
      {
         server.setAttribute(tomcat, new Attribute(USE_JBOSS, false));
      }