Hoist declaration of TestName up to GerritBaseTests

So it doesn't need to be declared in all the tests that use it.

Change-Id: Ib461165fa8b7b7b34ab619e6a34efb7656bb0968
This commit is contained in:
David Pursehouse
2018-06-05 11:47:46 +09:00
parent 1efa3082e5
commit cb13335e63
5 changed files with 2 additions and 16 deletions

View File

@@ -24,12 +24,8 @@ import com.google.inject.Injector;
import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.Config;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestName;
public class ElasticQueryChangesTest extends AbstractQueryChangesTest { public class ElasticQueryChangesTest extends AbstractQueryChangesTest {
@Rule public final TestName testName = new TestName();
private static ElasticNodeInfo nodeInfo; private static ElasticNodeInfo nodeInfo;
private static ElasticContainer<?> container; private static ElasticContainer<?> container;

View File

@@ -24,12 +24,8 @@ import com.google.inject.Injector;
import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.Config;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestName;
public class ElasticV5QueryChangesTest extends AbstractQueryChangesTest { public class ElasticV5QueryChangesTest extends AbstractQueryChangesTest {
@Rule public final TestName testName = new TestName();
private static ElasticNodeInfo nodeInfo; private static ElasticNodeInfo nodeInfo;
private static ElasticContainer<?> container; private static ElasticContainer<?> container;

View File

@@ -72,9 +72,7 @@ import org.eclipse.jgit.lib.Config;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TestName;
@Ignore @Ignore
public abstract class AbstractQueryAccountsTest extends GerritServerTests { public abstract class AbstractQueryAccountsTest extends GerritServerTests {
@@ -85,8 +83,6 @@ public abstract class AbstractQueryAccountsTest extends GerritServerTests {
return cfg; return cfg;
} }
@Rule public final TestName testName = new TestName();
@Inject protected AccountCache accountCache; @Inject protected AccountCache accountCache;
@Inject protected AccountManager accountManager; @Inject protected AccountManager accountManager;

View File

@@ -58,9 +58,7 @@ import org.eclipse.jgit.lib.Config;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TestName;
@Ignore @Ignore
public abstract class AbstractQueryGroupsTest extends GerritServerTests { public abstract class AbstractQueryGroupsTest extends GerritServerTests {
@@ -71,8 +69,6 @@ public abstract class AbstractQueryGroupsTest extends GerritServerTests {
return cfg; return cfg;
} }
@Rule public final TestName testName = new TestName();
@Inject protected AccountCache accountCache; @Inject protected AccountCache accountCache;
@Inject protected AccountManager accountManager; @Inject protected AccountManager accountManager;

View File

@@ -19,6 +19,7 @@ import com.google.gwtorm.server.StandardKeyEncoder;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Rule; import org.junit.Rule;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
import org.junit.rules.TestName;
@Ignore @Ignore
public abstract class GerritBaseTests { public abstract class GerritBaseTests {
@@ -27,4 +28,5 @@ public abstract class GerritBaseTests {
} }
@Rule public ExpectedException exception = ExpectedException.none(); @Rule public ExpectedException exception = ExpectedException.none();
@Rule public final TestName testName = new TestName();
} }