1 |
| |
2 |
| |
3 |
| |
4 |
| |
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 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class DefaultTestResultDisplayer implements ITestResultDisplayer { |
28 |
| |
29 |
| |
30 |
| |
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 |
| } |