Index: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/IOSemanticProcessorTest.java |
=================================================================== |
--- editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/IOSemanticProcessorTest.java (revision 23549) |
+++ editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/IOSemanticProcessorTest.java (working copy) |
@@ -87,6 +87,23 @@ |
"}"); |
} |
+ public void test_URI_create() throws Exception { |
+ translateSingleFile( |
+ "// filler filler filler filler filler filler filler filler filler filler", |
+ "package test;", |
+ "import java.net.URI;", |
+ "public class Test {", |
+ " public URI test(String uriString) {", |
+ " return URI.create(uriString);", |
+ " }", |
+ "}"); |
+ runProcessor(); |
+ assertFormattedSource( |
+ "class Test {", |
+ " Uri test(String uriString) => parseUriWithException(uriString);", |
+ "}"); |
+ } |
+ |
public void test_URI_new() throws Exception { |
translateSingleFile( |
"// filler filler filler filler filler filler filler filler filler filler", |
@@ -98,6 +115,9 @@ |
" URI result = new URI(null, null, absolutePath, null);", |
" return result;", |
" }", |
+ " public URI newFromStr(String str) {", |
+ " return new URI(str);", |
+ " }", |
" public URI newFromFile(File f) {", |
" return f.toURI();", |
" }", |
@@ -106,9 +126,10 @@ |
assertFormattedSource( |
"class Test {", |
" Uri newFromPath(String absolutePath) {", |
- " Uri result = new Uri.fromComponents(path: absolutePath);", |
+ " Uri result = new Uri(path: absolutePath);", |
" return result;", |
" }", |
+ " Uri newFromStr(String str) => parseUriWithException(str);", |
" Uri newFromFile(JavaFile f) => f.toURI();", |
"}"); |
} |