// Helper class for analyzing log output from a live process publicclass LogAnalyzer { privatefinal Path path;
public LogAnalyzer(String filename) throws IOException { this.path = Path.of(filename);
}
publicvoid shouldNotContain(String text) throws Exception {
System.out.println("Should not contain: '" + text + "'"); while (true) { try { for (String line : Files.readAllLines(path)) { if (line.contains(text)) { thrownew Exception("Found unexpected log message: " + line);
}
} return;
} catch (IOException e) {
System.out.println("Could not read log file " + path.toAbsolutePath());
e.printStackTrace();
} Thread.sleep(100);
}
}
publicvoid await(String text) throws InterruptedException {
System.out.println("Awaiting... '" + text + "' "); while (true) { try { for (String line : Files.readAllLines(path)) { if (line.contains(text)) {
System.out.println("Found!"); return;
}
}
} catch (IOException e) {
System.out.println("Could not read log file " + path.toAbsolutePath());
e.printStackTrace();
} Thread.sleep(100);
}
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.