1 22 package org.jboss.ejb3.test.regression.scopedclassloader.unit; 23 24 import javax.management.MBeanServerConnection ; 25 import javax.management.ObjectName ; 26 import javax.management.Attribute ; 27 import org.jboss.test.JBossTestCase; 28 import org.jboss.ejb3.test.regression.scopedclassloader.ClientRemote; 29 import junit.framework.Test; 30 31 37 38 public class ScopeUnitTestCase 39 extends JBossTestCase 40 { 41 org.jboss.logging.Logger log = getLog(); 42 43 static boolean deployed = false; 44 static int test = 0; 45 46 public ScopeUnitTestCase(String name) 47 { 48 49 super(name); 50 51 } 52 53 public void testScopedClassLoaders() throws Exception 54 { 55 MBeanServerConnection server = getServer(); 56 ObjectName naming = new ObjectName ("jboss:service=Naming"); 57 server.setAttribute(naming, new Attribute ("CallByValue", true)); 58 try 59 { 60 ClientRemote remote = (ClientRemote)getInitialContext().lookup("scopedclassloader-web/ClientBean/remote"); 61 remote.doit(); 62 } 63 finally 64 { 65 server.setAttribute(naming, new Attribute ("CallByValue", false)); 66 } 67 } 68 69 public static Test suite() throws Exception 70 { 71 return getDeploySetup(ScopeUnitTestCase.class, "scopedclassloader-ejb.ear, scopedclassloader-web.ear"); 72 } 73 74 } 75 | Popular Tags |