Index: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/ExecutionUtilsTest.java |
diff --git a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/ExecutionUtilsTest.java b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/ExecutionUtilsTest.java |
index 0df0433970188ea3624a9dc9da59dcb361d33556..605648b02104b0d54589ac913093940bc713d732 100644 |
--- a/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/ExecutionUtilsTest.java |
+++ b/editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/ExecutionUtilsTest.java |
@@ -149,4 +149,32 @@ public class ExecutionUtilsTest extends TestCase { |
} |
} |
+ /** |
+ * Test for {@link ExecutionUtils#runObjectIgnore(RunnableObjectEx, Object)}. |
+ */ |
+ public void test_runObjectIgnore() throws Exception { |
+ final String val = "value"; |
+ String result = ExecutionUtils.runObjectIgnore(new RunnableObjectEx<String>() { |
+ @Override |
+ public String runObject() throws Exception { |
+ return val; |
+ } |
+ }, null); |
+ assertSame(val, result); |
+ } |
+ |
+ /** |
+ * Test for {@link ExecutionUtils#runObjectIgnore(RunnableObjectEx, Object)}. |
+ */ |
+ public void test_runObjectIgnore_whenException() throws Exception { |
+ String defaultValue = "def"; |
+ String result = ExecutionUtils.runObjectIgnore(new RunnableObjectEx<String>() { |
+ @Override |
+ public String runObject() throws Exception { |
+ throw new Exception(); |
+ } |
+ }, defaultValue); |
+ assertSame(defaultValue, result); |
+ } |
+ |
} |