コード例 #1
0
  @Test
  public void testGetDescription() throws IOException {
    Jsr199Javac javac = createJavac(/* withSyntaxError */ false);
    String pathToOutputDir = new File(tmp.getRoot(), "out").getAbsolutePath();

    assertEquals(
        String.format(
            "javac -source %s -target %s -g "
                + "-d %s "
                + "-classpath '' "
                + "@"
                + pathToSrcsList.toString(),
            JavaBuckConfig.TARGETED_JAVA_VERSION,
            JavaBuckConfig.TARGETED_JAVA_VERSION,
            pathToOutputDir),
        javac.getDescription(
            ImmutableList.of(
                "-source",
                JavaBuckConfig.TARGETED_JAVA_VERSION,
                "-target",
                JavaBuckConfig.TARGETED_JAVA_VERSION,
                "-g",
                "-d",
                pathToOutputDir,
                "-classpath",
                "''"),
            SOURCE_PATHS,
            Optional.of(pathToSrcsList)));
  }