Clover coverage report -
Coverage timestamp: Sat Jul 7 2007 16:41:13 CEST
file stats: LOC: 60   Methods: 2
NCLOC: 30   Classes: 2
 
 Source file Conditionals Statements Methods TOTAL
TestSender.java - 37.5% 50% 40%
coverage coverage
 1    /**
 2    * JTRunner is free software; you can redistribute it and/or modify it under the
 3    * terms of the GNU General Public License as published by the Free Software
 4    * Foundation; either version 2, or (at your option) any later version.
 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    * Instances of this class are in charge of sending to a remote JTR node
 20    * a valid test-configurations that is expected to be launched on that node.
 21    *
 22    * @author frusso
 23    * @version 4.0
 24    * @since 4.0
 25    */
 26    public class TestSender {
 27   
 28    /**
 29    * Send the configuration to the specified node.
 30    *
 31    * @param tc The configuration
 32    * @param node The remote node
 33    * @throws jtr.test.TestSender.TestSenderException
 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    * Exception that this class' instances might throw.
 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    }