Annotate abstract test classes with @Ignore

According to I1a9b6ed53 Buck's test runner doesn't skip abstract
classes, but will if they are annotated as @Ignore.

This may not be true any more; Buck seems to be marking the classes as
NOTESTS.

Mark them as @Ignore anyway, even if it's only as documentation.

Also make classes abstract.

Change-Id: Ifc8deef60037bbf0b446542498ba9055037bf5d9
This commit is contained in:
David Pursehouse
2016-02-24 15:42:56 +09:00
parent f896a3eaa0
commit 2583a1736e
7 changed files with 20 additions and 3 deletions

View File

@@ -15,10 +15,12 @@
package com.google.gerrit.pgm.init;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.junit.Ignore;
import java.io.IOException;
import java.nio.file.Path;
@Ignore
public abstract class InitTestCase extends LocalDiskRepositoryTestCase {
protected Path newSitePath() throws IOException {
return createWorkRepository().getWorkTree().toPath().resolve("test_site");

View File

@@ -24,6 +24,9 @@ import com.google.gerrit.server.query.change.QueryOptions;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.ResultSet;
import org.junit.Ignore;
@Ignore
class FakeIndex implements ChangeIndex {
static Schema<ChangeData> V1 = new Schema<>(1,
ImmutableList.<FieldDef<ChangeData, ?>> of(

View File

@@ -20,6 +20,9 @@ import com.google.gerrit.server.query.change.ChangeData;
import com.google.gerrit.server.query.change.ChangeQueryBuilder;
import com.google.gwtorm.server.OrmException;
import org.junit.Ignore;
@Ignore
public class FakeQueryBuilder extends ChangeQueryBuilder {
FakeQueryBuilder(IndexCollection indexes) {
super(

View File

@@ -71,11 +71,13 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevWalk;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import java.sql.Timestamp;
import java.util.TimeZone;
public class AbstractChangeNotesTest extends GerritBaseTests {
@Ignore
public abstract class AbstractChangeNotesTest extends GerritBaseTests {
private static final TimeZone TZ =
TimeZone.getTimeZone("America/Los_Angeles");

View File

@@ -16,7 +16,10 @@ package com.google.gerrit.server.query;
import com.google.gerrit.testutil.GerritBaseTests;
public class PredicateTest extends GerritBaseTests {
import org.junit.Ignore;
@Ignore
public abstract class PredicateTest extends GerritBaseTests {
protected static final class TestPredicate extends OperatorPredicate<String> {
protected TestPredicate(String name, String value) {
super(name, value);

View File

@@ -60,6 +60,7 @@ import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import java.io.File;
import java.io.FileOutputStream;
@@ -69,6 +70,7 @@ import java.net.URL;
import java.util.List;
import java.util.Map;
@Ignore
public abstract class HookTestCase extends LocalDiskRepositoryTestCase {
protected Repository repository;
private final Map<String, File> hooks = Maps.newTreeMap();

View File

@@ -14,10 +14,12 @@
package com.google.gerrit.testutil;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
public class GerritBaseTests {
@Ignore
public abstract class GerritBaseTests {
@Rule
public ExpectedException exception = ExpectedException.none();
}