1 25 26 package org.objectweb.jonas.jtests.clients.session; 27 28 import javax.naming.NamingException ; 29 import javax.rmi.PortableRemoteObject ; 30 31 import junit.framework.Test; 32 import junit.framework.TestSuite; 33 34 import org.objectweb.jonas.jtests.beans.bmt.Moscone; 35 import org.objectweb.jonas.jtests.beans.bmt.MosconeHome; 36 import org.objectweb.jonas.jtests.util.JTestCase; 37 38 public class F_Smt extends JTestCase { 39 40 protected static MosconeHome home = null; 41 42 public F_Smt(String name) { 43 super(name); 44 } 45 46 protected void setUp() { 47 super.setUp(); 48 useBeans("bmt", true); useBeans("applimet", true); } 51 52 public MosconeHome getHome() throws Exception { 53 if (home == null) { 54 home = (MosconeHome) PortableRemoteObject.narrow(ictx.lookup("MosconeSTHome"), MosconeHome.class); 55 } 56 assertTrue(home != null); 57 return home; 58 } 59 60 public void testM1() throws Exception { 61 Moscone m = getHome().create(); 62 m.tx_start(); 63 m.tx_commit(); 64 m.remove(); 65 } 66 67 public void testM2() throws Exception { 68 Moscone m = getHome().create(); 69 m.moscone1(); 70 m.remove(); 71 } 72 73 public static Test suite() { 74 return new TestSuite(F_Smt.class); 75 } 76 77 public static void main (String args[]) { 78 String testtorun = null; 79 for (int argn = 0; argn < args.length; argn++) { 81 String sarg = args[argn]; 82 if (sarg.equals("-n")) { 83 testtorun = args[++argn]; 84 } 85 } 86 if (testtorun == null) { 87 junit.textui.TestRunner.run(suite()); 88 } else { 89 junit.textui.TestRunner.run(new F_Smt(testtorun)); 90 } 91 } 92 } 93 | Popular Tags |