Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2701)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui_test/src/com/google/dart/tools/ui/refactoring/ExecutionUtilsTest.java

Issue 10051030: Fix for local variable rename, when it is expression of invocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+
}

Powered by Google App Engine
This is Rietveld 408576698