Title: [1481] trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors: Added toString() to ErrorStrategy implementations.
Revision
1481
Author
mauro
Date
2009-12-28 09:17:30 -0600 (Mon, 28 Dec 2009)

Log Message

Added toString() to ErrorStrategy implementations.

Modified Paths


Diff

Modified: trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors/ErrorStrategy.java (1480 => 1481)

--- trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors/ErrorStrategy.java	2009-12-28 15:15:44 UTC (rev 1480)
+++ trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors/ErrorStrategy.java	2009-12-28 15:17:30 UTC (rev 1481)
@@ -4,8 +4,8 @@
  * ErrorStrategy allows to define error handling strategies. Two standard
  * strategies are provided:
  * <ul>
- * <li>{...@link SILENT}: silently absorbs the error</li>
- * <li>{...@link RETHROW}: rethrows the error</li>
+ * <li>{...@link ErrorStrategy#SILENT}: silently absorbs the error</li>
+ * <li>{...@link ErrorStrategy#RETHROW}: rethrows the error</li>
  * </ul>
  */
 public interface ErrorStrategy {
@@ -16,6 +16,9 @@
 	ErrorStrategy SILENT = new ErrorStrategy() {
 		public void handleError(Throwable throwable) {
 		}
+		public String toString() {
+		    return "SILENT";
+		};
 	};
 	
 	/**
@@ -25,6 +28,9 @@
 		public void handleError(Throwable throwable) throws Throwable {
 			throw throwable;
 		}
+        public String toString() {
+            return "RETHROW";
+        };
 	};
 
 	void handleError(Throwable throwable) throws Throwable;

Modified: trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors/PendingErrorStrategy.java (1480 => 1481)

--- trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors/PendingErrorStrategy.java	2009-12-28 15:15:44 UTC (rev 1480)
+++ trunk/core/jbehave-core/src/main/java/org/jbehave/scenario/errors/PendingErrorStrategy.java	2009-12-28 15:17:30 UTC (rev 1481)
@@ -4,26 +4,33 @@
  * PendingErrorStrategy allows to define how pending error are handled. Two
  * standard strategies are provided:
  * <ul>
- * <li>{...@link PASSING}: passes scenarios upon pending errors</li>
- * <li>{...@link FAILING}: fails scenario upon pending errors</li>
+ * <li>{...@link PendingErrorStrategy#PASSING}: passes scenarios upon pending errors</li>
+ * <li>{...@link PendingErrorStrategy#FAILING}: fails scenario upon pending errors</li>
  * </ul>
  */
 public interface PendingErrorStrategy extends ErrorStrategy {
 
-	/**
-	 * Strategy that passes scenarios upon pending errors
-	 */
-	PendingErrorStrategy PASSING = new PendingErrorStrategy() {
-		public void handleError(Throwable throwable) {
-		}
-	};
+    /**
+     * Strategy that passes scenarios upon pending errors
+     */
+    PendingErrorStrategy PASSING = new PendingErrorStrategy() {
+        public void handleError(Throwable throwable) {
+        }
 
-	/**
-	 * Strategy that fails scenario upon pending errors
-	 */
-	PendingErrorStrategy FAILING = new PendingErrorStrategy() {
-		public void handleError(Throwable throwable) throws Throwable {
-			throw throwable;
-		}
-	};
+        public String toString() {
+            return "PASSING";
+        };
+    };
+
+    /**
+     * Strategy that fails scenario upon pending errors
+     */
+    PendingErrorStrategy FAILING = new PendingErrorStrategy() {
+        public void handleError(Throwable throwable) throws Throwable {
+            throw throwable;
+        }
+        public String toString() {
+            return "FAILING";
+        };
+    };
 }


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to