- Revision
- 707
- Author
- sirenian
- Date
- 2007-03-22 08:34:12 -0500 (Thu, 22 Mar 2007)
Log Message
[EK] TimeoutException no longer dependent on extensions; SwingBehaviourException deleted as no longer used by anything. Fixed recursive bug with UsingMatchers.either(). Added "this story isn't functional" javadoc to UserWithdrawsCash.
Modified Paths
- trunk/core/src/behaviour/org/jbehave/core/UsingMatchersBehaviour.java
- trunk/core/src/java/org/jbehave/core/mock/UsingMatchers.java
- trunk/core/src/java/org/jbehave/core/threaded/TimeoutException.java
- trunk/examples/atm/src/stories/example/atm/stories/UserWithdrawsCash.java
- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/events/HellboundEvent.java
- trunk/extensions/swing/src/java/org/jbehave/threaded/swing/ComponentFinderException.java
Removed Paths
Diff
Modified: trunk/core/src/behaviour/org/jbehave/core/UsingMatchersBehaviour.java (706 => 707)
--- trunk/core/src/behaviour/org/jbehave/core/UsingMatchersBehaviour.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/core/src/behaviour/org/jbehave/core/UsingMatchersBehaviour.java 2007-03-22 13:34:12 UTC (rev 707) @@ -73,4 +73,11 @@ // expected } } + + public void shouldProvideMatchersForOneOrAnotherCondition() throws Exception { + UsingMatchers m = new UsingMatchers() {}; + + Ensure.that(true, m.or(m.eq(true), m.eq(false))); + Ensure.that(false, m.either(m.eq(true), m.eq(false))); + } }
Modified: trunk/core/src/java/org/jbehave/core/mock/UsingMatchers.java (706 => 707)
--- trunk/core/src/java/org/jbehave/core/mock/UsingMatchers.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/core/src/java/org/jbehave/core/mock/UsingMatchers.java 2007-03-22 13:34:12 UTC (rev 707) @@ -140,6 +140,10 @@ } }; } + + public CustomMatcher nothing() { + return isNull(); + } public CustomMatcher a(final Class type) { return isA(type); @@ -198,7 +202,7 @@ } public CustomMatcher either(final Matcher a, final Matcher b) { - return either(a, b); + return or(a, b); } public CustomMatcher not(final Matcher c) {
Modified: trunk/core/src/java/org/jbehave/core/threaded/TimeoutException.java (706 => 707)
--- trunk/core/src/java/org/jbehave/core/threaded/TimeoutException.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/core/src/java/org/jbehave/core/threaded/TimeoutException.java 2007-03-22 13:34:12 UTC (rev 707) @@ -1,9 +1,7 @@ package org.jbehave.core.threaded; -import org.jbehave.threaded.swing.SwingBehaviourException; +public class TimeoutException extends Exception { -public class TimeoutException extends SwingBehaviourException { - - private static final long serialVersionUID = 5776693901561603819L; - + private static final long serialVersionUID = 2L; + }
Modified: trunk/examples/atm/src/stories/example/atm/stories/UserWithdrawsCash.java (706 => 707)
--- trunk/examples/atm/src/stories/example/atm/stories/UserWithdrawsCash.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/examples/atm/src/stories/example/atm/stories/UserWithdrawsCash.java 2007-03-22 13:34:12 UTC (rev 707) @@ -17,6 +17,10 @@ import example.atm.scenarios.OverdrawnWithoutPermission; /** + * This story is not functional. It's a good example to use with the + * StoryPrinter. If you want a functional story, look at the + * Hellbound examples instead. + * * @author <a href="" PROTECTED]">Dan North </a> */ public class UserWithdrawsCash extends ScenarioDrivenStory {
Modified: trunk/examples/hellbound/src/stories/com/sirenian/hellbound/events/HellboundEvent.java (706 => 707)
--- trunk/examples/hellbound/src/stories/com/sirenian/hellbound/events/HellboundEvent.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/examples/hellbound/src/stories/com/sirenian/hellbound/events/HellboundEvent.java 2007-03-22 13:34:12 UTC (rev 707) @@ -2,7 +2,8 @@ import org.jbehave.core.minimock.story.domain.EventUsingMiniMock; import org.jbehave.core.story.domain.World; -import org.jbehave.threaded.swing.SwingBehaviourException; +import org.jbehave.core.threaded.TimeoutException; +import org.jbehave.threaded.swing.ComponentFinderException; import org.jbehave.threaded.swing.WindowWrapper; import com.sirenian.hellbound.stories.util.Idler; @@ -29,25 +30,27 @@ WindowWrapper wrapper = (WindowWrapper) world.get(WorldKey.WINDOW_WRAPPER, null); try { wrapper.clickButton(buttonName); - } catch (SwingBehaviourException e) { + } catch (ComponentFinderException e) { throw new RuntimeException(e); - } + } catch (TimeoutException e) { + throw new RuntimeException(e); + } } protected void pressKey(int keycode, World world) { WindowWrapper wrapper = (WindowWrapper) world.get(WorldKey.WINDOW_WRAPPER, null); try { wrapper.pressKeycode(keycode); - } catch (SwingBehaviourException e) { - throw new RuntimeException(e); - } + } catch (TimeoutException e) { + throw new RuntimeException(e); + } } protected void pressKey(char keychar, World world) { WindowWrapper wrapper = (WindowWrapper) world.get(WorldKey.WINDOW_WRAPPER, null); try { wrapper.pressKeychar(keychar); - } catch (SwingBehaviourException e) { + } catch (TimeoutException e) { throw new RuntimeException(e); } }
Modified: trunk/extensions/swing/src/java/org/jbehave/threaded/swing/ComponentFinderException.java (706 => 707)
--- trunk/extensions/swing/src/java/org/jbehave/threaded/swing/ComponentFinderException.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/extensions/swing/src/java/org/jbehave/threaded/swing/ComponentFinderException.java 2007-03-22 13:34:12 UTC (rev 707) @@ -1,8 +1,8 @@ package org.jbehave.threaded.swing; -public class ComponentFinderException extends SwingBehaviourException { +public class ComponentFinderException extends Exception { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2L; public ComponentFinderException(String message) { super(message);
Deleted: trunk/extensions/swing/src/java/org/jbehave/threaded/swing/SwingBehaviourException.java (706 => 707)
--- trunk/extensions/swing/src/java/org/jbehave/threaded/swing/SwingBehaviourException.java 2007-03-21 13:55:36 UTC (rev 706) +++ trunk/extensions/swing/src/java/org/jbehave/threaded/swing/SwingBehaviourException.java 2007-03-22 13:34:12 UTC (rev 707) @@ -1,15 +0,0 @@ -package org.jbehave.threaded.swing; - -public class SwingBehaviourException extends Exception { - - private static final long serialVersionUID = 1L; - - public SwingBehaviourException() { - super(); - } - - public SwingBehaviourException(String message) { - super(message); - } - -}
To unsubscribe from this list please visit: