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

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


        warning(7,
            "Referencing field 'DeprecatedClass.bar': field 'DeprecatedClass.bar' is deprecated"));
  }

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


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

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

    shouldGenerateNoWarning(buggy);
  }

  public void testDeprecationMethod_deprecatedbyClass_fromOtherClass() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
        "@Deprecated",
        "class DeprecatedClass {",
        "  @Deprecated static void foo(){}",
        "}",
        "class Buggy {",
View Full Code Here

        warning(7,"Referencing method 'DeprecatedClass.foo': "
            + "method 'DeprecatedClass.foo()' is deprecated"));
  }

  public void testDeprecationSuppression() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "@Deprecated class D {",
       "  static int bar;",
       "}",
       "class Buggy {",
       "  @Deprecated static void foo(){}",
View Full Code Here

  /**
   * Test for issue 8093.
   */
  public void testBadSuppression1() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "public class Buggy {",
       "  private static final String RAWTYPES = \"rawtypes\";",
       "  @SuppressWarnings(RAWTYPES)",
       "  public void method1() {",
       "  }",
View Full Code Here

  /**
   * Test for issue 8093.
   */
  public void testBadSuppression2() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "public class Buggy {",
       "  private static final String UNCHECKED = \"unchecked\";",
       "  @SuppressWarnings({\"rawtypes\", UNCHECKED})",
       "  public void method1() {",
       "  }",
View Full Code Here

    shouldGenerateWarning(buggy, 3,
        "Unable to analyze SuppressWarnings annotation, UNCHECKED not a string constant.");
  }

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

    shouldGenerateWarning(buggy, 6, "Referencing deprecated class 'D'");
  }

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

       "}");
    shouldGenerateNoWarning(buggy);
  }

  public void testFieldAccess() {
    MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
       "class Buggy {",
       "volatile long x = -1;",
       "native void jsniMeth() /*-{",
       "  $wnd.alert(\"x is: \"+this.@Buggy::x); }-*/;",
       "}");
View Full Code Here

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

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