Examples of MockJavaResource


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

  /**
   * JSNI references to anonymous inner classes is deprecated.
   */
  public void testAnoymousJsniRefNested() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "  static void main() {",
       "    new Object() {",
       "      class A {",
       "        int foo = 3;",
View Full Code Here

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

    shouldGenerateError(buggy, 10, "Referencing class 'Buggy$1.A': "
        + "unable to resolve class");
  }

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

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

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

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

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

       "}");
    shouldGenerateNoWarning(buggy);
  }

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

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

       "}");
    shouldGenerateNoWarning(buggy);
  }

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

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

        "Illegal assignment to class literal 'Buggy.class'");
  }

  public void testCyclicReferences() {
    {
      MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
          "class Buggy {",
          "  static int anint = 3;",
          "  native void jsniMeth() /*-{",
          "    $wnd.alert(@Extra::along);",
          "  }-*/;",
          "}");

      MockJavaResource extra = JavaResourceBase.createMockJavaResource("Extra",
          "class Extra {",
          "  static long along = 3;",
          "  native void jsniMeth() /*-{",
          "    $wnd.alert(@Buggy::anint);",
          "  }-*/;",
          "}");

      shouldGenerateError(buggy, extra, 4, "Referencing field 'Extra.along': "
          + "type 'long' is not safe to access in JSNI code");
    }

    {
      MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
          "class Buggy {",
          "  Extra anExtra = new Extra();",
          "  static int anint = 3;",
          "  native void jsniMeth() /*-{",
          "    $wnd.alert(@Extra::along);",
          "  }-*/;",
          "}");

      MockJavaResource extra = JavaResourceBase.createMockJavaResource("Extra",
          "class Extra {",
          "  Buggy mattress = new Buggy();",
          "  static long along = 3;",
          "  native void jsniMeth() /*-{",
          "    $wnd.alert(@Buggy::anint);",
View Full Code Here

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

          + "type 'long' is not safe to access in JSNI code");
    }
  }

  public void testDeprecationField() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
        "class Buggy {",
        "  @Deprecated static int bar;",
        "}",
        "class Other {",
        "  native void jsniMethod() /*-{",
 
View Full Code Here

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

    shouldGenerateWarning(buggy, 6,
        "Referencing field 'Buggy.bar': field 'Buggy.bar' is deprecated");
  }

  public void testDeprecationField_inEnclosingClass() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
        "class Buggy {",
        "  @Deprecated static int bar;",
        "  static class Inner {",
        "    static class InnerInner {",
        "      native void jsniMethod() /*-{",
 
View Full Code Here

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

    shouldGenerateNoWarning(buggy);
  }

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

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

    shouldGenerateNoWarning(buggy);
  }

  public void testDeprecationField_deprecatedbyClass_fromOtherClass() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
        "@Deprecated",
        "class DeprecatedClass {",
        "  @Deprecated static int bar;",
        "}",
        "class Buggy {",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.