Title: [jbehave] [643] trunk/core/src/java/org/jbehave/core/story/domain: [EK] Make sure cleanup happens properly
Revision
643
Author
sirenian
Date
2007-01-02 10:03:19 -0600 (Tue, 02 Jan 2007)

Log Message

[EK] Make sure cleanup happens properly
Cleaned up Hellbound a bit, added some more debugging -
why aren't the threads closing down?

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/core/src/behaviour/org/jbehave/core/story/domain/MultiStepScenarioBehaviour.java (642 => 643)

--- trunk/core/src/behaviour/org/jbehave/core/story/domain/MultiStepScenarioBehaviour.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/core/src/behaviour/org/jbehave/core/story/domain/MultiStepScenarioBehaviour.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,6 +1,7 @@
 package org.jbehave.core.story.domain;
 
 import org.jbehave.core.Block;
+import org.jbehave.core.exception.VerificationException;
 import org.jbehave.core.minimock.UsingMiniMock;
 import org.jbehave.core.mock.Mock;
 import org.jbehave.core.story.renderer.Renderer;
@@ -342,20 +343,72 @@
         ensureThat(exception, isNotNull());
     }
     
-    public void shouldFailIfCleanedUpBeforeRun() throws Exception {
-        final Scenario scenario = new MultiStepScenario(){
-            public void specifySteps() {}};
+    public void shouldNotCleanUpIfNotRun() throws Exception {
+        // given
+        final Mock given = mock(GivenWithCleanUp.class, "given");
+        World world = (World)stub(World.class);
+        
+        Scenario scenario = new MultiStepScenario() {
+            public void specifySteps() {
+                given((Given) given);
+                
+            }};
             
-        Exception exception = runAndCatch(IllegalStateException.class, new Block() {
-            public void run() throws Exception {
-                scenario.specify();
-                scenario.cleanUp((World)stub(World.class));
-            }
-        });
+        given.expects("cleanUp").never();
+            
+        scenario.specify();
+        scenario.cleanUp(world);
         
-        ensureThat(exception, isNotNull());
+        verifyMocks();
     }
     
+    public void shouldNotCleanUpIfAlreadyCleanedUp() throws Exception {
+        // given
+        final Mock given = mock(GivenWithCleanUp.class, "given");
+        World world = (World)stub(World.class);
+        
+        Scenario scenario = new MultiStepScenario() {
+            public void specifySteps() {
+                given((Given) given);
+                
+            }};
+            
+        given.expects("cleanUp").once();
+            
+        scenario.specify();
+        scenario.run(world);
+        scenario.cleanUp(world);
+        scenario.cleanUp(world);
+        
+        verifyMocks();
+    }
+    
+    public void shouldCleanUpEvenIfStepFailed() {
+        // given
+        final Mock given = mock(GivenWithCleanUp.class, "given");
+        World world = (World)stub(World.class);
+        
+        Scenario scenario = new MultiStepScenario() {
+            public void specifySteps() {
+                given((Given) given);
+                
+            }};
+            
+        given.expects("setUp").will(throwException(new VerificationException("")));
+        given.expects("cleanUp").once();
+            
+        scenario.specify();
+        
+        try {
+            scenario.run(world);
+        } catch (VerificationException e) {
+            // expected
+        }
+        
+        scenario.cleanUp(world);
+        verifyMocks();
+    }
+    
     public void shouldFailIfSpecifiedTwice() throws Exception {
         final Scenario scenario = new MultiStepScenario(){
             public void specifySteps() {}};

Modified: trunk/core/src/java/org/jbehave/core/story/domain/GivenScenario.java (642 => 643)

--- trunk/core/src/java/org/jbehave/core/story/domain/GivenScenario.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/core/src/java/org/jbehave/core/story/domain/GivenScenario.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -19,7 +19,7 @@
  * 
  * @author <a href="" PROTECTED]">Dan North</a>
  */
-public class GivenScenario extends GivenUsingMiniMock {
+public class GivenScenario extends GivenUsingMiniMock implements CleansUpWorld {
 
     private final Scenario scenario;
 

Modified: trunk/core/src/java/org/jbehave/core/story/domain/MultiStepScenario.java (642 => 643)

--- trunk/core/src/java/org/jbehave/core/story/domain/MultiStepScenario.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/core/src/java/org/jbehave/core/story/domain/MultiStepScenario.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -61,6 +61,7 @@
     private static final String UNSPECIFIED = "Unspecified";
     private static final String SPECIFIED = "Specified";
     private static final String RUN = "Run";
+    private static final String CLEANED = "Cleaned";
     
     private List steps = new ArrayList();
     private String state;
@@ -79,11 +80,14 @@
 
     public void run(World world) {
         checkState(SPECIFIED);
-        for (Iterator i = steps.iterator(); i.hasNext();) {
-            Step step = (Step) i.next();
-            step.perform(world);
+        try {
+            for (Iterator i = steps.iterator(); i.hasNext();) {
+                Step step = (Step) i.next();
+                step.perform(world);
+            }
+        } finally {
+            state = RUN;
         }
-        state = RUN;
     }
 
     private void checkState(String expected) {
@@ -91,15 +95,18 @@
     }
 
     public void cleanUp(World world) {
-        checkState(RUN);
-        for (ListIterator i = steps.listIterator(steps.size()); i.hasPrevious();) {
-            Object step = i.previous();
-            if (step instanceof CleansUpWorld) {
-                ((CleansUpWorld)step).cleanUp(world);
+        if (shouldCleanUp()) {
+            for (ListIterator i = steps.listIterator(steps.size()); i.hasPrevious();) {
+                ((AbstractStep) i.previous()).cleanUp(world);
             }
         }
+        state = CLEANED;
     }
 
+    protected boolean shouldCleanUp() {
+        return state == RUN;
+    }
+
     public void narrateTo(Renderer renderer) {
         checkState(SPECIFIED);
         renderer.renderScenario(this);
@@ -123,21 +130,20 @@
     }
     
     protected void given(Given given) {
-        AbstractStep step = new GivenStep(given);
-        addStep(step);
+        steps.add(new GivenStep(given));
     }
     
     protected void given(Scenario scenario) {
         scenario.specify();
-        addStep(new GivenStep(new GivenScenario(scenario)));
+        steps.add(new GivenStep(new GivenScenario(scenario)));
     }
 
     protected void when(Event event) {
-        addStep(new EventStep(event));
+        steps.add(new EventStep(event));
     }
     
     protected void then(final Outcome outcome) {
-        addStep(new OutcomeStep(outcome));
+        steps.add(new OutcomeStep(outcome));
         if (outcome instanceof OutcomeWithExpectations) {
             injectAfterGivens(new AbstractStep(outcome) {
                 public void perform(World world) {
@@ -160,9 +166,4 @@
         // if we get here, there weren't any givens
         steps.add(0, step);
     }
-    
-
-    private void addStep(AbstractStep step) {
-        steps.add(step);
-    }
 }

Modified: trunk/core/src/java/org/jbehave/core/story/domain/Scenario.java (642 => 643)

--- trunk/core/src/java/org/jbehave/core/story/domain/Scenario.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/core/src/java/org/jbehave/core/story/domain/Scenario.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -42,7 +42,7 @@
     void run(World world) throws IllegalStateException;
     
     /**
-     * @throws IllegalStateException if the scenario has not been run.
+     * May optionally do nothing if the scenario has not been run.
      */
     void cleanUp(World world) throws IllegalStateException;
     

Modified: trunk/core/src/java/org/jbehave/core/story/domain/ScenarioDrivenStory.java (642 => 643)

--- trunk/core/src/java/org/jbehave/core/story/domain/ScenarioDrivenStory.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/core/src/java/org/jbehave/core/story/domain/ScenarioDrivenStory.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -11,7 +11,7 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.jbehave.core.exception.NestedVerificationException;
+import org.jbehave.core.exception.VerificationException;
 import org.jbehave.core.listener.BehaviourListener;
 import org.jbehave.core.story.renderer.Renderer;
 import org.jbehave.core.story.result.ScenarioResult;
@@ -85,8 +85,8 @@
             scenario.run(world);
             result = new ScenarioResult(description, storyDescription, 
                     scenario.containsMocks() ? ScenarioResult.USED_MOCKS : ScenarioResult.SUCCEEDED);
-        } catch (NestedVerificationException nve) {
-            result = new ScenarioResult(description, storyDescription, nve);
+        } catch (VerificationException ve) {
+            result = new ScenarioResult(description, storyDescription, ve);
         } finally {
             scenario.cleanUp(world);
         }        

Modified: trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/engine/GameBehaviour.java (642 => 643)

--- trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/engine/GameBehaviour.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/engine/GameBehaviour.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -149,7 +149,7 @@
         verifyMocks();        
     }
     
-    public void shouldEndGameWhenTheNewGlyphOverlapsTheJunk() {
+    public void shouldEndGameAndStopHeartbeatWhenTheNewGlyphOverlapsTheJunk() {
         StubHeartbeat heartbeat = new StubHeartbeat();
         Game game = new Game(new PseudoRandomGlyphFactory(42, 7, 2), heartbeat, 7, 2); // pit is only 2 deep!
        
@@ -165,6 +165,8 @@
         
         verifyMocks();
         
+        ensureThat(!heartbeat.isBeating());
+        
     }
     
     private Segments droppedToFloor(Segments segments, int floor) {

Modified: trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/gui/PitPanelBehaviour.java (642 => 643)

--- trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/gui/PitPanelBehaviour.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/gui/PitPanelBehaviour.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -114,7 +114,6 @@
 				super.paint(pg);
 			}
 		};
-		pg.setPitPanel(panel);
 		return panel;
 	}
     

Modified: trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/gui/RenderedPit.java (642 => 643)

--- trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/gui/RenderedPit.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/behaviour/com/sirenian/hellbound/gui/RenderedPit.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -12,14 +12,11 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.swing.JPanel;
-
 import com.sirenian.hellbound.domain.Segment;
 import com.sirenian.hellbound.domain.Segments;
 
 public class RenderedPit extends Graphics {
 
-	private JPanel pitPanel;
 	private final int scale;
 	private Color color;
 	private Map pitMap;
@@ -37,10 +34,6 @@
         asciiRepresentation = new char[height][width];
 	}
 
-	public void setPitPanel(JPanel panel) {
-		pitPanel = panel;
-	}
-	
 	public void dispose() {	}
 
 	public void setPaintMode() {}
@@ -126,8 +119,8 @@
 	}	
 	
 	public void fillRect(int x, int y, int width, int height) {
-		int scaledX = (x - pitPanel.getX()) / scale;
-		int scaledY = (y - pitPanel.getY()) / scale;
+		int scaledX = x / scale;
+		int scaledY = y / scale;
 		
         if (scaledX >= 0 && scaledX < pitWidth && scaledY >=0 && scaledY < pitHeight) { 
             pitMap.put(new Segment(scaledX, scaledY), color);

Modified: trunk/examples/hellbound/src/java/com/sirenian/hellbound/Hellbound.java (642 => 643)

--- trunk/examples/hellbound/src/java/com/sirenian/hellbound/Hellbound.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/java/com/sirenian/hellbound/Hellbound.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -94,6 +94,7 @@
 		WindowAdapter queueLife = new WindowAdapter() {
             
 			public void windowClosing(WindowEvent e) {
+                Logger.debug(this, "Window closing; stopping threads");
 				engineQueue.stop();
 				guiQueue.stop();
                 heartbeat.stop();

Modified: trunk/examples/hellbound/src/java/com/sirenian/hellbound/engine/Game.java (642 => 643)

--- trunk/examples/hellbound/src/java/com/sirenian/hellbound/engine/Game.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/java/com/sirenian/hellbound/engine/Game.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -78,6 +78,7 @@
         glyph = factory.nextGlyph(collisionDetector, glyphListeners);
         if (glyph.getSegments().overlaps(junk.getSegments())) {
             setState(GameState.OVER);
+            heartbeat.stop();
             glyph = LivingGlyph.NULL;
             junk = Junk.NULL;
         }

Modified: trunk/examples/hellbound/src/java/com/sirenian/hellbound/util/ThreadedQueue.java (642 => 643)

--- trunk/examples/hellbound/src/java/com/sirenian/hellbound/util/ThreadedQueue.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/java/com/sirenian/hellbound/util/ThreadedQueue.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -9,16 +9,21 @@
     protected static final Runnable EMPTY_RUNNABLE = new Runnable() {
         public void run() {
         }
+        public String toString() {
+            return "ThreadedQueue.EMPTY_RUNNABLE";
+        }
     };
 
     private ArrayList eventList = new ArrayList();
     private ArrayList afterEmptyEventList = new ArrayList();
 	private boolean shouldRun = true;
     private Throwable throwable;
+
+    private final String queueName;
     
     protected ThreadedQueue(String queueName) {
+        this.queueName = queueName;
         Runnable runnable = new Runnable() {
-
             public void run() {
                 synchronized (eventList) {
                     while (shouldRun && throwable == null) {
@@ -42,10 +47,11 @@
     }
     
     public void stop() {
+        Logger.debug(this, "Stopping queue " + queueName);
     	synchronized (eventList) {
     		shouldRun = false;
-    		eventList.notifyAll();
 		}
+        eventList.notifyAll();
     }
 
     private void waitForNextRequest() {
@@ -95,6 +101,9 @@
 					localLock.notifyAll();
 				}
 			}
+            public String toString() {
+                return "Idler";
+            }
 		};
 	}
 }

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/givens/HellboundIsRunning.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/givens/HellboundIsRunning.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/givens/HellboundIsRunning.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -47,7 +47,6 @@
 				super.paint(pg);
 			}
 		};
-		pg.setPitPanel(panel);
 		return panel;
 	}	
 

Copied: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/outcomes/TheGlyphShouldFallOntoTheJunk.java (from rev 638, trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheGlyphShouldFallOntoTheJunk.java) (0 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/outcomes/TheGlyphShouldFallOntoTheJunk.java	                        (rev 0)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/outcomes/TheGlyphShouldFallOntoTheJunk.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -0,0 +1,9 @@
+package com.sirenian.hellbound.outcomes;
+
+import org.jbehave.core.story.domain.World;
+
+
+public class TheGlyphShouldFallOntoTheJunk extends HellboundOutcome {
+    protected void verifyAnyTimeIn(World world) {
+    }
+}

Added: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/HellboundScenario.java (0 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/HellboundScenario.java	                        (rev 0)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/HellboundScenario.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -0,0 +1,7 @@
+package com.sirenian.hellbound.scenarios;
+
+import org.jbehave.core.story.domain.MultiStepScenario;
+
+public abstract class HellboundScenario extends MultiStepScenario {
+
+}

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheFirstGlyphIsDisplayedOnTheBoard.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,12 +1,10 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.ThePlayerStartsTheGame;
 import com.sirenian.hellbound.givens.HellboundIsRunning;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldBeCentredAtTheTopOfThePit;
 
-public class TheFirstGlyphIsDisplayedOnTheBoard extends MultiStepScenario {
+public class TheFirstGlyphIsDisplayedOnTheBoard extends HellboundScenario {
 
     public void specifySteps() {
         given(new HellboundIsRunning());

Deleted: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheGlyphShouldFallOntoTheJunk.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheGlyphShouldFallOntoTheJunk.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/TheGlyphShouldFallOntoTheJunk.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,10 +0,0 @@
-package com.sirenian.hellbound.scenarios;
-
-import org.jbehave.core.story.domain.World;
-
-import com.sirenian.hellbound.outcomes.HellboundOutcome;
-
-public class TheGlyphShouldFallOntoTheJunk extends HellboundOutcome {
-    protected void verifyAnyTimeIn(World world) {
-    }
-}

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphIntoAnEmptyPit.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,14 +1,12 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.ThePlayerPressesTheDropKey;
 import com.sirenian.hellbound.events.TimePasses;
 import com.sirenian.hellbound.outcomes.TheGlyphSegmentsShouldBecomeJunk;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldFallToTheBottom;
 import com.sirenian.hellbound.outcomes.TheNextGlyphShouldAppear;
 
-public class ThePlayerDropsTheGlyphIntoAnEmptyPit extends MultiStepScenario {
+public class ThePlayerDropsTheGlyphIntoAnEmptyPit extends HellboundScenario {
 
     public void specifySteps() {
         given(new TheFirstGlyphIsDisplayedOnTheBoard());

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerDropsTheGlyphOntoJunk.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,12 +1,11 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.ThePlayerPressesTheDropKey;
 import com.sirenian.hellbound.outcomes.TheGlyphSegmentsShouldBecomeJunk;
+import com.sirenian.hellbound.outcomes.TheGlyphShouldFallOntoTheJunk;
 import com.sirenian.hellbound.outcomes.TheNextGlyphShouldAppear;
 
-public class ThePlayerDropsTheGlyphOntoJunk extends MultiStepScenario {
+public class ThePlayerDropsTheGlyphOntoJunk extends HellboundScenario {
 
     public void specifySteps() {
         given(new ThePlayerDropsTheGlyphIntoAnEmptyPit());

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerMovesTheGlyph.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,7 +1,5 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.ThePlayerPressesTheDownButton;
 import com.sirenian.hellbound.events.ThePlayerPressesTheLeftKey;
 import com.sirenian.hellbound.events.ThePlayerPressesTheRightKey;
@@ -10,7 +8,7 @@
 import com.sirenian.hellbound.outcomes.TheGlyphShouldMoveRight;
 import com.sirenian.hellbound.outcomes.TheHeartbeatShouldBeSkipped;
 
-public class ThePlayerMovesTheGlyph extends MultiStepScenario {
+public class ThePlayerMovesTheGlyph extends HellboundScenario {
 
     public void specifySteps() {
         given(new TheFirstGlyphIsDisplayedOnTheBoard());

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphLeft.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,14 +1,12 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.ThePlayerPressesLeftRotate;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldBeCentredAtTheTopOfThePit;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldTurnToOneQuarter;
 import com.sirenian.hellbound.outcomes.TheGlyphTurnsToThreeQuarters;
 import com.sirenian.hellbound.outcomes.TheGlyphTurnsToTwoQuarters;
 
-public class ThePlayerRotatesTheGlyphLeft extends MultiStepScenario {
+public class ThePlayerRotatesTheGlyphLeft extends HellboundScenario {
 
     public void specifySteps() {
         given(new TheFirstGlyphIsDisplayedOnTheBoard());

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerRotatesTheGlyphRight.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,14 +1,12 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.ThePlayerPressesRightRotate;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldBeCentredAtTheTopOfThePit;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldTurnToOneQuarter;
 import com.sirenian.hellbound.outcomes.TheGlyphTurnsToThreeQuarters;
 import com.sirenian.hellbound.outcomes.TheGlyphTurnsToTwoQuarters;
 
-public class ThePlayerRotatesTheGlyphRight extends MultiStepScenario {
+public class ThePlayerRotatesTheGlyphRight extends HellboundScenario {
 
     public void specifySteps() {
         given(new TheFirstGlyphIsDisplayedOnTheBoard());

Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java (642 => 643)

--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/scenarios/ThePlayerSeesTheFirstGlyphMove.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -1,11 +1,9 @@
 package com.sirenian.hellbound.scenarios;
 
-import org.jbehave.core.story.domain.MultiStepScenario;
-
 import com.sirenian.hellbound.events.TimePasses;
 import com.sirenian.hellbound.outcomes.TheGlyphShouldMoveDownwards;
 
-public class ThePlayerSeesTheFirstGlyphMove extends MultiStepScenario {
+public class ThePlayerSeesTheFirstGlyphMove extends HellboundScenario {
 
     public void specifySteps() {
         given(new TheFirstGlyphIsDisplayedOnTheBoard());

Modified: trunk/extensions/swing/src/behaviour/org/jbehave/threaded/swing/DefaultWindowWrapperBehaviour.java (642 => 643)

--- trunk/extensions/swing/src/behaviour/org/jbehave/threaded/swing/DefaultWindowWrapperBehaviour.java	2007-01-02 14:58:48 UTC (rev 642)
+++ trunk/extensions/swing/src/behaviour/org/jbehave/threaded/swing/DefaultWindowWrapperBehaviour.java	2007-01-02 16:03:19 UTC (rev 643)
@@ -127,7 +127,7 @@
     }
     
     public void shouldSimulateKeyPressesForInputMap() throws TimeoutException {
-        todo("fix race condition on linux");
+//        todo("fix race condition on linux");
         checkForHeadless();
 		DefaultWindowWrapper wrapper = new DefaultWindowWrapper("a.window");
 		


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to