1 25 26 package org.objectweb.jonas.jtests.clients.local; 27 28 import junit.framework.Test; 29 import junit.framework.TestSuite; 30 31 import org.objectweb.jonas.jtests.beans.local.TargetLocal; 32 import org.objectweb.jonas.jtests.beans.local.TargetSLLocalHome; 33 import org.objectweb.jonas.jtests.beans.remoterunner.RSuite; 34 import org.objectweb.jonas.jtests.beans.remoterunner.RemoteRunner; 35 36 39 public class F_ClientViewSL extends A_ClientView { 40 41 protected static String REMOTE_RUNNER_HOME = "EntrySLHome"; 42 protected static String BEAN_LOCALHOME = "localTargetSLHome_L"; 43 protected static TargetSLLocalHome lhome = null; 44 45 public F_ClientViewSL(String name) { 46 super(name); 47 } 48 49 50 53 public void testLocalIsIdenticalOnSameBean() throws Exception { 54 TargetLocal tl = getLocalHome().create(); 55 assertTrue(tl.isIdentical(tl)); 56 tl.remove(); 57 } 58 59 60 65 protected void setUp() { 66 super.setUp(); 67 68 } 69 70 public TargetSLLocalHome getLocalHome() throws Exception { 71 if (lhome == null) { 72 useBeans("local", false); 73 lhome = (TargetSLLocalHome)ictx.lookup(BEAN_LOCALHOME); 74 } 75 assertTrue(lhome != null); 76 return lhome; 77 } 78 79 80 public static Test suite() { 81 return new TestSuite(F_ClientViewSL.class); 82 } 83 84 public static void main (String args[]) { 85 RSuite rs = new RSuite("unused"); 86 rs.setRunnerHomeName(REMOTE_RUNNER_HOME); 87 rs.useBeans("local", false); 88 String rtesttorun = null; 89 for (int argn = 0; argn < args.length; argn++) { 91 String s_arg = args[argn]; 92 Integer i_arg; 93 if (s_arg.equals("-n")) { 94 rtesttorun = args[++argn]; 95 } 96 } 97 98 try { 99 RemoteRunner tr = rs.getRemoteRunner(); 100 String Result = null; 101 if (rtesttorun == null) { 102 Result = tr.run(F_ClientViewSL.class); 103 } else { 104 Result = tr.run(F_ClientViewSL.class, rtesttorun); 105 } 106 System.out.println(Result); 107 108 } catch(Exception e) { 109 e.printStackTrace(); 110 System.exit(2); 111 } 112 113 114 } 115 } 116 | Popular Tags |