- Revision
- 905
- Author
- mauro
- Date
- 2008-08-29 11:59:28 -0500 (Fri, 29 Aug 2008)
Log Message
Updated example scenarios to have default constructor delegate to classloader constructor, for consistency's sake.
Modified Paths
- trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/ICanToggleACell.java
- trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/TheGridStartsEmpty.java
- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java
- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanTakeTurns.java
- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/TheGridStartsEmpty.java
- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/ThreeInARowWins.java
Diff
Modified: trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/ICanToggleACell.java (904 => 905)
--- trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/ICanToggleACell.java 2008-08-29 13:19:29 UTC (rev 904) +++ trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/ICanToggleACell.java 2008-08-29 16:59:28 UTC (rev 905) @@ -11,7 +11,7 @@ public class ICanToggleACell extends Scenario { public ICanToggleACell() { - super(new GridSteps()); + this(Thread.currentThread().getContextClassLoader()); } public ICanToggleACell(final ClassLoader classLoader) {
Modified: trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/TheGridStartsEmpty.java (904 => 905)
--- trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/TheGridStartsEmpty.java 2008-08-29 13:19:29 UTC (rev 904) +++ trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/TheGridStartsEmpty.java 2008-08-29 16:59:28 UTC (rev 905) @@ -11,7 +11,7 @@ public class TheGridStartsEmpty extends Scenario { public TheGridStartsEmpty() { - super(new GridSteps()); + this(Thread.currentThread().getContextClassLoader()); } public TheGridStartsEmpty(final ClassLoader classLoader) {
Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java (904 => 905)
--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java 2008-08-29 13:19:29 UTC (rev 904) +++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanHazTurns.java 2008-08-29 16:59:28 UTC (rev 905) @@ -16,11 +16,7 @@ public class PlayersCanHazTurns extends Scenario { public PlayersCanHazTurns() { - super(new MostUsefulConfiguration() { - public KeyWords keywords() { - return new KeyWords("I can haz", "Gief", "Wen", "Den", "And"); - } - }, new LolCatzSteps()); + this(Thread.currentThread().getContextClassLoader()); } public PlayersCanHazTurns(final ClassLoader classLoader) {
Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanTakeTurns.java (904 => 905)
--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanTakeTurns.java 2008-08-29 13:19:29 UTC (rev 904) +++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/PlayersCanTakeTurns.java 2008-08-29 16:59:28 UTC (rev 905) @@ -11,7 +11,7 @@ public class PlayersCanTakeTurns extends Scenario { public PlayersCanTakeTurns() { - super(new GridSteps()); + this(Thread.currentThread().getContextClassLoader()); } public PlayersCanTakeTurns(final ClassLoader classLoader) {
Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/TheGridStartsEmpty.java (904 => 905)
--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/TheGridStartsEmpty.java 2008-08-29 13:19:29 UTC (rev 904) +++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/TheGridStartsEmpty.java 2008-08-29 16:59:28 UTC (rev 905) @@ -1,12 +1,26 @@ package com.lunivore.noughtsandcrosses; +import org.jbehave.scenario.PropertyBasedConfiguration; import org.jbehave.scenario.Scenario; +import org.jbehave.scenario.parser.PatternScenarioParser; +import org.jbehave.scenario.parser.ScenarioFileLoader; +import org.jbehave.scenario.parser.UnderscoredCamelCaseResolver; import com.lunivore.noughtsandcrosses.steps.GridSteps; +public class TheGridStartsEmpty extends Scenario { -public class TheGridStartsEmpty extends Scenario { public TheGridStartsEmpty() { - super(new GridSteps()); + this(Thread.currentThread().getContextClassLoader()); } + + public TheGridStartsEmpty(final ClassLoader classLoader) { + super(new PropertyBasedConfiguration() { + @Override + public ScenarioFileLoader forDefiningScenarios() { + return new ScenarioFileLoader(new UnderscoredCamelCaseResolver(), classLoader, + new PatternScenarioParser(this)); + } + }, new GridSteps()); + } }
Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/ThreeInARowWins.java (904 => 905)
--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/ThreeInARowWins.java 2008-08-29 13:19:29 UTC (rev 904) +++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/ThreeInARowWins.java 2008-08-29 16:59:28 UTC (rev 905) @@ -1,13 +1,26 @@ package com.lunivore.noughtsandcrosses; +import org.jbehave.scenario.PropertyBasedConfiguration; import org.jbehave.scenario.Scenario; +import org.jbehave.scenario.parser.PatternScenarioParser; +import org.jbehave.scenario.parser.ScenarioFileLoader; +import org.jbehave.scenario.parser.UnderscoredCamelCaseResolver; import com.lunivore.noughtsandcrosses.steps.GridSteps; public class ThreeInARowWins extends Scenario { - + public ThreeInARowWins() { - super(new GridSteps()); + this(Thread.currentThread().getContextClassLoader()); } + public ThreeInARowWins(final ClassLoader classLoader) { + super(new PropertyBasedConfiguration() { + @Override + public ScenarioFileLoader forDefiningScenarios() { + return new ScenarioFileLoader(new UnderscoredCamelCaseResolver(), classLoader, + new PatternScenarioParser(this)); + } + }, new GridSteps()); + } }
To unsubscribe from this list please visit:
