Search in sources :

Example 1 with SourceZip

use of com.github.javaparser.utils.SourceZip in project javaparser by javaparser.

the class BulkParseTest method parseJdkSrcZip.

private void parseJdkSrcZip() throws IOException {
    // This is where Ubuntu stores the contents of package openjdk-8-src
    Path path = Paths.get("/usr/lib/jvm/openjdk-9/src.zip");
    bulkTest(new SourceZip(path), "openjdk_src_zip_test_results.txt", new ParserConfiguration().setLanguageLevel(JAVA_9));
}
Also used : Path(java.nio.file.Path) SourceZip(com.github.javaparser.utils.SourceZip) ParserConfiguration(com.github.javaparser.ParserConfiguration)

Example 2 with SourceZip

use of com.github.javaparser.utils.SourceZip in project javaparser by javaparser.

the class BulkParseTest method parseOpenJdkLangToolsRepository.

private void parseOpenJdkLangToolsRepository() throws IOException {
    Path workdir = CodeGenerationUtils.mavenModuleRoot(BulkParseTest.class).resolve(Paths.get(temporaryDirectory(), "javaparser_bulkparsetest"));
    workdir.toFile().mkdirs();
    Path openJdkZipPath = workdir.resolve("langtools.zip");
    if (Files.notExists(openJdkZipPath)) {
        Log.info("Downloading JDK langtools");
        /* Found by choosing a tag here: http://hg.openjdk.java.net/jdk9/jdk9/langtools/tags
             then copying the "zip" link to the line below: */
        download(new URL("http://hg.openjdk.java.net/jdk10/jdk10/langtools/archive/19293ea3999f.zip"), openJdkZipPath);
    }
    bulkTest(new SourceZip(openJdkZipPath), "openjdk_src_repo_test_results.txt", new ParserConfiguration().setLanguageLevel(JAVA_10));
}
Also used : Path(java.nio.file.Path) SourceZip(com.github.javaparser.utils.SourceZip) URL(java.net.URL) ParserConfiguration(com.github.javaparser.ParserConfiguration)

Aggregations

ParserConfiguration (com.github.javaparser.ParserConfiguration)2 SourceZip (com.github.javaparser.utils.SourceZip)2 Path (java.nio.file.Path)2 URL (java.net.URL)1