1 22 package org.jboss.ejb3.test.initial.unit; 23 24 import javax.management.MBeanServerConnection ; 25 import javax.management.ObjectName ; 26 27 import org.jboss.logging.Logger; 28 import org.jboss.test.JBossTestCase; 29 import junit.framework.Test; 30 31 37 38 public class LocalUnitTestCase 39 extends JBossTestCase 40 { 41 private static Logger log = Logger.getLogger(LocalUnitTestCase.class); 42 43 static boolean deployed = false; 44 static int test = 0; 45 46 public LocalUnitTestCase(String name) 47 { 48 49 super(name); 50 51 } 52 53 public void testSimple() throws Exception 54 { 55 MBeanServerConnection server = getServer(); 56 ObjectName testerName = new ObjectName ("jboss.ejb3:service=Tester,test=initial"); 57 Object [] params = {}; 58 String [] sig = {}; 59 server.invoke(testerName, "test", params, sig); 60 server.invoke(testerName, "statefulTest", params, sig); 61 server.invoke(testerName, "testInterceptors", params, sig); 62 server.invoke(testerName, "testCallbacks", params, sig); 63 server.invoke(testerName, "testSLSBCollocation", params, sig); 64 server.invoke(testerName, "testSFSBCollocation", params, sig); 65 } 66 67 public void testTx() throws Exception 68 { 69 MBeanServerConnection server = getServer(); 70 ObjectName testerName = new ObjectName ("jboss.ejb3:service=TxTester,test=initial"); 71 Object [] params = {}; 72 String [] sig = {}; 73 server.invoke(testerName, "testTransactions", params, sig); 74 } 75 76 public void testSecurity() throws Exception 77 { 78 MBeanServerConnection server = getServer(); 79 ObjectName testerName = new ObjectName ("jboss.ejb3:service=SecurityTester,test=initial"); 80 Object [] params = {}; 81 String [] sig = {}; 82 server.invoke(testerName, "test", params, sig); 83 } 84 85 public static Test suite() throws Exception 86 { 87 return getDeploySetup(LocalUnitTestCase.class, "initial-ejb3-test.sar"); 88 } 89 90 } 91 | Popular Tags |