Clover coverage report -
Coverage timestamp: Sat Jul 7 2007 16:41:13 CEST
file stats: LOC: 97   Methods: 5
NCLOC: 45   Classes: 2
 
 Source file Conditionals Statements Methods TOTAL
TestGateway.java - 83.3% 80% 82.4%
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.remote.test.impl;
 8   
 9    import java.rmi.RemoteException;
 10    import java.rmi.server.UnicastRemoteObject;
 11    import jtr.config.TestConfig;
 12    import jtr.remote.test.*;
 13    import jtr.remote.test.TestGatewayService;
 14    import jtr.test.SystemProperties;
 15    import jtr.test.TestFailedException;
 16    import jtr.test.TestOutcomeTable;
 17    import org.apache.log4j.Logger;
 18   
 19    /**
 20    * Default implementation of the <code>TestGatewayService</code> interface.
 21    *
 22    * @author frusso
 23    * @version 4.0
 24    * @since 4.0
 25    */
 26    public class TestGateway extends UnicastRemoteObject implements TestGatewayService {
 27   
 28    /**
 29    * Creates a new instance of TestGateway
 30    * @throws java.rmi.RemoteException
 31    */
 32  1 public TestGateway() throws RemoteException {
 33  1 super(new Integer(System.getProperty(SystemProperties.TEST_GW_SERVICE_PORT_PROPERTY,SystemProperties.TEST_GW_SERVICE_PORT.toString())).intValue());
 34  1 logger.debug("Using "+System.getProperty(SystemProperties.TEST_GW_SERVICE_PORT_PROPERTY)+"="
 35    +System.getProperty(SystemProperties.TEST_GW_SERVICE_PORT_PROPERTY,SystemProperties.TEST_GW_SERVICE_PORT.toString()));
 36    }
 37   
 38  1 public void launchTest(TestConfig tc, final NodeInfo serverCL, final NodeInfo testOutcomeCollector) throws RemoteException {
 39  1 logger.info("Received test configuration from node "+serverCL.getHost());
 40   
 41  1 RemoteTestRunManagerStarter testStarter = new RemoteTestRunManagerStarter() {
 42  1 public void init(TestConfig tc) {
 43  1 testConfig = tc;
 44    }
 45   
 46  1 public void run() {
 47  1 RemoteTestRunManager rtrm = new RemoteTestRunManager(testConfig,serverCL,testOutcomeCollector);
 48  1 try {
 49  1 rtrm.startTest();
 50    } catch (TestFailedException ex) {
 51  0 logger.error("Caught an exception during test execution, throwing it back to the active node "+serverCL.getHost(),ex);
 52    }
 53    }
 54   
 55  0 public void setOutcome(TestOutcomeTable testOutcomeTable) {
 56  0 outcome = testOutcomeTable;
 57    }
 58   
 59    private TestConfig testConfig;
 60    private TestOutcomeTable outcome;
 61    private Thread suspendedThread;
 62    };
 63   
 64  1 testStarter.init(tc);
 65  1 new Thread(testStarter,"JTR-RemoteTestRunManager-"+System.nanoTime()).start();
 66    }
 67   
 68    private Logger logger = Logger.getLogger(TestGateway.class);
 69   
 70    //**************************************************************************
 71    // INNER-INTERFACE DEFINING A NEW CALLABLE-DERIVED INTERFACE FOR LAUNCHING
 72    // TESTS RECEIVED FROM REMOTE JTR-NODES
 73    //**************************************************************************
 74   
 75    /**
 76    * This private interface defines the contract that a component meant for
 77    * starting a new test in a brand new thread must adhere to.
 78    *
 79    * @author frusso
 80    * @version 4.0
 81    * @since 4.0
 82    */
 83    interface RemoteTestRunManagerStarter extends Runnable {
 84    /**
 85    * This method is required for passing the test-configuration to the
 86    * launcher.
 87    * @param testConfig
 88    */
 89    public void init(TestConfig testConfig);
 90   
 91    /**
 92    *
 93    * @param testOutcomeTable
 94    */
 95    public void setOutcome(TestOutcomeTable testOutcomeTable);
 96    }
 97    }