Remove GerritBaseTests

All functionality has been removed from this class.

Change-Id: I16e7bb8eccba0280e4bd638e4dd61bb8677f7cbf
This commit is contained in:
Dave Borowitz
2019-05-02 09:14:47 -07:00
parent 0700c0e1f8
commit a36b35809f
151 changed files with 150 additions and 318 deletions

View File

@@ -1,20 +0,0 @@
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.testing;
import org.junit.Ignore;
@Ignore
public abstract class GerritBaseTests {}

View File

@@ -21,7 +21,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.model.Statement;
@RunWith(ConfigSuite.class)
public class GerritServerTests extends GerritBaseTests {
public class GerritServerTests {
@ConfigSuite.Parameter public Config config;
@ConfigSuite.Name private String configName;

View File

@@ -18,14 +18,13 @@ import static com.google.common.truth.Truth.assertThat;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.File;
import java.nio.file.Files;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.util.FS;
import org.junit.Test;
public class MergeableFileBasedConfigTest extends GerritBaseTests {
public class MergeableFileBasedConfigTest {
@Test
public void mergeNull() throws Exception {
MergeableFileBasedConfig cfg = newConfig();

View File

@@ -31,7 +31,6 @@ import com.google.gerrit.server.index.account.AccountIndexer;
import com.google.gerrit.server.index.group.GroupIndexer;
import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.InMemoryRepositoryManager;
import com.google.gerrit.testing.TestTimeUtil;
import java.io.IOException;
@@ -50,7 +49,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ProjectResetterTest extends GerritBaseTests {
public class ProjectResetterTest {
private InMemoryRepositoryManager repoManager;
private Project.NameKey project;
private Repository repo;

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.common;
import static com.google.common.truth.Truth.assertThat;
import com.google.auto.value.AutoValue;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class AutoValueTest extends GerritBaseTests {
public class AutoValueTest {
@AutoValue
abstract static class Auto {
static Auto create(String val) {

View File

@@ -18,14 +18,13 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.junit.Before;
import org.junit.Test;
public class AccessSectionTest extends GerritBaseTests {
public class AccessSectionTest {
private static final String REF_PATTERN = "refs/heads/master";
private AccessSection accessSection;

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.common.data;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class EncodePathSeparatorTest extends GerritBaseTests {
public class EncodePathSeparatorTest {
@Test
public void defaultBehaviour() {
assertThat(new GitwebType().replacePathSeparator("a/b")).isEqualTo("a/b");

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.common.data;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class FilenameComparatorTest extends GerritBaseTests {
public class FilenameComparatorTest {
private FilenameComparator comparator = FilenameComparator.INSTANCE;
@Test

View File

@@ -19,10 +19,9 @@ import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.client.AccountGroup.UUID;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class GroupReferenceTest extends GerritBaseTests {
public class GroupReferenceTest {
@Test
public void forGroupDescription() {
String name = "foo";

View File

@@ -22,14 +22,13 @@ import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.LabelId;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.PatchSetApproval;
import com.google.gerrit.testing.GerritBaseTests;
import java.sql.Date;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
public class LabelFunctionTest extends GerritBaseTests {
public class LabelFunctionTest {
private static final String LABEL_NAME = "Verified";
private static final LabelId LABEL_ID = LabelId.create(LABEL_NAME);
private static final Change.Id CHANGE_ID = Change.id(100);

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.common.data;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class LabelTypeTest extends GerritBaseTests {
public class LabelTypeTest {
@Test
public void sortLabelValues() {
LabelValue v0 = new LabelValue((short) 0, "Zero");

View File

@@ -17,12 +17,11 @@ package com.google.gerrit.common.data;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableMap;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
public class ParameterizedStringTest extends GerritBaseTests {
public class ParameterizedStringTest {
@Test
public void emptyString() {
ParameterizedString p = new ParameterizedString("");

View File

@@ -19,11 +19,10 @@ import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.common.data.PermissionRule.Action;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Before;
import org.junit.Test;
public class PermissionRuleTest extends GerritBaseTests {
public class PermissionRuleTest {
private GroupReference groupReference;
private PermissionRule permissionRule;

View File

@@ -18,13 +18,12 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
public class PermissionTest extends GerritBaseTests {
public class PermissionTest {
private static final String PERMISSION_NAME = "foo";
private Permission permission;

View File

@@ -16,12 +16,11 @@ package com.google.gerrit.common.data;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.Collection;
import org.junit.Test;
public class SubmitRecordTest extends GerritBaseTests {
public class SubmitRecordTest {
private static final SubmitRecord OK_RECORD;
private static final SubmitRecord FORCED_RECORD;
private static final SubmitRecord NOT_READY_RECORD;

View File

@@ -25,14 +25,13 @@ import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import static java.util.stream.Collectors.toList;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.ProvisionException;
import java.util.Arrays;
import org.apache.http.HttpHost;
import org.eclipse.jgit.lib.Config;
import org.junit.Test;
public class ElasticConfigurationTest extends GerritBaseTests {
public class ElasticConfigurationTest {
@Test
public void singleServerNoOtherConfig() throws Exception {
Config cfg = newConfig();

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.elasticsearch;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class ElasticVersionTest extends GerritBaseTests {
public class ElasticVersionTest {
@Test
public void supportedVersion() throws Exception {
assertThat(ElasticVersion.forVersion("5.6.0")).isEqualTo(ElasticVersion.V5_6);

View File

@@ -16,12 +16,11 @@ package com.google.gerrit.extensions.api.lfs;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Test;
public class LfsDefinitionsTest extends GerritBaseTests {
public class LfsDefinitionsTest {
private static final String[] URL_PREFIXES = new String[] {"/", "/a/", "/p/", "/a/p/"};
@Test

View File

@@ -21,11 +21,10 @@ import static com.google.gerrit.extensions.client.ListOptionTest.MyOption.BAZ;
import static com.google.gerrit.extensions.client.ListOptionTest.MyOption.FOO;
import com.google.common.math.IntMath;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.EnumSet;
import org.junit.Test;
public class ListOptionTest extends GerritBaseTests {
public class ListOptionTest {
enum MyOption implements ListOption {
FOO(0),
BAR(1),

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.extensions.client;
import static com.google.gerrit.extensions.common.testing.RangeSubject.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class RangeTest extends GerritBaseTests {
public class RangeTest {
@Test
public void rangeOverMultipleLinesWithSmallerEndCharacterIsValid() {

View File

@@ -20,10 +20,9 @@ import static com.google.gerrit.extensions.conditions.BooleanCondition.or;
import static com.google.gerrit.extensions.conditions.BooleanCondition.valueOf;
import static org.junit.Assert.assertEquals;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class BooleanConditionTest extends GerritBaseTests {
public class BooleanConditionTest {
private static final BooleanCondition NO_TRIVIAL_EVALUATION =
new BooleanCondition() {

View File

@@ -17,14 +17,13 @@ package com.google.gerrit.extensions.registration;
import static com.google.common.truth.Truth.assertThat;
import static java.util.stream.Collectors.toSet;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.util.Providers;
import java.util.Iterator;
import org.junit.Test;
public class DynamicSetTest extends GerritBaseTests {
public class DynamicSetTest {
// In tests for {@link DynamicSet#contains(Object)}, be sure to avoid
// {@code assertThat(ds).contains(...) @} and
// {@code assertThat(ds).DoesNotContains(...) @} as (since

View File

@@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.common.io.MoreFiles;
import com.google.common.io.RecursiveDeleteOption;
import com.google.gerrit.testing.GerritBaseTests;
import java.nio.file.Files;
import java.nio.file.Path;
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
@@ -36,7 +35,7 @@ import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class)
public class RefUpdateUtilRepoTest extends GerritBaseTests {
public class RefUpdateUtilRepoTest {
public enum RepoSetup {
LOCAL_DISK {
@Override

View File

@@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.IOException;
import java.util.function.Consumer;
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
@@ -33,7 +32,7 @@ import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class RefUpdateUtilTest extends GerritBaseTests {
public class RefUpdateUtilTest {
private static final Consumer<ReceiveCommand> OK = c -> c.setResult(ReceiveCommand.Result.OK);
private static final Consumer<ReceiveCommand> LOCK_FAILURE =
c -> c.setResult(ReceiveCommand.Result.LOCK_FAILURE);

View File

@@ -18,10 +18,9 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.git.testing.PushResultSubject.parseProcessed;
import static com.google.gerrit.git.testing.PushResultSubject.trimMessages;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class PushResultSubjectTest extends GerritBaseTests {
public class PushResultSubjectTest {
@Test
public void testTrimMessages() {
assertThat(trimMessages(null)).isNull();

View File

@@ -41,7 +41,6 @@ import com.google.gerrit.server.account.AuthRequest;
import com.google.gerrit.server.account.externalids.ExternalId;
import com.google.gerrit.server.schema.SchemaCreator;
import com.google.gerrit.server.util.ThreadLocalRequestContext;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.InMemoryModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
@@ -64,7 +63,7 @@ import org.junit.Before;
import org.junit.Test;
/** Unit tests for {@link GerritPublicKeyChecker}. */
public class GerritPublicKeyCheckerTest extends GerritBaseTests {
public class GerritPublicKeyCheckerTest {
@Inject @ServerInitiated private Provider<AccountsUpdate> accountsUpdateProvider;
@Inject private AccountManager accountManager;

View File

@@ -38,7 +38,6 @@ import static org.bouncycastle.openpgp.PGPSignature.DIRECT_KEY;
import static org.junit.Assert.assertEquals;
import com.google.gerrit.gpg.testing.TestKey;
import com.google.gerrit.testing.GerritBaseTests;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -60,7 +59,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class PublicKeyCheckerTest extends GerritBaseTests {
public class PublicKeyCheckerTest {
private InMemoryRepository repo;
private PublicKeyStore store;

View File

@@ -29,7 +29,6 @@ import static org.junit.Assert.assertTrue;
import com.google.common.collect.Iterators;
import com.google.gerrit.gpg.testing.TestKey;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@@ -51,7 +50,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
import org.junit.Before;
import org.junit.Test;
public class PublicKeyStoreTest extends GerritBaseTests {
public class PublicKeyStoreTest {
private TestRepository<?> tr;
private PublicKeyStore store;

View File

@@ -23,7 +23,6 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import com.google.gerrit.gpg.testing.TestKey;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
@@ -54,7 +53,7 @@ import org.eclipse.jgit.transport.SignedPushConfig;
import org.junit.Before;
import org.junit.Test;
public class PushCertificateCheckerTest extends GerritBaseTests {
public class PushCertificateCheckerTest {
private InMemoryRepository repo;
private PublicKeyStore store;
private SignedPushConfig signedPushConfig;

View File

@@ -21,7 +21,6 @@ import static org.easymock.EasyMock.eq;
import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.extensions.registration.ReloadableRegistrationHandle;
import com.google.gerrit.server.plugins.Plugin;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.util.http.testutil.FakeHttpServletRequest;
import com.google.gerrit.util.http.testutil.FakeHttpServletResponse;
import com.google.inject.Key;
@@ -36,7 +35,7 @@ import org.easymock.IMocksControl;
import org.junit.Before;
import org.junit.Test;
public class AllRequestFilterFilterProxyTest extends GerritBaseTests {
public class AllRequestFilterFilterProxyTest {
/**
* Set of filters for FilterProxy
*

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.httpd;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.httpd.RemoteUserUtil.extractUsername;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class RemoteUserUtilTest extends GerritBaseTests {
public class RemoteUserUtilTest {
@Test
public void testExtractUsername() {
assertThat(extractUsername(null)).isNull();

View File

@@ -16,12 +16,11 @@ package com.google.gerrit.httpd.plugins;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.util.http.testutil.FakeHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import org.junit.Test;
public class ContextMapperTest extends GerritBaseTests {
public class ContextMapperTest {
private static final String CONTEXT = "/context";
private static final String PLUGIN_NAME = "my-plugin";

View File

@@ -17,12 +17,11 @@ package com.google.gerrit.httpd.raw;
import static com.google.common.truth.Truth.assertThat;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.template.soy.data.SoyMapData;
import java.net.URISyntaxException;
import org.junit.Test;
public class IndexServletTest extends GerritBaseTests {
public class IndexServletTest {
static class TestIndexServlet extends IndexServlet {
private static final long serialVersionUID = 1L;

View File

@@ -29,7 +29,6 @@ import com.google.common.io.ByteStreams;
import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import com.google.gerrit.httpd.raw.ResourceServlet.Resource;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.util.http.testutil.FakeHttpServletRequest;
import com.google.gerrit.util.http.testutil.FakeHttpServletResponse;
import java.io.ByteArrayInputStream;
@@ -46,7 +45,7 @@ import java.util.zip.GZIPInputStream;
import org.junit.Before;
import org.junit.Test;
public class ResourceServletTest extends GerritBaseTests {
public class ResourceServletTest {
private static Cache<Path, Resource> newCache(int size) {
return CacheBuilder.newBuilder().maximumSize(size).recordStats().build();
}

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.httpd.restapi;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class HttpLogRedactTest extends GerritBaseTests {
public class HttpLogRedactTest {
@Test
public void redactAuth() {
assertThat(LogRedactUtil.redactQueryString("query=status:open")).isEqualTo("query=status:open");

View File

@@ -22,14 +22,13 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.gerrit.extensions.restapi.BadRequestException;
import com.google.gerrit.httpd.restapi.ParameterParser.QueryParams;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.util.http.testutil.FakeHttpServletRequest;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import org.junit.Test;
public class ParameterParserTest extends GerritBaseTests {
public class ParameterParserTest {
@Test
public void convertFormToJson() throws BadRequestException {
JsonObject obj =

View File

@@ -20,12 +20,11 @@ import static com.google.gerrit.index.SchemaUtil.getPersonParts;
import static com.google.gerrit.index.SchemaUtil.schema;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.Map;
import org.eclipse.jgit.lib.PersonIdent;
import org.junit.Test;
public class SchemaUtilTest extends GerritBaseTests {
public class SchemaUtilTest {
static class TestSchemas {
static final Schema<String> V1 = schema();
static final Schema<String> V2 = schema();

View File

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

View File

@@ -17,12 +17,11 @@ package com.google.gerrit.index.query;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.truth.ThrowableSubject;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.Collection;
import java.util.Objects;
import org.junit.Test;
public class QueryBuilderTest extends GerritBaseTests {
public class QueryBuilderTest {
private static class TestPredicate extends Predicate<Object> {
private final String field;
private final String value;

View File

@@ -23,11 +23,10 @@ import static com.google.gerrit.index.query.QueryParser.SINGLE_WORD;
import static com.google.gerrit.index.query.QueryParser.parse;
import static com.google.gerrit.index.query.testing.TreeSubject.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.antlr.runtime.tree.Tree;
import org.junit.Test;
public class QueryParserTest extends GerritBaseTests {
public class QueryParserTest {
@Test
public void fieldNameAndValue() throws Exception {
Tree r = parse("project:tools/gerrit");

View File

@@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.Comment;
import com.google.gerrit.testing.GerritBaseTests;
import java.sql.Timestamp;
import java.time.Instant;
import java.util.ArrayList;
@@ -26,7 +25,7 @@ import java.util.List;
import org.junit.Ignore;
@Ignore
public class AbstractParserTest extends GerritBaseTests {
public class AbstractParserTest {
protected static final String CHANGE_URL =
"https://gerrit-review.googlesource.com/c/project/+/123";

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.mail;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class AddressTest extends GerritBaseTests {
public class AddressTest {
@Test
public void parse_NameEmail1() {
final Address a = Address.parse("A U Thor <author@example.com>");

View File

@@ -16,14 +16,13 @@ package com.google.gerrit.mail;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.ZoneOffset;
import org.junit.Test;
public class MailHeaderParserTest extends GerritBaseTests {
public class MailHeaderParserTest {
@Test
public void parseMetadataFromHeader() {
// This tests if the metadata parser is able to parse metadata from the

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.mail;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class ParserUtilTest extends GerritBaseTests {
public class ParserUtilTest {
@Test
public void trimQuotationLineOnMessageWithoutQuoatationLine() throws Exception {
assertThat(ParserUtil.trimQuotation("One line")).isEqualTo("One line");

View File

@@ -23,10 +23,9 @@ import com.google.gerrit.mail.data.NonUTF8Message;
import com.google.gerrit.mail.data.QuotedPrintableHeaderMessage;
import com.google.gerrit.mail.data.RawMailMessage;
import com.google.gerrit.mail.data.SimpleTextMessage;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class RawMailParserTest extends GerritBaseTests {
public class RawMailParserTest {
@Test
public void parseEmail() throws Exception {
RawMailMessage[] messages =

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.metrics.dropwizard;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class DropWizardMetricMakerTest extends GerritBaseTests {
public class DropWizardMetricMakerTest {
DropWizardMetricMaker metrics =
new DropWizardMetricMaker(null /* MetricRegistry unused in tests */);

View File

@@ -31,7 +31,6 @@ import com.google.gerrit.metrics.Description.FieldOrdering;
import com.google.gerrit.metrics.Field;
import com.google.gerrit.metrics.MetricMaker;
import com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
@@ -40,7 +39,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Before;
import org.junit.Test;
public class ProcMetricModuleTest extends GerritBaseTests {
public class ProcMetricModuleTest {
@Inject MetricMaker metrics;
@Inject MetricRegistry registry;

View File

@@ -21,12 +21,11 @@ import static org.junit.Assert.assertNotNull;
import com.google.gerrit.pgm.init.api.ConsoleUI;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.testing.GerritBaseTests;
import java.nio.file.Paths;
import java.util.Collections;
import org.junit.Test;
public class LibrariesTest extends GerritBaseTests {
public class LibrariesTest {
@Test
public void create() throws Exception {
final SitePaths site = new SitePaths(Paths.get("."));

View File

@@ -19,12 +19,11 @@ import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat;
import com.google.gerrit.server.cache.proto.Cache.ChangeNotesKeyProto;
import com.google.gerrit.server.cache.proto.Cache.ChangeNotesStateProto;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.protobuf.ByteString;
import java.util.Arrays;
import org.junit.Test;
public class ProtosTest extends GerritBaseTests {
public class ProtosTest {
@Test
public void parseUncheckedByteArrayWrongProtoType() {
ChangeNotesKeyProto proto =

View File

@@ -16,12 +16,11 @@ package com.google.gerrit.reviewdb.client;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
public class PatchSetApprovalTest extends GerritBaseTests {
public class PatchSetApprovalTest {
@Test
public void keyEquality() {
PatchSetApproval.Key k1 =

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.reviewdb.client;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class PatchTest extends GerritBaseTests {
public class PatchTest {
@Test
public void isMagic() {
assertThat(Patch.isMagic("/COMMIT_MSG")).isTrue();

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.reviewdb.client;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class ProjectTest extends GerritBaseTests {
public class ProjectTest {
@Test
public void parseId() {
assertThat(Project.NameKey.parse("foo")).isEqualTo(new Project.NameKey("foo"));

View File

@@ -16,11 +16,10 @@ package com.google.gerrit.server;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.regex.Pattern;
import org.junit.Test;
public class ChangeUtilTest extends GerritBaseTests {
public class ChangeUtilTest {
@Test
public void changeMessageUuid() throws Exception {
Pattern pat = Pattern.compile("^[0-9a-f]{8}_[0-9a-f]{8}$");

View File

@@ -31,7 +31,6 @@ import com.google.gerrit.server.group.SystemGroupBackend;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.ConfigSuite;
import com.google.gerrit.testing.FakeAccountCache;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
@@ -45,7 +44,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(ConfigSuite.class)
public class IdentifiedUserTest extends GerritBaseTests {
public class IdentifiedUserTest {
@ConfigSuite.Parameter public Config config;
private IdentifiedUser identifiedUser;

View File

@@ -29,14 +29,13 @@ import com.google.gerrit.server.account.AccountResolver.StringSearcher;
import com.google.gerrit.server.account.AccountResolver.UnresolvableAccountException;
import com.google.gerrit.server.config.AllUsersName;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.Arrays;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
import org.junit.Test;
public class AccountResolverTest extends GerritBaseTests {
public class AccountResolverTest {
private class TestSearcher extends StringSearcher {
private final String pattern;
private final boolean shortCircuit;

View File

@@ -17,13 +17,12 @@ package com.google.gerrit.server.account;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.junit.Test;
public class AuthorizedKeysTest extends GerritBaseTests {
public class AuthorizedKeysTest {
private static final String KEY1 =
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCgug5VyMXQGnem2H1KVC4/HcRcD4zzBqS"
+ "uJBRWVonSSoz3RoAZ7bWXCVVGwchtXwUURD689wFYdiPecOrWOUgeeyRq754YWRhU+W28"

View File

@@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.reviewdb.client.BranchNameKey;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.git.ValidationError;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
@@ -27,7 +26,7 @@ import java.util.List;
import java.util.Set;
import org.junit.Test;
public class DestinationListTest extends GerritBaseTests {
public class DestinationListTest {
public static final String R_FOO = "refs/heads/foo";
public static final String R_BAR = "refs/heads/bar";

View File

@@ -17,11 +17,10 @@ package com.google.gerrit.server.account;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.testing.GerritBaseTests;
import org.eclipse.jgit.lib.PersonIdent;
import org.junit.Test;
public class GroupUUIDTest extends GerritBaseTests {
public class GroupUUIDTest {
@Test
public void createdUuidsForSameInputShouldBeDifferent() {
String groupName = "Users";

View File

@@ -18,11 +18,10 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.common.base.Strings;
import com.google.gerrit.testing.GerritBaseTests;
import org.apache.commons.codec.DecoderException;
import org.junit.Test;
public class HashedPasswordTest extends GerritBaseTests {
public class HashedPasswordTest {
@Test
public void encodeOneLine() throws Exception {

View File

@@ -17,12 +17,11 @@ package com.google.gerrit.server.account;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.server.git.ValidationError;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
public class QueryListTest extends GerritBaseTests {
public class QueryListTest {
public static final String Q_P = "project:foo";
public static final String Q_B = "branch:bar";
public static final String Q_COMPLEX = "branch:bar AND peers:'is:open\t'";

View File

@@ -37,13 +37,12 @@ import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.group.SystemGroupBackend;
import com.google.gerrit.server.plugincontext.PluginContext.PluginMetrics;
import com.google.gerrit.server.plugincontext.PluginSetContext;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.Set;
import org.eclipse.jgit.lib.Config;
import org.junit.Before;
import org.junit.Test;
public class UniversalGroupBackendTest extends GerritBaseTests {
public class UniversalGroupBackendTest {
private static final AccountGroup.UUID OTHER_UUID = AccountGroup.uuid("other");
private UniversalGroupBackend backend;

View File

@@ -25,13 +25,12 @@ import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.server.account.externalids.AllExternalIds.Serializer;
import com.google.gerrit.server.cache.proto.Cache.AllExternalIdsProto;
import com.google.gerrit.server.cache.proto.Cache.AllExternalIdsProto.ExternalIdProto;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.TypeLiteral;
import java.util.Arrays;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
public class AllExternalIdsTest extends GerritBaseTests {
public class AllExternalIdsTest {
@Test
public void serializeEmptyExternalIds() throws Exception {
assertRoundTrip(allExternalIds(), AllExternalIdsProto.getDefaultInstance());

View File

@@ -17,11 +17,10 @@ package com.google.gerrit.server.cache;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.function.Supplier;
import org.junit.Test;
public class PerThreadCacheTest extends GerritBaseTests {
public class PerThreadCacheTest {
@Test
public void key_respectsClass() {
assertThat(PerThreadCache.Key.create(String.class))

View File

@@ -18,11 +18,10 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.protobuf.TextFormat;
import org.junit.Test;
public class BooleanCacheSerializerTest extends GerritBaseTests {
public class BooleanCacheSerializerTest {
@Test
public void serialize() throws Exception {
assertThat(BooleanCacheSerializer.INSTANCE.serialize(true))

View File

@@ -19,10 +19,9 @@ import static com.google.common.truth.Truth.assert_;
import com.google.auto.value.AutoValue;
import com.google.common.base.Converter;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class CacheSerializerTest extends GerritBaseTests {
public class CacheSerializerTest {
@AutoValue
abstract static class MyAutoValue {
static MyAutoValue create(int val) {

View File

@@ -18,10 +18,9 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class EnumCacheSerializerTest extends GerritBaseTests {
public class EnumCacheSerializerTest {
@Test
public void serialize() throws Exception {
assertRoundTrip(MyEnum.FOO);

View File

@@ -19,11 +19,10 @@ import static com.google.common.truth.Truth.assert_;
import com.google.common.collect.ImmutableList;
import com.google.common.primitives.Bytes;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.protobuf.TextFormat;
import org.junit.Test;
public class IntegerCacheSerializerTest extends GerritBaseTests {
public class IntegerCacheSerializerTest {
@Test
public void serialize() throws Exception {
for (int i :

View File

@@ -17,11 +17,10 @@ package com.google.gerrit.server.cache.serialize;
import static com.google.common.truth.Truth.assertThat;
import com.google.auto.value.AutoValue;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.Serializable;
import org.junit.Test;
public class JavaCacheSerializerTest extends GerritBaseTests {
public class JavaCacheSerializerTest {
@Test
public void builtInTypes() throws Exception {
assertRoundTrip("foo");

View File

@@ -18,11 +18,10 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static com.google.gerrit.server.cache.testing.CacheSerializerTestUtil.byteArray;
import com.google.gerrit.testing.GerritBaseTests;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
public class ObjectIdCacheSerializerTest extends GerritBaseTests {
public class ObjectIdCacheSerializerTest {
@Test
public void serialize() {
ObjectId id = ObjectId.fromString("aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");

View File

@@ -18,12 +18,11 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static com.google.gerrit.server.cache.testing.CacheSerializerTestUtil.byteString;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.protobuf.ByteString;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
public class ObjectIdConverterTest extends GerritBaseTests {
public class ObjectIdConverterTest {
@Test
public void objectIdFromByteString() {
ObjectIdConverter idConverter = ObjectIdConverter.create();

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.server.cache.serialize;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.proto.testing.Test.SerializableProto;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class ProtobufSerializerTest extends GerritBaseTests {
public class ProtobufSerializerTest {
@Test
public void requiredAndOptionalTypes() {
assertRoundTrip(SerializableProto.newBuilder().setId(123));

View File

@@ -17,12 +17,11 @@ package com.google.gerrit.server.cache.serialize;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import com.google.gerrit.testing.GerritBaseTests;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.StandardCharsets;
import org.junit.Test;
public class StringCacheSerializerTest extends GerritBaseTests {
public class StringCacheSerializerTest {
@Test
public void serialize() {
assertThat(StringCacheSerializer.INSTANCE.serialize("")).isEmpty();

View File

@@ -24,11 +24,10 @@ import com.google.gerrit.proto.testing.SerializedClassSubject;
import com.google.gerrit.server.cache.proto.Cache.ChangeKindKeyProto;
import com.google.gerrit.server.cache.serialize.CacheSerializer;
import com.google.gerrit.server.change.ChangeKindCacheImpl.Key;
import com.google.gerrit.testing.GerritBaseTests;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
public class ChangeKindCacheImplTest extends GerritBaseTests {
public class ChangeKindCacheImplTest {
@Test
public void keySerializer() throws Exception {
ChangeKindCacheImpl.Key key =

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.server.change;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.collect.Sets;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class HashtagsTest extends GerritBaseTests {
public class HashtagsTest {
@Test
public void emptyCommitMessage() throws Exception {
assertThat(HashtagsUtil.extractTags("")).isEmpty();

View File

@@ -17,7 +17,6 @@ package com.google.gerrit.server.change;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.reviewdb.client.RefNames.REFS_TAGS;
import com.google.gerrit.testing.GerritBaseTests;
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
import org.eclipse.jgit.junit.TestRepository;
@@ -27,7 +26,7 @@ import org.eclipse.jgit.revwalk.RevTag;
import org.junit.Before;
import org.junit.Test;
public class IncludedInResolverTest extends GerritBaseTests {
public class IncludedInResolverTest {
// Branch names
private static final String BRANCH_MASTER = "master";
private static final String BRANCH_1_0 = "rel-1.0";

View File

@@ -45,7 +45,6 @@ import com.google.gerrit.server.project.ProjectConfig;
import com.google.gerrit.server.schema.SchemaCreator;
import com.google.gerrit.server.util.ThreadLocalRequestContext;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.InMemoryModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
@@ -57,7 +56,7 @@ import org.junit.Before;
import org.junit.Test;
/** Unit tests for {@link LabelNormalizer}. */
public class LabelNormalizerTest extends GerritBaseTests {
public class LabelNormalizerTest {
@Inject private AccountManager accountManager;
@Inject private AllProjectsName allProjects;
@Inject private GitRepositoryManager repoManager;

View File

@@ -23,11 +23,10 @@ import com.google.common.collect.ImmutableMap;
import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.proto.testing.SerializedClassSubject;
import com.google.gerrit.server.cache.proto.Cache.MergeabilityKeyProto;
import com.google.gerrit.testing.GerritBaseTests;
import org.eclipse.jgit.lib.ObjectId;
import org.junit.Test;
public class MergeabilityCacheImplTest extends GerritBaseTests {
public class MergeabilityCacheImplTest {
@Test
public void keySerializer() throws Exception {
MergeabilityCacheImpl.EntryKey key =

View File

@@ -25,7 +25,6 @@ import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.change.WalkSorter.PatchSetData;
import com.google.gerrit.server.query.change.ChangeData;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.InMemoryRepositoryManager;
import com.google.gerrit.testing.InMemoryRepositoryManager.Repo;
import com.google.gerrit.testing.TestChanges;
@@ -38,7 +37,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
import org.junit.Before;
import org.junit.Test;
public class WalkSorterTest extends GerritBaseTests {
public class WalkSorterTest {
private Account.Id userId;
private InMemoryRepositoryManager repoManager;

View File

@@ -22,14 +22,13 @@ import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;
import com.google.gerrit.extensions.client.Theme;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.lib.Config;
import org.junit.Test;
public class ConfigUtilTest extends GerritBaseTests {
public class ConfigUtilTest {
private static final String SECT = "foo";
private static final String SUB = "bar";

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.server.config;
import static com.google.common.truth.Truth.assertWithMessage;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class GitwebConfigTest extends GerritBaseTests {
public class GitwebConfigTest {
private static final String VALID_CHARACTERS = "*()";
private static final String SOME_INVALID_CHARACTERS = "09AZaz$-_.+!',";

View File

@@ -27,7 +27,6 @@ import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.permissions.PermissionBackend;
import com.google.gerrit.server.restapi.config.ListCapabilities;
import com.google.gerrit.server.restapi.config.ListCapabilities.CapabilityInfo;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -36,7 +35,7 @@ import java.util.Map;
import org.junit.Before;
import org.junit.Test;
public class ListCapabilitiesTest extends GerritBaseTests {
public class ListCapabilitiesTest {
private Injector injector;
@Before

View File

@@ -20,7 +20,6 @@ import static com.google.common.truth.Truth8.assertThat;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.extensions.client.SubmitType;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.testing.GerritBaseTests;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
@@ -28,7 +27,7 @@ import org.eclipse.jgit.lib.Config;
import org.junit.Before;
import org.junit.Test;
public class RepositoryConfigTest extends GerritBaseTests {
public class RepositoryConfigTest {
private Config cfg;
private RepositoryConfig repoCfg;

View File

@@ -22,7 +22,6 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.MINUTES;
import com.google.gerrit.server.config.ScheduleConfig.Schedule;
import com.google.gerrit.testing.GerritBaseTests;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.ZoneOffset;
@@ -32,7 +31,7 @@ import java.util.concurrent.TimeUnit;
import org.eclipse.jgit.lib.Config;
import org.junit.Test;
public class ScheduleConfigTest extends GerritBaseTests {
public class ScheduleConfigTest {
// Friday June 13, 2014 10:00 UTC
private static final ZonedDateTime NOW =

View File

@@ -19,7 +19,6 @@ import static com.google.common.truth.Truth8.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.server.ioutil.HostPlatform;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.NotDirectoryException;
@@ -27,7 +26,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Test;
public class SitePathsTest extends GerritBaseTests {
public class SitePathsTest {
@Test
public void create_NotExisting() throws IOException {
final Path root = random();

View File

@@ -20,10 +20,9 @@ import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class ChangeEditTest extends GerritBaseTests {
public class ChangeEditTest {
@Test
public void changeEditRef() throws Exception {
Account.Id accountId = Account.id(1000042);

View File

@@ -25,12 +25,11 @@ import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.RefUpdateAttribute;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gson.Gson;
import java.sql.Timestamp;
import org.junit.Test;
public class EventDeserializerTest extends GerritBaseTests {
public class EventDeserializerTest {
private final Gson gson = new EventGsonProvider().get();
@Test

View File

@@ -30,7 +30,6 @@ import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.RefUpdateAttribute;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.TestTimeUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
@@ -39,7 +38,7 @@ import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
public class EventJsonTest extends GerritBaseTests {
public class EventJsonTest {
private static final String BRANCH = "mybranch";
private static final String CHANGE_ID = "Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
private static final int CHANGE_NUM = 1000;

View File

@@ -16,10 +16,9 @@ package com.google.gerrit.server.events;
import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class EventTypesTest extends GerritBaseTests {
public class EventTypesTest {
public static class TestEvent extends Event {
private static final String TYPE = "test-event";

View File

@@ -32,7 +32,6 @@ import com.google.gerrit.server.permissions.PermissionBackend.RefFilterOptions;
import com.google.gerrit.server.permissions.PermissionBackendCondition;
import com.google.gerrit.server.permissions.PermissionBackendException;
import com.google.gerrit.server.permissions.ProjectPermission;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
@@ -41,7 +40,7 @@ import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.junit.Test;
public class UiActionsTest extends GerritBaseTests {
public class UiActionsTest {
private static class FakeForProject extends ForProject {
private boolean allowValueQueries = true;

View File

@@ -27,7 +27,6 @@ import com.google.gerrit.reviewdb.client.FixReplacement;
import com.google.gerrit.server.change.FileContentUtil;
import com.google.gerrit.server.edit.tree.TreeModification;
import com.google.gerrit.server.project.ProjectState;
import com.google.gerrit.testing.GerritBaseTests;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@@ -37,7 +36,7 @@ import org.eclipse.jgit.lib.Repository;
import org.junit.Before;
import org.junit.Test;
public class FixReplacementInterpreterTest extends GerritBaseTests {
public class FixReplacementInterpreterTest {
private final FileContentUtil fileContentUtil = createMock(FileContentUtil.class);
private final Repository repository = createMock(Repository.class);
private final ProjectState projectState = createMock(ProjectState.class);

View File

@@ -17,10 +17,9 @@ package com.google.gerrit.server.fixes;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class LineIdentifierTest extends GerritBaseTests {
public class LineIdentifierTest {
@Test
public void lineNumberMustBePositive() {
LineIdentifier lineIdentifier = new LineIdentifier("First line\nSecond line");

View File

@@ -17,11 +17,10 @@ package com.google.gerrit.server.fixes;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Before;
import org.junit.Test;
public class StringModifierTest extends GerritBaseTests {
public class StringModifierTest {
private final String originalString = "This is the original, unmodified string.";
private StringModifier stringModifier;

View File

@@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.SortedSetMultimap;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.testing.GerritBaseTests;
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
import org.eclipse.jgit.junit.TestRepository;
@@ -32,7 +31,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
import org.junit.Before;
import org.junit.Test;
public class GroupCollectorTest extends GerritBaseTests {
public class GroupCollectorTest {
private TestRepository<?> tr;
@Before

View File

@@ -21,7 +21,6 @@ import static com.google.gerrit.testing.GerritJUnit.assertThrows;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.ioutil.HostPlatform;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -37,7 +36,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class LocalDiskRepositoryManagerTest extends GerritBaseTests {
public class LocalDiskRepositoryManagerTest {
@Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
private Config cfg;

View File

@@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableList;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.config.RepositoryConfig;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.testing.GerritBaseTests;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -42,7 +41,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class MultiBaseLocalDiskRepositoryManagerTest extends GerritBaseTests {
public class MultiBaseLocalDiskRepositoryManagerTest {
@Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
private Config cfg;

View File

@@ -21,10 +21,9 @@ import static com.google.gerrit.proto.testing.SerializedClassSubject.assertThatS
import com.google.common.collect.ImmutableMap;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.cache.proto.Cache.TagSetHolderProto;
import com.google.gerrit.testing.GerritBaseTests;
import org.junit.Test;
public class TagSetHolderTest extends GerritBaseTests {
public class TagSetHolderTest {
@Test
public void serializerWithTagSet() throws Exception {
TagSetHolder holder = new TagSetHolder(Project.nameKey("project"));

View File

@@ -30,7 +30,6 @@ import com.google.gerrit.server.cache.proto.Cache.TagSetHolderProto.TagSetProto.
import com.google.gerrit.server.cache.proto.Cache.TagSetHolderProto.TagSetProto.TagProto;
import com.google.gerrit.server.git.TagSet.CachedRef;
import com.google.gerrit.server.git.TagSet.Tag;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.inject.TypeLiteral;
import java.lang.reflect.Type;
import java.util.Arrays;
@@ -43,7 +42,7 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectIdOwnerMap;
import org.junit.Test;
public class TagSetTest extends GerritBaseTests {
public class TagSetTest {
@Test
public void roundTripToProto() {
HashMap<String, CachedRef> refs = new HashMap<>();

View File

@@ -27,7 +27,6 @@ import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
import com.google.gerrit.server.git.meta.VersionedMetaData.BatchMetaDataUpdate;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.TestTimeUtil;
import java.io.IOException;
import java.util.Arrays;
@@ -51,7 +50,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class VersionedMetaDataTest extends GerritBaseTests {
public class VersionedMetaDataTest {
// If you're considering fleshing out this test and making it more comprehensive, please consider
// instead coming up with a replacement interface for
// VersionedMetaData/BatchMetaDataUpdate/MetaDataUpdate that is easier to use correctly.

View File

@@ -28,7 +28,6 @@ import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
import com.google.gerrit.server.git.meta.MetaDataUpdate;
import com.google.gerrit.server.group.InternalGroup;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.testing.InMemoryRepositoryManager;
import java.io.IOException;
import java.sql.Timestamp;
@@ -44,7 +43,7 @@ import org.junit.Before;
import org.junit.Ignore;
@Ignore
public class AbstractGroupTest extends GerritBaseTests {
public class AbstractGroupTest {
protected static final TimeZone TZ = TimeZone.getTimeZone("America/Los_Angeles");
protected static final String SERVER_ID = "server-id";
protected static final String SERVER_NAME = "Gerrit Server";

View File

@@ -35,7 +35,6 @@ import com.google.gerrit.server.git.meta.MetaDataUpdate;
import com.google.gerrit.server.group.InternalGroup;
import com.google.gerrit.server.group.testing.InternalGroupSubject;
import com.google.gerrit.server.util.time.TimeUtil;
import com.google.gerrit.testing.GerritBaseTests;
import com.google.gerrit.truth.OptionalSubject;
import java.io.IOException;
import java.sql.Timestamp;
@@ -57,7 +56,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
import org.junit.Before;
import org.junit.Test;
public class GroupConfigTest extends GerritBaseTests {
public class GroupConfigTest {
private Project.NameKey projectName;
private Repository repository;
private TestRepository<?> testRepository;

Some files were not shown because too many files have changed in this diff Show More