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

Unified Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java

Issue 189433006: Support for DartBlockBody, DartExpressionBody, DartOmit in java2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 6 years, 9 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/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
index 2b64883865337137f2f6fc36d4f6b93409a6d363..c5819189b051aeb0daf781df54eef184ef876258 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java
@@ -48,6 +48,54 @@ public class SyntaxTranslatorTest extends AbstractSemanticTest {
private org.eclipse.jdt.core.dom.CompilationUnit javaUnit;
private com.google.dart.engine.ast.CompilationUnit dartUnit;
+ public void test_annotation_marker() throws Exception {
+ parseJava(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public @interface DartOmit {",
+ "}",
+ "public class A {",
+ " @DartOmit",
+ " public void foo() {}",
+ " public void var() {}",
+ "}");
+ translate();
+ String actual = context.getNodeAnnotations().toString();
+ assertEquals("{void foo() {}=[DartOmit{}]}", actual);
+ }
+
+ public void test_annotation_normal() throws Exception {
+ parseJava(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public @interface DartLibrary {",
+ " String name();",
+ " String path();",
+ "}",
+ "public class A {",
+ " @DartLibrary(name = \"my.name\", path = \"my/path\")",
+ " public void foo() {}",
+ " public void var() {}",
+ "}");
+ translate();
+ String actual = context.getNodeAnnotations().toString();
+ assertEquals("{void foo() {}=[DartLibrary{name=my.name, path=my/path}]}", actual);
+ }
+
+ public void test_annotation_single() throws Exception {
+ parseJava(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public @interface DartBlockBody {",
+ " String[] value();",
+ "}",
+ "public class A {",
+ " @DartBlockBody({\"aaa\", \"bbb\", \"ccc\"})",
+ " public void foo() {}",
+ " public void var() {}",
+ "}");
+ translate();
+ String actual = context.getNodeAnnotations().toString();
+ assertEquals("{void foo() {}=[DartBlockBody{value=[aaa, bbb, ccc]}]}", actual);
+ }
+
public void test_classAbstract() throws Exception {
parseJava(
"// filler filler filler filler filler filler filler filler filler filler",

Powered by Google App Engine
This is Rietveld 408576698