Acceptance tests: Write logs to junit tempdir

Pass the site path to the daemon so that it is available when the
error log file gets initialized.

Bug: Issue 4677
Change-Id: I0b88290c4b277f56a1277b52a08f04feb6eb56b5
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin 2016-09-30 15:17:42 +02:00
parent 1b944dffd8
commit 22c83e579b
3 changed files with 8 additions and 2 deletions

View File

@ -47,6 +47,7 @@ import java.lang.reflect.Field;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URI;
import java.nio.file.Paths;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.Callable;
import java.util.concurrent.CyclicBarrier;
@ -129,7 +130,7 @@ public class GerritServer {
throw new RuntimeException(e);
}
}
});
}, Paths.get(baseConfig.getString("gerrit", null, "tempSiteDir")));
daemon.setEmailModuleForTesting(new FakeEmailSender.Module());
final File site;

View File

@ -175,7 +175,8 @@ public class Daemon extends SiteProgram {
}
@VisibleForTesting
public Daemon(Runnable serverStarted) {
public Daemon(Runnable serverStarted, Path sitePath) {
super (sitePath);
this.serverStarted = serverStarted;
}

View File

@ -78,6 +78,10 @@ public abstract class SiteProgram extends AbstractProgram {
protected SiteProgram() {
}
protected SiteProgram(Path sitePath) {
this.sitePath = sitePath;
}
protected SiteProgram(Path sitePath, final Provider<DataSource> dsProvider) {
this.sitePath = sitePath;
this.dsProvider = dsProvider;