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

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


    shouldGenerateError(buggy, 2,
        "Parameter 'x': type 'long' is not safe to access in JSNI code");
  }

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

    shouldGenerateError(buggy, 2,
View Full Code Here


    shouldGenerateError(buggy, 2,
        "Type 'long' may not be returned from a JSNI method");
  }

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

    shouldGenerateError(buggy, 3,
        "Expected \":\" in JSNI reference\n>     @Buggy;\n" + "> ----------^");
  }

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

       "}");
    shouldGenerateNoWarning(buggy);
  }

  public void testMethodArgument() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  void print(long x) { }",
       "  native void jsniMeth() /*-{ this.@Buggy::print(J)(0); }-*/;",
       "}");

View Full Code Here

        3,
        "Parameter 1 of method 'Buggy.print': type 'long' may not be passed out of JSNI code");
  }

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

  /**
   * Test JSNI references to methods defined in superclass/superinterfaces.
   */
  public void testMethodInheritance() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  interface A1 { void a1(); }",
       "  interface A2 extends A1 { void a2(); }",
       "  static abstract class C1 implements A2 { public abstract void c1(); }",
       "  native void jsniMeth(Object o) /*-{",
 
View Full Code Here

    shouldGenerateNoWarning(buggy);
  }

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

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

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

       "}");
    shouldGenerateNoWarning(buggy);
  }

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

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

  public void testMethodUnqualified() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  void foo() { }",
       "  native void jsniMethod() /*-{",
       "    @Buggy::foo()();",
       "  }-*/;",
 
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.