Add optional setup for plugin acceptance tests /IT prior to server start

Allow plugin acceptance tests to optionally override a method called
before starting tests' gerrit server. That beforeTestServerStarts method
(introduced in PluginDaemonTest) adds no pre-start behaviour by default.
It is then meant to be overriden by plugin acceptance test classes on a
need basis solely.

Make PluginDaemonTest testSite accessible to extending plugin acceptance
tests. This is so that the latter can refer to it as per potential
beforeTestServerStarts work of theirs.

Exercised (required) by events-log plugin change id Ie6518c.

Change-Id: Ib3b50c52514859a364fc58b2d546b15436a860d2
This commit is contained in:
Marco Miller 2015-10-16 14:41:24 -04:00
parent 3bcec991e9
commit 666bbfbb7a

View File

@ -43,7 +43,6 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest {
private static final String BUCKOUT = "buck-out"; private static final String BUCKOUT = "buck-out";
private Path gen; private Path gen;
private Path testSite;
private Path pluginRoot; private Path pluginRoot;
private Path pluginsSitePath; private Path pluginsSitePath;
private Path pluginSubPath; private Path pluginSubPath;
@ -51,6 +50,8 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest {
private String pluginName; private String pluginName;
private boolean standalone; private boolean standalone;
protected Path testSite;
@Override @Override
protected void beforeTest(Description description) throws Exception { protected void beforeTest(Description description) throws Exception {
locatePaths(); locatePaths();
@ -58,9 +59,13 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest {
buildPluginJar(); buildPluginJar();
createTestSiteDirs(); createTestSiteDirs();
copyJarToTestSite(); copyJarToTestSite();
beforeTestServerStarts();
super.beforeTest(description); super.beforeTest(description);
} }
protected void beforeTestServerStarts() throws Exception {
}
protected void setPluginConfigString(String name, String value) protected void setPluginConfigString(String name, String value)
throws IOException, ConfigInvalidException { throws IOException, ConfigInvalidException {
SitePaths sitePath = new SitePaths(testSite); SitePaths sitePath = new SitePaths(testSite);