private static URL currentBaseUrl;
public static class OnAllServers {
public static Test suite() throws Exception {
final Report report = new Report(new File(System.getProperty("testsuite.results", "results.html")));
TestSuite result = new TestSuite() {
public void run(TestResult result) {
result.addListener(report);
report.startSuite();
super.run(result);
result.removeListener(report);
report.endSuite();
}
};
File configFile = new File(System.getProperty("testsuite.config", "tests.xml"));
ConfigReader config = new ConfigReader(configFile);
for ( Iterator servers = config.getServers().iterator(); servers.hasNext(); ) {
final Server server = (Server)servers.next();
final TestSuite serverSuite = new TestSuite((server.getName() + " " + server.getVersion()).replaceAll("\\.", "_")) {
public void run(TestResult result) {
currentBaseUrl = server.getBaseURL();
report.startServer(server);
super.run(result);
report.endServer();
}
};
addTests(serverSuite);
result.addTest(serverSuite);
}