Allow plugin IT test to get location of plugin data dir

Instead of creating a temp folder inside the tempSiteDir which is not
visible from plugin IT test class, create a tempDataDir in the
LightweightPluginDaemonTest. This allows plugin IT tests to put content
in the plugin data dir if needed for the test.

This is already how this is implemented on stable-2.15 because the
tempSiteDir not longer exists on that branch.

Change-Id: Ie392c0f5a5c2d73cf5d7c08a987743e0394eefb2
This commit is contained in:
Hugo Arès 2018-02-21 19:41:17 -05:00 committed by Hugo Arès
parent a0ae281aa9
commit 89992752b4

View File

@ -20,12 +20,16 @@ import com.google.gerrit.server.plugins.TestServerPlugin;
import com.google.inject.Inject;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
public class LightweightPluginDaemonTest extends AbstractDaemonTest {
@Inject private PluginGuiceEnvironment env;
@Inject private PluginUser.Factory pluginUserFactory;
@Rule public TemporaryFolder tempDataDir = new TemporaryFolder();
private TestServerPlugin plugin;
@Before
@ -41,7 +45,7 @@ public class LightweightPluginDaemonTest extends AbstractDaemonTest {
testPlugin.sysModule(),
testPlugin.httpModule(),
testPlugin.sshModule(),
tempSiteDir.newFolder().toPath());
tempDataDir.getRoot().toPath());
plugin.start(env);
env.onStartPlugin(plugin);