1 /*
2 =================== DO NOT EDIT THIS FILE ====================
3 Generated by Modello 1.4.1 on 2011-01-22 19:39:50,
4 any modifications will be overwritten.
5 ==============================================================
6 */
7
8 package org.apache.maven.surefire.failsafe.model;
9
10 /**
11 *
12 * Describes the results of executing tests
13 * .
14 *
15 * @version $Revision$ $Date$
16 */
17 public class FailsafeSummary
18 implements java.io.Serializable
19 {
20
21 //--------------------------/
22 //- Class/Member Variables -/
23 //--------------------------/
24
25 /**
26 * The surefire result code.
27 */
28 private int result = 0;
29
30 /**
31 * The exception that caused surefire to bomb out.
32 */
33 private String exception;
34
35 /**
36 * Field modelEncoding.
37 */
38 private String modelEncoding = "UTF-8";
39
40
41 //-----------/
42 //- Methods -/
43 //-----------/
44
45 /**
46 * Get the exception that caused surefire to bomb out.
47 *
48 * @return String
49 */
50 public String getException()
51 {
52 return this.exception;
53 } //-- String getException()
54
55 /**
56 * Get the modelEncoding field.
57 *
58 * @return String
59 */
60 public String getModelEncoding()
61 {
62 return this.modelEncoding;
63 } //-- String getModelEncoding()
64
65 /**
66 * Get the surefire result code.
67 *
68 * @return int
69 */
70 public int getResult()
71 {
72 return this.result;
73 } //-- int getResult()
74
75 /**
76 * Set the exception that caused surefire to bomb out.
77 *
78 * @param exception
79 */
80 public void setException( String exception )
81 {
82 this.exception = exception;
83 } //-- void setException( String )
84
85 /**
86 * Set the modelEncoding field.
87 *
88 * @param modelEncoding
89 */
90 public void setModelEncoding( String modelEncoding )
91 {
92 this.modelEncoding = modelEncoding;
93 } //-- void setModelEncoding( String )
94
95 /**
96 * Set the surefire result code.
97 *
98 * @param result
99 */
100 public void setResult( int result )
101 {
102 this.result = result;
103 } //-- void setResult( int )
104
105
106 /**
107 * Merges the summary result with this summary result.
108 *
109 * @param summary The summary to merge.
110 * @since 2.6
111 */
112 public void merge( FailsafeSummary summary )
113 {
114 switch ( this.result )
115 {
116 case org.apache.maven.surefire.booter.ProviderConfiguration.TESTS_SUCCEEDED_EXIT_CODE:
117 this.result = summary.result;
118 break;
119 case org.apache.maven.surefire.booter.ProviderConfiguration.NO_TESTS_EXIT_CODE:
120 switch ( summary.result )
121 {
122 case org.apache.maven.surefire.booter.ProviderConfiguration.TESTS_SUCCEEDED_EXIT_CODE:
123 break;
124 case org.apache.maven.surefire.booter.ProviderConfiguration.NO_TESTS_EXIT_CODE:
125 break;
126 case org.apache.maven.surefire.booter.ProviderConfiguration.TESTS_FAILED_EXIT_CODE:
127 this.result = summary.result;
128 break;
129 default:
130 this.result = summary.result;
131 break;
132 }
133 break;
134 case org.apache.maven.surefire.booter.ProviderConfiguration.TESTS_FAILED_EXIT_CODE:
135 switch ( summary.result )
136 {
137 case org.apache.maven.surefire.booter.ProviderConfiguration.TESTS_SUCCEEDED_EXIT_CODE:
138 break;
139 case org.apache.maven.surefire.booter.ProviderConfiguration.NO_TESTS_EXIT_CODE:
140 break;
141 case org.apache.maven.surefire.booter.ProviderConfiguration.TESTS_FAILED_EXIT_CODE:
142 break;
143 default:
144 this.result = summary.result;
145 break;
146 }
147 break;
148 default:
149 break;
150 }
151 if ( this.exception == null )
152 {
153 this.exception = summary.exception;
154 }
155 }
156
157 }