- Revision
- 615
- Author
- tastapod
- Date
- 2006-12-05 13:36:06 -0600 (Tue, 05 Dec 2006)
Log Message
[dn] Renamed Scenario.assemble() to Scenario.specify() - note, still need to do this for Story
Modified Paths
- trunk/core/src/behaviour/jbehave/core/story/SimpleStory.java
- trunk/core/src/behaviour/jbehave/core/story/domain/MultiStepScenarioBehaviour.java
- trunk/core/src/behaviour/jbehave/core/story/domain/ScenarioDrivenStoryBehaviour.java
- trunk/core/src/java/jbehave/core/story/StoryBuilder.java
- trunk/core/src/java/jbehave/core/story/domain/MultiStepScenario.java
- trunk/core/src/java/jbehave/core/story/domain/Scenario.java
- trunk/core/src/java/jbehave/core/story/domain/ScenarioDrivenStory.java
- trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenario.java
- trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenarioWithOverdraft.java
- trunk/examples/atm/src/stories/example/atm/scenarios/InLotsOfTrouble.java
- trunk/examples/atm/src/stories/example/atm/scenarios/OverdrawnWithoutPermission.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java
Diff
Modified: trunk/core/src/behaviour/jbehave/core/story/SimpleStory.java (614 => 615)
--- trunk/core/src/behaviour/jbehave/core/story/SimpleStory.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/behaviour/jbehave/core/story/SimpleStory.java 2006-12-05 19:36:06 UTC (rev 615) @@ -27,7 +27,7 @@ } public static class PlainTextRendererWorks extends MultiStepScenario { - public void assemble() { + public void specify() { given(new EverythingCompiles()); when(new ICrossMyFingers()); then(new PlainTextRendererShouldWork()); @@ -35,7 +35,7 @@ } public static class PlainTextRendererStillWorks extends MultiStepScenario { - public void assemble() { + public void specify() { given(new PlainTextRendererWorks()); given(new FirstScenarioRanWithoutFallingOver()); when(new IDoNothing());
Modified: trunk/core/src/behaviour/jbehave/core/story/domain/MultiStepScenarioBehaviour.java (614 => 615)
--- trunk/core/src/behaviour/jbehave/core/story/domain/MultiStepScenarioBehaviour.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/behaviour/jbehave/core/story/domain/MultiStepScenarioBehaviour.java 2006-12-05 19:36:06 UTC (rev 615) @@ -10,10 +10,11 @@ // given final Mock given = mock(Given.class); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given) given); } }; + scenario.specify(); World world = new HashMapWorld(); // expect @@ -30,10 +31,11 @@ // given final Mock event = mock(Event.class); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { when((Event)event); } }; + scenario.specify(); World world = new HashMapWorld(); // expect @@ -50,10 +52,11 @@ // given final Mock outcome = mock(Outcome.class); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { then((Outcome)outcome); } }; + scenario.specify(); World world = new HashMapWorld(); // expect @@ -74,12 +77,13 @@ World world = new HashMapWorld(); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given)given); when((Event)event); then((Outcome)outcome); } }; + scenario.specify(); // expect given.expects("setUp").with(world); @@ -104,12 +108,13 @@ World world = new HashMapWorld(); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given)given); when((Event)event); then((Outcome)outcome); } }; + scenario.specify(); // expect outcome.expects("cleanUp").with(world); @@ -131,12 +136,13 @@ Mock renderer = mock(Renderer.class); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given)given); when((Event)event); then((Outcome)outcome); } }; + scenario.specify(); // expect renderer.expects("renderScenario").with(scenario); @@ -163,12 +169,13 @@ outcome.expects("containsMocks").will(returnValue(true)); // mock mock! Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given)given); when((Event)event); then((Outcome)outcome); } }; + scenario.specify(); // when boolean result = scenario.containsMocks(); @@ -190,12 +197,13 @@ outcome.expects("containsMocks").never(); // so third step not checked Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given)given); when((Event)event); then((Outcome)outcome); } }; + scenario.specify(); // when boolean result = scenario.containsMocks(); @@ -217,12 +225,13 @@ outcome.expects("containsMocks").will(returnValue(false)); Scenario scenario = new MultiStepScenario() { - public void assemble() { + public void specify() { given((Given)given); when((Event)event); then((Outcome)outcome); } }; + scenario.specify(); // when boolean result = scenario.containsMocks();
Modified: trunk/core/src/behaviour/jbehave/core/story/domain/ScenarioDrivenStoryBehaviour.java (614 => 615)
--- trunk/core/src/behaviour/jbehave/core/story/domain/ScenarioDrivenStoryBehaviour.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/behaviour/jbehave/core/story/domain/ScenarioDrivenStoryBehaviour.java 2006-12-05 19:36:06 UTC (rev 615) @@ -160,8 +160,8 @@ delegate.narrateTo(renderer); } - public void assemble() { - delegate.assemble(); + public void specify() { + delegate.specify(); } }
Modified: trunk/core/src/java/jbehave/core/story/StoryBuilder.java (614 => 615)
--- trunk/core/src/java/jbehave/core/story/StoryBuilder.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/java/jbehave/core/story/StoryBuilder.java 2006-12-05 19:36:06 UTC (rev 615) @@ -42,7 +42,7 @@ private Scenario scenario(final ScenarioDetails details, String storyName) { return new MultiStepScenario() { - public void assemble() { + public void specify() { // TODO fix ScenarioDetails to have arbitrary steps } };
Modified: trunk/core/src/java/jbehave/core/story/domain/MultiStepScenario.java (614 => 615)
--- trunk/core/src/java/jbehave/core/story/domain/MultiStepScenario.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/java/jbehave/core/story/domain/MultiStepScenario.java 2006-12-05 19:36:06 UTC (rev 615) @@ -64,12 +64,8 @@ public abstract class MultiStepScenario implements Scenario { private List steps = new ArrayList(); - public MultiStepScenario() { - assemble(); - } + public abstract void specify(); - public abstract void assemble(); - public void run(World world) { perform(world); cleanUp(world);
Modified: trunk/core/src/java/jbehave/core/story/domain/Scenario.java (614 => 615)
--- trunk/core/src/java/jbehave/core/story/domain/Scenario.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/java/jbehave/core/story/domain/Scenario.java 2006-12-05 19:36:06 UTC (rev 615) @@ -30,7 +30,7 @@ * @see MultiStepScenario */ public interface Scenario extends Renderable, HasCleanUp { - void assemble(); + void specify(); void run(World world); boolean containsMocks(); } \ No newline at end of file
Modified: trunk/core/src/java/jbehave/core/story/domain/ScenarioDrivenStory.java (614 => 615)
--- trunk/core/src/java/jbehave/core/story/domain/ScenarioDrivenStory.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/core/src/java/jbehave/core/story/domain/ScenarioDrivenStory.java 2006-12-05 19:36:06 UTC (rev 615) @@ -45,6 +45,7 @@ } public void addScenario(Scenario scenario) { + scenario.specify(); scenarios.add(scenario); }
Modified: trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenario.java (614 => 615)
--- trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenario.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenario.java 2006-12-05 19:36:06 UTC (rev 615) @@ -9,7 +9,7 @@ public class HappyScenario extends MultiStepScenario { - public void assemble() { + public void specify() { given(new AccountIsInCredit()); when(new UserRequestsCash()); then(new ATMShouldDispenseCash());
Modified: trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenarioWithOverdraft.java (614 => 615)
--- trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenarioWithOverdraft.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/atm/src/stories/example/atm/scenarios/HappyScenarioWithOverdraft.java 2006-12-05 19:36:06 UTC (rev 615) @@ -9,7 +9,7 @@ public class HappyScenarioWithOverdraft extends MultiStepScenario { - public void assemble() { + public void specify() { given(new AccountHasOverdraftPermission()); when(new UserRequestsCash()); then(new ATMShouldDispenseCash());
Modified: trunk/examples/atm/src/stories/example/atm/scenarios/InLotsOfTrouble.java (614 => 615)
--- trunk/examples/atm/src/stories/example/atm/scenarios/InLotsOfTrouble.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/atm/src/stories/example/atm/scenarios/InLotsOfTrouble.java 2006-12-05 19:36:06 UTC (rev 615) @@ -8,7 +8,7 @@ public class InLotsOfTrouble extends MultiStepScenario { - public void assemble() { + public void specify() { given(new AccountIsOverOverdraftLimit()); when(new UserRequestsCash()); then(new ATMShouldRefuseCash());
Modified: trunk/examples/atm/src/stories/example/atm/scenarios/OverdrawnWithoutPermission.java (614 => 615)
--- trunk/examples/atm/src/stories/example/atm/scenarios/OverdrawnWithoutPermission.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/atm/src/stories/example/atm/scenarios/OverdrawnWithoutPermission.java 2006-12-05 19:36:06 UTC (rev 615) @@ -8,7 +8,7 @@ public class OverdrawnWithoutPermission extends MultiStepScenario { - public void assemble() { + public void specify() { given(new HappyScenarioWithOverdraft()); given(new AccountHasNegativeBalanceWithoutPermission()); when(new UserRequestsCash());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java 2006-12-05 19:36:06 UTC (rev 615) @@ -8,7 +8,7 @@ public class TheFirstGlyphIsDisplayedOnTheBoard extends MultiStepScenario { - public void assemble() { + public void specify() { given(new HellboundIsRunning()); when(new ThePlayerStartsTheGame()); then(new TheGlyphShouldBeCentredAtTheTopOfThePit());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java 2006-12-05 19:36:06 UTC (rev 615) @@ -10,7 +10,7 @@ public class ThePlayerDropsTheGlyphIntoAnEmptyPit extends MultiStepScenario { - public void assemble() { + public void specify() { given(new TheFirstGlyphIsDisplayedOnTheBoard()); when(new ThePlayerPressesTheDropKey()); then(new TheGlyphShouldFallToTheBottom());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java 2006-12-05 19:36:06 UTC (rev 615) @@ -8,7 +8,7 @@ public class ThePlayerDropsTheGlyphOntoJunk extends MultiStepScenario { - public void assemble() { + public void specify() { given(new ThePlayerDropsTheGlyphIntoAnEmptyPit()); when(new ThePlayerPressesTheDropKey()); then(new TheGlyphShouldFallOntoTheJunk());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java 2006-12-05 19:36:06 UTC (rev 615) @@ -12,7 +12,7 @@ public class ThePlayerMovesTheGlyph extends MultiStepScenario { - public void assemble() { + public void specify() { given(new TheFirstGlyphIsDisplayedOnTheBoard()); when(new ThePlayerPressesTheRightKey()); then(new TheGlyphShouldMoveRight());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java 2006-12-05 19:36:06 UTC (rev 615) @@ -10,7 +10,7 @@ public class ThePlayerRotatesTheGlyphLeft extends MultiStepScenario { - public void assemble() { + public void specify() { given(new TheFirstGlyphIsDisplayedOnTheBoard()); when(new ThePlayerPressesLeftRotate()); then(new TheGlyphShouldTurnToOneQuarter());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java 2006-12-05 19:36:06 UTC (rev 615) @@ -10,7 +10,7 @@ public class ThePlayerRotatesTheGlyphRight extends MultiStepScenario { - public void assemble() { + public void specify() { given(new TheFirstGlyphIsDisplayedOnTheBoard()); when(new ThePlayerPressesRightRotate()); then(new TheGlyphTurnsToThreeQuarters());
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java (614 => 615)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java 2006-12-05 13:05:03 UTC (rev 614) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java 2006-12-05 19:36:06 UTC (rev 615) @@ -7,7 +7,7 @@ public class ThePlayerSeesTheFirstGlyphMove extends MultiStepScenario { - public void assemble() { + public void specify() { given(new TheFirstGlyphIsDisplayedOnTheBoard()); when(new TimePasses()); then(new TheGlyphShouldMoveDownwards());
To unsubscribe from this list please visit:
