Clover coverage report -
Coverage timestamp: Sat Jul 7 2007 16:41:13 CEST
file stats: LOC: 57   Methods: 3
NCLOC: 31   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
DefaultTestResultDisplayer.java 100% 100% 100% 100%
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.impl;
 8   
 9    import java.util.Collection;
 10    import java.util.Map;
 11    import java.util.Set;
 12    import jtr.remote.test.NodeInfo;
 13    import jtr.test.ITestResultDisplayer;
 14    import jtr.test.TestOutcomeTable;
 15    import jtr.ui.swing.TestResultFrame;
 16   
 17    /**
 18    * Default implementation of the <code>ITestResultDisplayer</code> meant for
 19    * printing to the standard output the results collected form all the JTR-nodes
 20    * involved in the test.
 21    *
 22    *
 23    * @author frusso
 24    * @version 4.0
 25    * @since 4.0
 26    */
 27    public class DefaultTestResultDisplayer implements ITestResultDisplayer {
 28   
 29    /**
 30    * Creates a new instance of DefaultTestResultDisplayer
 31    */
 32  2 public DefaultTestResultDisplayer() {
 33    }
 34   
 35  2 public void showResults(Map<NodeInfo, TestOutcomeTable> outcomes) {
 36  2 if(trf==null) {
 37  1 printToStdOut(outcomes,true);
 38  1 trf = new TestResultFrame(outcomes);
 39  1 trf.setVisible(true);
 40    } else {
 41  1 printToStdOut(outcomes,false);
 42  1 trf.updateResults(outcomes);
 43    }
 44    }
 45   
 46  2 private void printToStdOut(Map<NodeInfo, TestOutcomeTable> outcomes, boolean header) {
 47  2 if(header)
 48  1 System.out.print("\nSumming-up local&remote test outcomes:\n" +
 49    "--------------------------------------");
 50  2 for(Map.Entry<NodeInfo,TestOutcomeTable> e : outcomes.entrySet()) {
 51  2 System.out.format("\nJTR-node: "+e.getKey()+"\n"+e.getValue().getBriefing()+"%n");
 52    }
 53  2 System.out.println("--------------------------------------");
 54    }
 55   
 56    private TestResultFrame trf;
 57    }