1 25 26 package org.objectweb.jonas.jtests.clients.transaction; 27 28 import javax.naming.NamingException ; 29 import javax.rmi.PortableRemoteObject ; 30 import junit.framework.Test; 31 import junit.framework.TestSuite; 32 import org.objectweb.jonas.jtests.beans.transacted.Simple; 33 import org.objectweb.jonas.jtests.beans.transacted.SimpleSHome; 34 35 38 39 public class F_TxAttributeSY extends A_TxAttrSession { 40 41 private static String BEAN_HOME = "transactedSimpleSYHome"; 42 protected static SimpleSHome home = null; 43 44 public F_TxAttributeSY(String name) { 45 super(name); 46 } 47 48 51 public Simple getSimple(int i) throws Exception { 52 return home.create(); 53 } 54 55 60 protected void setUp() { 61 super.setUp(); 62 if (home == null) { 63 try { 64 home = (SimpleSHome) PortableRemoteObject.narrow(ictx.lookup(BEAN_HOME), SimpleSHome.class); 65 } catch (NamingException e) { 66 fail("Cannot get Home:" + e); 67 } 68 } 69 } 70 71 74 public static Test suite() { 75 return new TestSuite(F_TxAttributeSY.class); 76 } 77 78 public static void main (String args[]) { 79 String testtorun = null; 80 for (int argn = 0; argn < args.length; argn++) { 82 String sarg = args[argn]; 83 if (sarg.equals("-n")) { 84 testtorun = args[++argn]; 85 } 86 } 87 if (testtorun == null) { 88 junit.textui.TestRunner.run(suite()); 89 } else { 90 junit.textui.TestRunner.run(new F_TxAttributeSY(testtorun)); 91 } 92 } 93 } 94 | Popular Tags |