use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method discreteVsContinuous.
// @Test
public void discreteVsContinuous() throws Exception {
TestScanner sc = newScanner();
Bench.population = 500;
Bench.scale = 10;
Path path = Paths.get(root, "restriction_stable.csv");
Files.deleteIfExists(path);
boolean first = true;
for (Restriction r : EnumSet.allOf(Restriction.class)) {
if (first) {
Bench.mode = Bench.Mode.SAVE;
first = !first;
} else {
Bench.mode = Bench.Mode.REPLAY;
}
System.out.println("--- Restriction: " + r + "; replay= " + first + " ---");
Bench.report = new CSVReport(path, r.toString());
sc.testGroups("bi").forEach(x -> {
Bench.restrictions = EnumSet.of(r);
System.out.println(x.go());
});
}
// restore
Bench.restrictions = EnumSet.allOf(Restriction.class);
}
use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method prettyErrors.
// @Test
public void prettyErrors() throws Exception {
TestScanner sc = newScanner();
Bench.mode = Bench.Mode.REPLAY;
Bench.population = 1000;
Bench.scale = 5;
sc.test(Bench.class).forEach(x -> {
x.reportTo(new StoredReport(Paths.get("xp-dsn", "errors.txt"), r -> !r.result().equals(Result.SUCCESS)));
System.out.println(x.go());
});
}
use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method newScanner.
public TestScanner newScanner() throws Exception {
SpecScanner specScanner = new SpecScanner();
List<Constraint> l = specScanner.scan();
Bench.mode = Bench.Mode.REPLAY;
return new TestScanner(l);
}
use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method errors.
// @Test
public void errors() throws Exception {
TestScanner sc = newScanner();
Bench.source = "xp-dsn";
Bench.mode = Bench.Mode.REPLAY;
Bench.population = 1000;
Bench.scale = 5;
Path p = Paths.get(root, "errors.csv");
Files.deleteIfExists(p);
Bench.report = new CSVReport(p, "");
sc.test(Bench.class).stream().forEach(x -> System.out.println(x.go()));
}
use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method specVsCheckers.
// @Test
public void specVsCheckers() throws Exception {
TestScanner sc = newScanner();
Bench.population = 500;
Bench.scale = 10;
Path p = Paths.get(root, "verifier_stable.csv");
Files.deleteIfExists(p);
boolean first = true;
for (Verifier v : new Verifier[] { new SpecVerifier(), new CheckerVerifier() }) {
if (first) {
Bench.mode = Bench.Mode.SAVE;
first = !first;
} else {
Bench.mode = Bench.Mode.REPLAY;
}
System.out.println("--- Verifier: " + v.getClass() + " ---");
Bench.report = new CSVReport(p, v.id());
sc.test(Bench.class).forEach(c -> {
c.verifyWith(v);
System.out.println(c.go().toString());
});
}
}
Aggregations