Run our unit tests with JDK11.
RELNOTES: None
@@ -22,6 +22,7 @@ import com.google.common.collect.Iterables;
import com.google.turbine.deps.AbstractTransitiveTest;
import com.google.turbine.options.TurbineOptions;
import java.io.IOException;
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.runner.RunWith;
@@ -30,19 +31,21 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class JavacTransitiveTest extends AbstractTransitiveTest {
- private static final ImmutableList<Path> BOOTCLASSPATH =
- ImmutableList.of(Paths.get(System.getProperty("java.home")).resolve("lib/rt.jar"));
+ private static final Path BOOTCLASSPATH =
+ Paths.get(System.getProperty("java.home")).resolve("lib/rt.jar");
@Override
protected Path runTurbine(ImmutableList<Path> sources, ImmutableList<Path> classpath)
throws IOException {
+ ImmutableList<Path> bootclasspath =
+ Files.exists(BOOTCLASSPATH) ? ImmutableList.of(BOOTCLASSPATH) : ImmutableList.of();
Path out = temporaryFolder.newFolder().toPath().resolve("out.jar");
boolean ok =
JavacTurbine.compile(
TurbineOptions.builder()
.addSources(sources.stream().map(Path::toString).collect(toList()))
.addClassPathEntries(classpath.stream().map(Path::toString).collect(toList()))
- .addBootClassPathEntries(Iterables.transform(BOOTCLASSPATH, Path::toString))
+ .addBootClassPathEntries(Iterables.transform(bootclasspath, Path::toString))
.setOutput(out.toString())
.build())
.ok();
