1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package jtr.test; |
8 |
| |
9 |
| import java.rmi.RemoteException; |
10 |
| import jtr.config.TestConfig; |
11 |
| import jtr.enterprise.LocatorException; |
12 |
| import jtr.remote.test.NodeInfo; |
13 |
| import jtr.remote.test.TestGatewayService; |
14 |
| import jtr.remote.utils.RmiUtil; |
15 |
| import static jtr.test.SystemProperties.*; |
16 |
| import org.apache.log4j.Logger; |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| public class TestSender { |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
1
| public static void sendTest(TestConfig tc, NodeInfo node) throws TestSenderException {
|
36 |
1
| try {
|
37 |
1
| TestGatewayService tgs = (TestGatewayService) RmiUtil.lookupServer(node);
|
38 |
1
| tgs.launchTest(tc,serverCL,testOutcomeCollector);
|
39 |
| } catch (RemoteException e) { |
40 |
0
| logger.fatal("Unable to connect to "+node+"\nTestConfiguration is not going to be sent to this JTR-node.",e);
|
41 |
0
| throw new TestSenderException("Caugth a remote exception. This means the remote JTR node has been contacted but some error occurred.",e);
|
42 |
| } catch (LocatorException e) { |
43 |
0
| logger.fatal("Unable to connect to "+node+"\nTestConfiguration is not going to be sent to this JTR-node.",e);
|
44 |
0
| throw new TestSenderException("Caugth a remote exception. This means the remote JTR node has been contacted but some error occurred.",e);
|
45 |
| } |
46 |
| } |
47 |
| |
48 |
| |
49 |
| |
50 |
| |
51 |
| static class TestSenderException extends Exception { |
52 |
0
| private TestSenderException(String msg, Throwable t) {
|
53 |
0
| super(msg,t);
|
54 |
| } |
55 |
| } |
56 |
| |
57 |
| private static NodeInfo serverCL = new NodeInfo(SERVER_CLASS_LOADER_SERVICE_NAME); |
58 |
| private static NodeInfo testOutcomeCollector = new NodeInfo(TEST_OUTCOME_COLLECTOR_SERVICE_NAME); |
59 |
| private static final Logger logger = Logger.getLogger(TestSender.class); |
60 |
| } |