Skip the WikipediaImport benchmark if no dump is specified
@@ -63,7 +63,14 @@ public class WikipediaImport extends Benchmark {
@Override
public void run(Iterable<RepositoryFixture> fixtures) {
- if (dump.isFile()) {
+ if (dump == null) {
+ System.out.format("Missing Wikipedia dump, skipping import benchmark.%n");
+ return;
+ }
+ if (!dump.isFile()) {
+ System.out.format("The Wikipedia dump at %s is not a file, skipping import benchmark.%n", dump.getPath());
+ return;
+ }
for (RepositoryFixture fixture : fixtures) {
if (fixture.isAvailable(1)) {
System.out.format(
@@ -82,11 +89,6 @@ public class WikipediaImport extends Benchmark {
System.out.format("%s: not available, skipping.%n", fixture);
}
}
- } else {
- System.out.format(
- "Missing Wikipedia dump %s, skipping import benchmark.%n",
- dump.getPath());
- }
}
protected void tearDown(RepositoryFixture fixture) throws IOException{
