Title: [933] trunk/jbehave-core/src/java/org/jbehave: JBEHAVE-132: Renamed Ensure to JUnit4Ensure, to highlight the dependency on JUnit 4, now that multiple frameworks are supported.
Revision
933
Author
mauro
Date
2008-09-21 03:27:55 -0500 (Sun, 21 Sep 2008)

Log Message

JBEHAVE-132: Renamed Ensure to JUnit4Ensure, to highlight the dependency on JUnit 4, now that multiple frameworks are supported.  Moved to util package as it's an optional class which may not be used at all at runtime. 

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/domain/CellBehaviour.java (932 => 933)

--- trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/domain/CellBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/domain/CellBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -2,7 +2,7 @@
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.not;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.junit.Test;
 

Modified: trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/domain/GameBehaviour.java (932 => 933)

--- trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/domain/GameBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/domain/GameBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,6 +1,6 @@
 package com.lunivore.gameoflife.domain;
 
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;

Modified: trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/view/string/StringRendererBehaviour.java (932 => 933)

--- trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/view/string/StringRendererBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/gameoflife/src/behaviour/com/lunivore/gameoflife/view/string/StringRendererBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package com.lunivore.gameoflife.view.string;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.stub;
 

Modified: trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/steps/GridSteps.java (932 => 933)

--- trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/steps/GridSteps.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/gameoflife/src/scenario/com/lunivore/gameoflife/steps/GridSteps.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package com.lunivore.gameoflife.steps;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.jbehave.scenario.annotations.Given;
 import org.jbehave.scenario.annotations.Then;

Modified: trunk/examples/noughtsandcrosses/src/behaviour/com/lunivore/noughtsandcrosses/game/GameModelBehaviour.java (932 => 933)

--- trunk/examples/noughtsandcrosses/src/behaviour/com/lunivore/noughtsandcrosses/game/GameModelBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/noughtsandcrosses/src/behaviour/com/lunivore/noughtsandcrosses/game/GameModelBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package com.lunivore.noughtsandcrosses.game;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;

Modified: trunk/examples/noughtsandcrosses/src/behaviour/com/lunivore/noughtsandcrosses/game/WinningScenarioBehaviour.java (932 => 933)

--- trunk/examples/noughtsandcrosses/src/behaviour/com/lunivore/noughtsandcrosses/game/WinningScenarioBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/noughtsandcrosses/src/behaviour/com/lunivore/noughtsandcrosses/game/WinningScenarioBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,6 +1,6 @@
 package com.lunivore.noughtsandcrosses.game;
 
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.util.HashMap;
 import java.util.Map;

Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/steps/GridSteps.java (932 => 933)

--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/steps/GridSteps.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/steps/GridSteps.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package com.lunivore.noughtsandcrosses.steps;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.awt.Component;
 import java.util.ArrayList;

Modified: trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/steps/LolCatzSteps.java (932 => 933)

--- trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/steps/LolCatzSteps.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/noughtsandcrosses/src/scenario/com/lunivore/noughtsandcrosses/steps/LolCatzSteps.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package com.lunivore.noughtsandcrosses.steps;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.awt.Component;
 import java.util.ArrayList;

Modified: trunk/examples/trader/src/main/java/org/jbehave/examples/trader/scenarios/StockSteps.java (932 => 933)

--- trunk/examples/trader/src/main/java/org/jbehave/examples/trader/scenarios/StockSteps.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/examples/trader/src/main/java/org/jbehave/examples/trader/scenarios/StockSteps.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -2,7 +2,7 @@
 
 import static java.util.Arrays.asList;
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.util.List;
 

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/PropertyBasedConfigurationBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/PropertyBasedConfigurationBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/PropertyBasedConfigurationBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -2,7 +2,7 @@
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.jbehave.scenario.definition.ScenarioGivenWhenThenAnd;
 import org.jbehave.scenario.errors.ErrorStrategy;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/errors/ErrorStrategyInWhichWeTrustTheReporterBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/errors/ErrorStrategyInWhichWeTrustTheReporterBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/errors/ErrorStrategyInWhichWeTrustTheReporterBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.errors;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.junit.Test;
 

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/CasePreservingResolverBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/CasePreservingResolverBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/CasePreservingResolverBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.parser;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.jbehave.scenario.JUnitScenario;
 import org.junit.Test;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/PatternScenarioParserBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.parser;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.util.Arrays;
 import java.util.List;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/PrefixCapturingPatternBuilderBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/PrefixCapturingPatternBuilderBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/PrefixCapturingPatternBuilderBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.parser;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/ScenarioClassNameFinderBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/ScenarioClassNameFinderBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/ScenarioClassNameFinderBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.parser;
 
 import static java.util.Arrays.asList;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.io.IOException;
 import java.io.InputStream;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/UnderscoredCamelCaseResolverBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/UnderscoredCamelCaseResolverBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/parser/UnderscoredCamelCaseResolverBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.parser;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.jbehave.scenario.JUnitScenario;
 import org.junit.Test;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/reporters/PrintStreamScenarioReporterBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/reporters/PrintStreamScenarioReporterBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/reporters/PrintStreamScenarioReporterBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.reporters;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/CandidateStepBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -2,8 +2,8 @@
 
 import static java.util.Arrays.asList;
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
-import static org.jbehave.Ensure.not;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.not;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/ParameterConvertersBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.steps;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import java.beans.IntrospectionException;
 import java.lang.reflect.Type;

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/StepsBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.steps;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 
 import org.junit.Test;
 

Modified: trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java (932 => 933)

--- trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/behaviour/org/jbehave/scenario/steps/UnmatchedToPendingStepCreatorBehaviour.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,7 +1,7 @@
 package org.jbehave.scenario.steps;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.jbehave.Ensure.ensureThat;
+import static org.jbehave.util.JUnit4Ensure.ensureThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.stub;
 

Deleted: trunk/jbehave-core/src/java/org/jbehave/Ensure.java (932 => 933)

--- trunk/jbehave-core/src/java/org/jbehave/Ensure.java	2008-09-19 13:06:25 UTC (rev 932)
+++ trunk/jbehave-core/src/java/org/jbehave/Ensure.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -1,25 +0,0 @@
-package org.jbehave;
-
-import org.hamcrest.Matcher;
-import org.junit.Assert;
-
-/**
- * Collection of static utility methods that use Hamcrest matchers.
- * 
- * @author Elizabeth Keogh
- */
-public class Ensure {
-
-    public static void ensureThat(boolean matches) {
-        Assert.assertTrue(matches);
-    }
-    
-    public static <T> void ensureThat(T actual, Matcher<T> matcher) {
-        Assert.assertThat(actual, matcher);
-    }
-
-    public static boolean not(boolean matches) {
-        return !matches;
-    }
-
-}

Copied: trunk/jbehave-core/src/java/org/jbehave/util/JUnit4Ensure.java (from rev 932, trunk/jbehave-core/src/java/org/jbehave/Ensure.java) (0 => 933)

--- trunk/jbehave-core/src/java/org/jbehave/util/JUnit4Ensure.java	                        (rev 0)
+++ trunk/jbehave-core/src/java/org/jbehave/util/JUnit4Ensure.java	2008-09-21 08:27:55 UTC (rev 933)
@@ -0,0 +1,25 @@
+package org.jbehave.util;
+
+import org.hamcrest.Matcher;
+import org.junit.Assert;
+
+/**
+ * Collection of static utility ensure methods that use Hamcrest matchers with JUnit 4.
+ * 
+ * @author Elizabeth Keogh
+ */
+public class JUnit4Ensure {
+
+    public static void ensureThat(boolean matches) {
+        Assert.assertTrue(matches);
+    }
+    
+    public static <T> void ensureThat(T actual, Matcher<T> matcher) {
+        Assert.assertThat(actual, matcher);
+    }
+
+    public static boolean not(boolean matches) {
+        return !matches;
+    }
+
+}

Property changes: trunk/jbehave-core/src/java/org/jbehave/util/JUnit4Ensure.java

Name: svn:mergeinfo
   + 


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to