Package com.google.gwt.dev.javac.testing.impl

Examples of com.google.gwt.dev.javac.testing.impl.MockJavaResource


      shouldGenerateNoWarning(buggy);
  }

  public void testImportedClassField_InnerClassTest5() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.Buggy",
      "package some;",
      "class Buggy {",
      "  public class OtherInner {",
      "    public class Inner {",
      "      public int f;",
View Full Code Here


    shouldGenerateNoWarning(buggy);
  }

  public void testImplicitImport() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.Buggy",
        "package some;",
        "class Buggy {",
        "  native void jsniMethod(String s) /*-{",
        "    s.@String::length()();",
        "  }-*/;",
 
View Full Code Here

    shouldGenerateNoError(buggy);
  }


  public void testImportedClassField() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.Buggy",
      "package some;",
      "import other.pack.OtherPackageClass;",
      "class Buggy {",
      "  native void jsniMethod() /*-{",
      "    this.@OtherPackageClass::f;",
      "  }-*/;",
      "}");

    MockJavaResource otherPackageClass =
        JavaResourceBase.createMockJavaResource("other.pack.OtherPackageClass",
          "package other.pack;",
          "public class OtherPackageClass {",
          "  public int f;",
          "}");
View Full Code Here

    shouldGenerateNoWarning(buggy, otherPackageClass);
  }

  public void testImportedClassField_CurrentPackage() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.Buggy",
        "package some;",
        "class Buggy {",
        "  native void jsniMethod() /*-{",
        "    this.@SamePackageClass::f;",
        "  }-*/;",
        "}");

    MockJavaResource otherPackageClass =
        JavaResourceBase.createMockJavaResource("some.SamePackageClass",
            "package some;",
            "public class SamePackageClass {",
            "  public int f;",
            "}");
View Full Code Here

    shouldGenerateNoWarning(buggy, otherPackageClass);
  }

  public void testImportedStarClassField() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.Buggy",
        "package some;",
        "import other.pack.*;",
        "class Buggy {",
        "  native void jsniMethod() /*-{",
        "    this.@OtherPackageClass::f;",
        "  }-*/;",
        "}");

    MockJavaResource otherPackageClass =
        JavaResourceBase.createMockJavaResource("other.pack.OtherPackageClass",
            "package other.pack;",
            "public class OtherPackageClass {",
            "  public int f;",
            "}");
View Full Code Here

    shouldGenerateNoWarning(buggy, otherPackageClass);
  }

  public void testInnerClass() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "public class Buggy {",
       "  static class Inner {",
       "    static long x = 3;",
       "  }",
       "  native void jsniMeth() /*-{",
 
View Full Code Here

    shouldGenerateError(buggy, 6, "Referencing field 'Buggy.Inner.x': "
        + "type 'long' is not safe to access in JSNI code");
  }

  public void testInnerClassDollar() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "public class Buggy {",
       "  static class Inner {",
       "    static long x = 3;",
       "  }",
       "  native void jsniMeth() /*-{",
 
View Full Code Here

    shouldGenerateError(buggy, 6, "Referencing field 'Buggy$Inner.x': "
        + "type 'long' is not safe to access in JSNI code");
  }

  public void testInnerNew() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "public class Buggy {",
       "  class Inner {",
       "    long x = 3;",
       "    Inner(boolean b) { };",
       "  }",
View Full Code Here

   * The proper behavior here is a close call. In Development Mode, Java arrays
   * are completely unusable in JavaScript, so the current reasoning is to allow
   * them.
   */
  public void testLongArray() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  long[] m() { return new long[] { -1 }; }",
       "  native void jsniMeth() /*-{",
       "    $wnd.alert(this.@Buggy::m()()); }-*/;",
       "}");
View Full Code Here

    shouldGenerateNoError(buggy);
  }

  public void testLongParameter() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  native void jsniMeth(long x) /*-{ return; }-*/;",
       "}");

    shouldGenerateError(buggy, 2,
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.javac.testing.impl.MockJavaResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.