1 22 package org.jboss.ejb3.test.servlet.unit; 23 24 import java.net.URL ; 25 26 import javax.management.Attribute ; 27 import javax.management.MBeanServerConnection ; 28 import javax.management.ObjectName ; 29 30 import junit.framework.Test; 31 32 import org.jboss.test.JBossTestCase; 33 34 38 public class EarServletUnitTestCase extends JBossTestCase 39 { 40 private static String REALM = "JBossTest Servlets"; 41 private String baseURL = HttpUtils.getBaseURL("somebody", "password"); 42 private String baseURLNoAuth = HttpUtils.getBaseURLNoAuth(); 43 44 private static final String USE_JBOSS = "UseJBossWebLoader"; 45 46 public EarServletUnitTestCase(String name) 47 { 48 super(name); 49 } 50 51 public void testEJBServlet() throws Exception 52 { 53 MBeanServerConnection server = getServer(); 54 ObjectName tomcat = new ObjectName ("jboss.web:service=WebServer"); 55 56 try { 57 server.setAttribute(tomcat, new Attribute (USE_JBOSS, true)); 58 59 assertTrue((Boolean )server.getAttribute(tomcat, USE_JBOSS)); 60 61 URL url = new URL (baseURL+"servlet/EJBServlet"); 62 HttpUtils.accessURL(url); 63 } 64 finally 65 { 66 } 68 } 69 70 73 public static Test suite() throws Exception 74 { 75 return getDeploySetup(EarServletUnitTestCase.class, "servlet.ear"); 76 } 77 78 79 } 80 | Popular Tags |