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

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


    shouldGenerateError(buggy, 4,
        "Missing qualifier on instance method 'Buggy.foo'");
  }

  public void testNew() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  static native Object main() /*-{",
       "    return @Buggy::new()();",
       "  }-*/;",
       "}");
View Full Code Here


       "}");
    shouldGenerateNoWarning(buggy);
  }

  public void testOldStyleNullField() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  static native Object main() /*-{",
       "    return @null::nullField;",
       "  }-*/;",
       "}");
View Full Code Here

        3,
        "Referencing class 'null': unable to resolve class");
  }

  public void testOldStyleNullMethod() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  static native Object main() /*-{",
       "    return @null::nullMethod()();",
       "  }-*/;",
       "}");
View Full Code Here

        3,
        "Referencing class 'null': unable to resolve class");
  }

  public void testOverloadedMethodWithNoWarning() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  long m(int x) { return -1; }",
       "  int m(String x) { return -1; }",
       "  native void jsniMeth() /*-{",
       "    $wnd.alert(this.@Buggy::m(Ljava/lang/String;)(\"hello\")); }-*/;",
 
View Full Code Here

    shouldGenerateNoError(buggy);
  }

  public void testOverloadedMethodWithWarning() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  long m(int x) { return -1; }",
       "  int m(String x) { return -1; }",
       "  native void jsniMeth() /*-{",
       "    $wnd.alert(this.@Buggy::m(I)(10)); }-*/;",
 
View Full Code Here

        5,
        "Referencing method 'Buggy.m': return type 'long' is not safe to access in JSNI code");
  }

  public void testPrimitiveBadMember() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  native void jsniMethod() /*-{",
       "    @boolean::blah;",
       "  }-*/;",
       "}");
View Full Code Here

        "Referencing member 'boolean.blah': "
            + "'class' is the only legal reference for arrays and primitive types");
  }

  public void testPrimitiveClass() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  native void jsniMethod() /*-{",
       "    @boolean::class;",
       "  }-*/;",
       "}");
View Full Code Here

       "}");
    shouldGenerateNoWarning(buggy);
  }

  public void testPrimitiveClassRemovedDeprecated() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  native void jsniMethod() /*-{",
       "    @Z::class;",
       "  }-*/;",
       "}");
View Full Code Here

    shouldGenerateError(buggy, 3,
        "Referencing class 'Z': unable to resolve class");
  }

  public void testRefInString() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "import com.google.gwt.core.client.UnsafeNativeLong;",
       "class Buggy {",
       "  void print(long x) { }",
       "  native void jsniMeth() /*-{ 'this.@Buggy::print(J)(0)'; }-*/;",
       "}");
View Full Code Here

    shouldGenerateNoError(buggy);
  }

  public void testAmbiguityResolution_NestedClasses() {
    {
      MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.A",
          "package some;",
          "class A {",
          "  static Object f;",
          "  static class B {",
          "    static Object f;",
          "    native void jsniMethod() /*-{",
          "      @CC::f;",
          "    }-*/;",
          "    static class CC {",
          "      static Object f;",
          "    }",
          "  }",
          "  static class B1 {",
          "    static Object f;",
          "    static class CC {",
          "    }",
          "  }",
          "}");

      shouldGenerateNoWarning(buggy);
    }

    {
      MockJavaResource buggy = JavaResourceBase.createMockJavaResource("some.A",
          "package some;",
          "class A {",
          "  static Object f;",
          "  static class B {",
          "    static Object f;",
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.