From 666bbfbb7a0ae80b72c814dcd273883aa0cf7970 Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Fri, 16 Oct 2015 14:41:24 -0400 Subject: [PATCH] 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 --- .../com/google/gerrit/acceptance/PluginDaemonTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/PluginDaemonTest.java b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/PluginDaemonTest.java index f0b9f46afc..4c77edc586 100644 --- a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/PluginDaemonTest.java +++ b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/PluginDaemonTest.java @@ -43,7 +43,6 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest { private static final String BUCKOUT = "buck-out"; private Path gen; - private Path testSite; private Path pluginRoot; private Path pluginsSitePath; private Path pluginSubPath; @@ -51,6 +50,8 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest { private String pluginName; private boolean standalone; + protected Path testSite; + @Override protected void beforeTest(Description description) throws Exception { locatePaths(); @@ -58,9 +59,13 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest { buildPluginJar(); createTestSiteDirs(); copyJarToTestSite(); + beforeTestServerStarts(); super.beforeTest(description); } + protected void beforeTestServerStarts() throws Exception { + } + protected void setPluginConfigString(String name, String value) throws IOException, ConfigInvalidException { SitePaths sitePath = new SitePaths(testSite);