1 | |
package org.jbehave.core.reporters; |
2 | |
|
3 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
4 | |
import org.apache.commons.lang.builder.ToStringStyle; |
5 | |
|
6 | |
public class ReportsCount { |
7 | |
|
8 | |
private final int stories; |
9 | |
private final int storiesNotAllowed; |
10 | |
private final int storiesPending; |
11 | |
private final int scenarios; |
12 | |
private final int scenariosFailed; |
13 | |
private final int scenariosNotAllowed; |
14 | |
private final int scenariosPending; |
15 | |
private final int stepsFailed; |
16 | |
|
17 | |
public ReportsCount(int stories, int storiesNotAllowed, int storiesPending, int scenarios, int scenariosFailed, |
18 | 18 | int scenariosNotAllowed, int scenariosPending, int stepsFailed) { |
19 | 18 | this.stories = stories; |
20 | 18 | this.storiesNotAllowed = storiesNotAllowed; |
21 | 18 | this.storiesPending = storiesPending; |
22 | 18 | this.scenarios = scenarios; |
23 | 18 | this.scenariosFailed = scenariosFailed; |
24 | 18 | this.scenariosNotAllowed = scenariosNotAllowed; |
25 | 18 | this.scenariosPending = scenariosPending; |
26 | 18 | this.stepsFailed = stepsFailed; |
27 | 18 | } |
28 | |
|
29 | |
public int getStories() { |
30 | 15 | return stories; |
31 | |
} |
32 | |
|
33 | |
public int getStoriesNotAllowed() { |
34 | 17 | return storiesNotAllowed; |
35 | |
} |
36 | |
|
37 | |
public int getStoriesPending() { |
38 | 15 | return storiesPending; |
39 | |
} |
40 | |
|
41 | |
public int getScenarios() { |
42 | 15 | return scenarios; |
43 | |
} |
44 | |
|
45 | |
public int getScenariosFailed() { |
46 | 1 | return scenariosFailed; |
47 | |
} |
48 | |
|
49 | |
public int getScenariosNotAllowed() { |
50 | 17 | return scenariosNotAllowed; |
51 | |
} |
52 | |
|
53 | |
public int getScenariosPending() { |
54 | 15 | return scenariosPending; |
55 | |
} |
56 | |
|
57 | |
public int getStepFailed(){ |
58 | 0 | return stepsFailed; |
59 | |
} |
60 | |
|
61 | |
public boolean failed(){ |
62 | 17 | if ( scenariosFailed > 0 || stepsFailed > 0 ) return true; |
63 | |
|
64 | |
|
65 | 12 | return false; |
66 | |
} |
67 | |
|
68 | |
public boolean pending(){ |
69 | 1 | if ( scenariosPending > 0 || storiesPending > 0 ) return true; |
70 | 0 | return false; |
71 | |
} |
72 | |
|
73 | |
@Override |
74 | |
public String toString() { |
75 | 4 | return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); |
76 | |
} |
77 | |
} |