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.TargetSFLocalHome; 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 37 42 43 public class F_ClientViewSF extends F_ClientViewSL { 44 45 46 protected static String REMOTE_RUNNER_HOME = "EntrySLHome"; 47 protected static String BEAN_LOCALHOME = "localTargetSFHome_L"; 48 protected static TargetSFLocalHome lhome = null; 49 50 public F_ClientViewSF(String name) { 51 super(name); 52 } 53 54 59 protected void setUp() { 60 super.setUp(); 61 62 } 63 64 public TargetSLLocalHome getLocalHome() throws Exception { 65 if (lhome == null) { 66 useBeans("local", false); 67 lhome = (TargetSFLocalHome)ictx.lookup(BEAN_LOCALHOME); 68 } 69 assertTrue(lhome != null); 70 return lhome; 71 } 72 73 public static Test suite() { 74 return new TestSuite(F_ClientViewSF.class); 75 } 76 77 public static void main (String args[]) { 78 RSuite rs = new RSuite("unused"); 79 rs.setRunnerHomeName(REMOTE_RUNNER_HOME); 80 rs.useBeans("local", false); 81 String rtesttorun = null; 82 for (int argn = 0; argn < args.length; argn++) { 84 String s_arg = args[argn]; 85 Integer i_arg; 86 if (s_arg.equals("-n")) { 87 rtesttorun = args[++argn]; 88 } 89 } 90 91 try { 92 RemoteRunner tr = rs.getRemoteRunner(); 93 String Result = null; 94 if (rtesttorun == null) { 95 Result = tr.run(F_ClientViewSF.class); 96 } else { 97 Result = tr.run(F_ClientViewSF.class, rtesttorun); 98 } 99 System.out.println(Result); 100 101 } catch(Exception e) { 102 e.printStackTrace(); 103 System.exit(2); 104 } 105 106 107 } 108 } 109 | Popular Tags |