1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package searls.jasmine.format;
22
23 import org.apache.maven.plugin.logging.Log;
24
25 import searls.jasmine.model.JasmineResult;
26
27 public class JasmineResultLogger {
28
29 public static final String HEADER="\n"+
30 "-------------------------------------------------------\n"+
31 " J A S M I N E T E S T S - %BROWSER%\n" +
32 "-------------------------------------------------------";
33 public static final String FAIL_APPENDAGE = " <<< FAILURE!";
34 public static final String INDENT = " ";
35
36 private Log log;
37
38 private String browser;
39
40 public void setLog(Log log) {
41 this.log = log;
42 }
43
44 public void log(JasmineResult result) {
45 log.info(HEADER.replaceAll("%BROWSER%",browser));
46
47 log.info(result.getDetails());
48
49 log.info("\nResults:\n\n"+result.getDescription()+"\n");
50 }
51
52 public void setBrowser(String browser)
53 {
54 this.browser = browser;
55 }
56 }