commit 1c657bc04538730772eeb75904b31b1b9f42e52e
Author: Mauro Talevi <[email protected]>
AuthorDate: Tue, 3 Dec 2013 22:53:07 +0100
Commit: Mauro Talevi <[email protected]>
CommitDate: Tue, 3 Dec 2013 22:53:07 +0100
JBEHAVE-965: Added scenario meta to xref output.
diff --git a/distribution/src/site/content/release-notes.html
b/distribution/src/site/content/release-notes.html
index e145a4f..4a4b76a 100755
--- a/distribution/src/site/content/release-notes.html
+++ b/distribution/src/site/content/release-notes.html
@@ -59,6 +59,8 @@
</li>
<li>[<a href='https://jira.codehaus.org/browse/JBEHAVE-963'>JBEHAVE-963</a>] -
Add Enum converters to default ParameterConverters
</li>
+<li>[<a href='https://jira.codehaus.org/browse/JBEHAVE-965'>JBEHAVE-965</a>] -
Add scenario meta to xref output
+</li>
</ul>
<h2> New Feature
diff --git
a/jbehave-core/src/main/java/org/jbehave/core/reporters/CrossReference.java
b/jbehave-core/src/main/java/org/jbehave/core/reporters/CrossReference.java
index c44f432..bd64e27 100755
--- a/jbehave-core/src/main/java/org/jbehave/core/reporters/CrossReference.java
+++ b/jbehave-core/src/main/java/org/jbehave/core/reporters/CrossReference.java
@@ -391,6 +391,7 @@ public class CrossReference extends Format {
protected void processScenarios() {
for (Scenario scenario : story.getScenarios()) {
String body = "Scenario:" + scenario.getTitle() + "\n";
+ processScenarioMeta(scenario.getMeta());
List<String> steps = scenario.getSteps();
for (String step : steps) {
body = body + step + "\n";
@@ -399,15 +400,19 @@ public class CrossReference extends Format {
}
}
+ private void processScenarioMeta(Meta meta) {
+ for (String name : meta.getPropertyNames()) {
+ String property = name + "=" + meta.getProperty(name);
+ this.meta = appendMetaProperty(property, this.meta);
+ }
+ }
+
protected void processMetaTags(XRefRoot root) {
Meta storyMeta = story.getMeta();
for (String next : storyMeta.getPropertyNames()) {
String property = next + "=" + storyMeta.getProperty(next);
addMetaProperty(property, root.meta);
- String newMeta = appendMetaProperty(property, this.meta);
- if (newMeta != null) {
- this.meta = newMeta;
- }
+ this.meta = appendMetaProperty(property, this.meta);
}
}