| 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 | 19 | int scenariosNotAllowed, int scenariosPending, int stepsFailed) { |
| 19 | 19 | this.stories = stories; |
| 20 | 19 | this.storiesNotAllowed = storiesNotAllowed; |
| 21 | 19 | this.storiesPending = storiesPending; |
| 22 | 19 | this.scenarios = scenarios; |
| 23 | 19 | this.scenariosFailed = scenariosFailed; |
| 24 | 19 | this.scenariosNotAllowed = scenariosNotAllowed; |
| 25 | 19 | this.scenariosPending = scenariosPending; |
| 26 | 19 | this.stepsFailed = stepsFailed; |
| 27 | 19 | } |
| 28 | |
|
| 29 | |
public int getStories() { |
| 30 | 16 | return stories; |
| 31 | |
} |
| 32 | |
|
| 33 | |
public int getStoriesNotAllowed() { |
| 34 | 18 | return storiesNotAllowed; |
| 35 | |
} |
| 36 | |
|
| 37 | |
public int getStoriesPending() { |
| 38 | 16 | return storiesPending; |
| 39 | |
} |
| 40 | |
|
| 41 | |
public int getScenarios() { |
| 42 | 16 | return scenarios; |
| 43 | |
} |
| 44 | |
|
| 45 | |
public int getScenariosFailed() { |
| 46 | 1 | return scenariosFailed; |
| 47 | |
} |
| 48 | |
|
| 49 | |
public int getScenariosNotAllowed() { |
| 50 | 18 | return scenariosNotAllowed; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public int getScenariosPending() { |
| 54 | 16 | return scenariosPending; |
| 55 | |
} |
| 56 | |
|
| 57 | |
public int getStepFailed(){ |
| 58 | 0 | return stepsFailed; |
| 59 | |
} |
| 60 | |
|
| 61 | |
public boolean failed(){ |
| 62 | 18 | if ( scenariosFailed > 0 || stepsFailed > 0 ) return true; |
| 63 | |
|
| 64 | |
|
| 65 | 13 | 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 | |
} |