- Revision
- 1102
- Author
- mauro
- Date
- 2009-02-22 07:40:34 -0600 (Sun, 22 Feb 2009)
Log Message
Missed one rename.
Modified Paths
- trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/Stepdoc2GeneratorBehaviour.java
- trunk/core/jbehave-core/src/java/org/jbehave/scenario/MostUsefulConfiguration.java
Added Paths
Removed Paths
Diff
Modified: trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/Stepdoc2GeneratorBehaviour.java (1101 => 1102)
--- trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/Stepdoc2GeneratorBehaviour.java 2009-02-22 13:39:39 UTC (rev 1101) +++ trunk/core/jbehave-core/src/behaviour/org/jbehave/scenario/steps/Stepdoc2GeneratorBehaviour.java 2009-02-22 13:40:34 UTC (rev 1102) @@ -12,7 +12,7 @@ @Test public void shouldGenerateStepdocsInPriorityOrder() { - Stepdoc2Generator generator = new DefaultStepDocGenerator(); + Stepdoc2Generator generator = new DefaultStepdoc2Generator(); MySteps steps = new MySteps(); List<Stepdoc2> stepdocs = generator.generate(steps.getClass()); ensureThat(stepdocs.get(0).getPattern(), equalTo("a given"));
Modified: trunk/core/jbehave-core/src/java/org/jbehave/scenario/MostUsefulConfiguration.java (1101 => 1102)
--- trunk/core/jbehave-core/src/java/org/jbehave/scenario/MostUsefulConfiguration.java 2009-02-22 13:39:39 UTC (rev 1101) +++ trunk/core/jbehave-core/src/java/org/jbehave/scenario/MostUsefulConfiguration.java 2009-02-22 13:40:34 UTC (rev 1102) @@ -12,7 +12,7 @@ import org.jbehave.scenario.reporters.PrintStreamStepdoc2Reporter; import org.jbehave.scenario.reporters.ScenarioReporter; import org.jbehave.scenario.reporters.Stepdoc2Reporter; -import org.jbehave.scenario.steps.DefaultStepDocGenerator; +import org.jbehave.scenario.steps.DefaultStepdoc2Generator; import org.jbehave.scenario.steps.StepCreator; import org.jbehave.scenario.steps.Stepdoc2Generator; import org.jbehave.scenario.steps.UnmatchedToPendingStepCreator; @@ -87,7 +87,7 @@ } public Stepdoc2Generator forGeneratingStepdoc() { - return new DefaultStepDocGenerator(); + return new DefaultStepdoc2Generator(); } public Stepdoc2Reporter forReportingStepdoc() {
Deleted: trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepDocGenerator.java (1101 => 1102)
--- trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepDocGenerator.java 2009-02-22 13:39:39 UTC (rev 1101) +++ trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepDocGenerator.java 2009-02-22 13:40:34 UTC (rev 1102) @@ -1,42 +0,0 @@ -package org.jbehave.scenario.steps; - -import java.lang.reflect.Method; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -import org.jbehave.scenario.annotations.Aliases; -import org.jbehave.scenario.annotations.Given; -import org.jbehave.scenario.annotations.Then; -import org.jbehave.scenario.annotations.When; - -public class DefaultStepDocGenerator implements Stepdoc2Generator { - - public List<Stepdoc2> generate(Class<?> stepsClass) { - List<Stepdoc2> stepdocs = new LinkedList<Stepdoc2>(); - for (Method method : stepsClass.getMethods()) { - if (method.isAnnotationPresent(Given.class)) { - stepdocs.add(new Stepdoc2(Given.class, method.getAnnotation(Given.class).value(), - aliases(method), method)); - } - if (method.isAnnotationPresent(When.class)) { - stepdocs.add(new Stepdoc2(When.class, method.getAnnotation(When.class).value(), - aliases(method), method)); - } - if (method.isAnnotationPresent(Then.class)) { - stepdocs.add(new Stepdoc2(Then.class, method.getAnnotation(Then.class).value(), - aliases(method), method)); - } - } - Collections.sort(stepdocs); - return stepdocs; - } - - private String[] aliases(Method method) { - if (method.isAnnotationPresent(Aliases.class)) { - return method.getAnnotation(Aliases.class).values(); - } - return new String[]{}; - } - -}
Copied: trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepdoc2Generator.java (from rev 1101, trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepDocGenerator.java) (0 => 1102)
--- trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepdoc2Generator.java (rev 0) +++ trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepdoc2Generator.java 2009-02-22 13:40:34 UTC (rev 1102) @@ -0,0 +1,42 @@ +package org.jbehave.scenario.steps; + +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import org.jbehave.scenario.annotations.Aliases; +import org.jbehave.scenario.annotations.Given; +import org.jbehave.scenario.annotations.Then; +import org.jbehave.scenario.annotations.When; + +public class DefaultStepdoc2Generator implements Stepdoc2Generator { + + public List<Stepdoc2> generate(Class<?> stepsClass) { + List<Stepdoc2> stepdocs = new LinkedList<Stepdoc2>(); + for (Method method : stepsClass.getMethods()) { + if (method.isAnnotationPresent(Given.class)) { + stepdocs.add(new Stepdoc2(Given.class, method.getAnnotation(Given.class).value(), + aliases(method), method)); + } + if (method.isAnnotationPresent(When.class)) { + stepdocs.add(new Stepdoc2(When.class, method.getAnnotation(When.class).value(), + aliases(method), method)); + } + if (method.isAnnotationPresent(Then.class)) { + stepdocs.add(new Stepdoc2(Then.class, method.getAnnotation(Then.class).value(), + aliases(method), method)); + } + } + Collections.sort(stepdocs); + return stepdocs; + } + + private String[] aliases(Method method) { + if (method.isAnnotationPresent(Aliases.class)) { + return method.getAnnotation(Aliases.class).values(); + } + return new String[]{}; + } + +}
Property changes: trunk/core/jbehave-core/src/java/org/jbehave/scenario/steps/DefaultStepdoc2Generator.java
Name: svn:mergeinfo
+
To unsubscribe from this list please visit: