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

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


      for (String e : expectedErrors) {
        builder.expectError(e, null);
      }
    }
    UnitTestTreeLogger logger = builder.createLogger();
    StaticJavaResource buggyResource = new StaticJavaResource("Buggy",
        buggyCode);
    TypeOracleTestingUtils.buildStandardTypeOracleWith(logger,
        Collections.<Resource> emptySet(),
        CompilationStateTestBase.getGeneratedUnits(buggyResource));
    logger.assertCorrectLogEntries();
View Full Code Here


  /**
   * Creates a {@link Resource} and adds it the set of resources.
   */
  protected void addResource(String qualifiedTypeName, CharSequence source) {
    resources.add(new StaticJavaResource(qualifiedTypeName, source));
  }
View Full Code Here

    shouldGenerate(buggyCode, extraCode, TreeLogger.ERROR, error(line, message));
  }

  protected void shouldGenerateError(CharSequence buggyCode, CharSequence extraCode, int line,
      String message) {
    StaticJavaResource codeResource = new StaticJavaResource("Buggy", buggyCode);
    StaticJavaResource extraResource = new StaticJavaResource("Extra", extraCode);
    shouldGenerate(codeResource, extraResource, TreeLogger.ERROR,  error(line, message));
  }
View Full Code Here

  protected void shouldGenerateNoError(MockJavaResource code, MockJavaResource extraCode) {
    shouldGenerate(code, extraCode, TreeLogger.ERROR);
  }

  protected void shouldGenerateNoError(CharSequence code, CharSequence extraCode) {
    StaticJavaResource codeResource = new StaticJavaResource("Buggy", code);
    StaticJavaResource extraResource = new StaticJavaResource("Extra", extraCode);
    shouldGenerate(codeResource, extraResource, TreeLogger.ERROR);
  }
View Full Code Here

  private void addLongCheckingCups(Set<Resource> resources) {
    String code = Joiner.on('\n').join(
      "package com.google.gwt.core.client;",
      "public @interface UnsafeNativeLong {",
      "}");
    resources.add(new StaticJavaResource(
        "com.google.gwt.core.client.UnsafeNativeLong", code.toString()));
  }
View Full Code Here

    }
    assertEquals(3, info.getStartLine());
  }

  private List<JsNameRef> findJsniRefs(String typeName, final String source) {
    addGeneratedUnits(new StaticJavaResource(typeName, source));
    CompilationUnit unit = state.getCompilationUnitMap().get(typeName);
    assertNotNull(unit);
    List<JsniMethod> jsniMethods = unit.getJsniMethods();
    assertEquals(1, jsniMethods.size());
    JsniMethod jsniMethod = jsniMethods.get(0);
View Full Code Here

    }.accept(jsniMethod.function());
    return foundRefs;
  }

  private CategorizedProblem[] getProblems(String typeName, String source) {
    addGeneratedUnits(new StaticJavaResource(typeName, source));
    CompilationUnit unit = state.getCompilationUnitMap().get(typeName);
    assertNotNull(unit);
    CategorizedProblem[] problems = unit.getProblems();
    return problems;
  }
View Full Code Here

  }

  private StaticJavaResource makeClass(String className) {
    StringBuilder code = new StringBuilder();
    code.append("public class " + className + "{ }\n");
    StaticJavaResource e = new StaticJavaResource(className, code);
    return e;
  }
View Full Code Here

    code.append("package com.google.gwt.user.rebind.rpc;\n");
    code.append("import java.lang.annotation.Retention;");
    code.append("import java.lang.annotation.RetentionPolicy;");
    code.append("@Retention(RetentionPolicy.RUNTIME)");
    code.append("public @interface GwtTransient { }\n");
    resources.add(new StaticJavaResource("com.google.gwt.user.rebind.rpc.GwtTransient", code));
  }
View Full Code Here

  private static void addGwtTransient(Set<Resource> resources) {
    StringBuffer code = new StringBuffer();
    code.append("package com.google.gwt.user.client.rpc;\n");
    code.append("public @interface GwtTransient { }\n");
    resources.add(new StaticJavaResource("com.google.gwt.user.client.rpc.GwtTransient", code));
  }
View Full Code Here

TOP

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

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.