Remove test prefix from test methods

We previously used 'test' to prefix tests but have decided to stop this.
This change removes the prefix from all test code.

Change-Id: I229a36751adc6a87fbae8d6f373671e141529496
This commit is contained in:
Patrick Hiesel
2016-12-06 09:27:46 +01:00
parent b7944aedac
commit a02a5c01e9
80 changed files with 543 additions and 542 deletions

View File

@@ -111,7 +111,7 @@ public class IdentifiedUserTest {
}
@Test
public void testEmailsExistence() {
public void emailsExistence() {
assertThat(identifiedUser.hasEmailAddress(TEST_CASES[0])).isTrue();
assertThat(identifiedUser.hasEmailAddress(TEST_CASES[1].toLowerCase())).isTrue();
assertThat(identifiedUser.hasEmailAddress(TEST_CASES[1])).isTrue();

View File

@@ -24,7 +24,7 @@ public class StringUtilTest {
* should be escaped.
*/
@Test
public void testEscapeFirstChar() {
public void escapeFirstChar() {
assertEquals(StringUtil.escapeString("\tLeading tab"), "\\tLeading tab");
}
@@ -33,7 +33,7 @@ public class StringUtilTest {
* should be escaped.
*/
@Test
public void testEscapeLastChar() {
public void escapeLastChar() {
assertEquals(StringUtil.escapeString("Trailing tab\t"), "Trailing tab\\t");
}
@@ -42,7 +42,7 @@ public class StringUtilTest {
* in the expected way.
*/
@Test
public void testEscapeString() {
public void escapeString() {
final String[] testPairs =
{ "", "",
"plain string", "plain string",

View File

@@ -85,7 +85,7 @@ public class AuthorizedKeysTest {
}
@Test
public void testParseWindowsLineEndings() throws Exception {
public void parseWindowsLineEndings() throws Exception {
List<Optional<AccountSshKey>> keys = new ArrayList<>();
StringBuilder authorizedKeys = new StringBuilder();
authorizedKeys.append(toWindowsLineEndings(addKey(keys, KEY1)));

View File

@@ -62,14 +62,14 @@ public class UniversalGroupBackendTest extends GerritBaseTests {
}
@Test
public void testHandles() {
public void handles() {
assertTrue(backend.handles(ANONYMOUS_USERS));
assertTrue(backend.handles(PROJECT_OWNERS));
assertFalse(backend.handles(OTHER_UUID));
}
@Test
public void testGet() {
public void get() {
assertEquals("Registered Users",
backend.get(REGISTERED_USERS).getName());
assertEquals("Project Owners",
@@ -78,14 +78,14 @@ public class UniversalGroupBackendTest extends GerritBaseTests {
}
@Test
public void testSuggest() {
public void suggest() {
assertTrue(backend.suggest("X", null).isEmpty());
assertEquals(1, backend.suggest("project", null).size());
assertEquals(1, backend.suggest("reg", null).size());
}
@Test
public void testSytemGroupMemberships() {
public void sytemGroupMemberships() {
GroupMembership checker = backend.membershipsOf(user);
assertTrue(checker.contains(REGISTERED_USERS));
assertFalse(checker.contains(OTHER_UUID));
@@ -93,7 +93,7 @@ public class UniversalGroupBackendTest extends GerritBaseTests {
}
@Test
public void testKnownGroups() {
public void knownGroups() {
GroupMembership checker = backend.membershipsOf(user);
Set<UUID> knownGroups = checker.getKnownGroups();
assertEquals(2, knownGroups.size());
@@ -102,7 +102,7 @@ public class UniversalGroupBackendTest extends GerritBaseTests {
}
@Test
public void testOtherMemberships() {
public void otherMemberships() {
final AccountGroup.UUID handled = new AccountGroup.UUID("handled");
final AccountGroup.UUID notHandled = new AccountGroup.UUID("not handled");
final IdentifiedUser member = createNiceMock(IdentifiedUser.class);

View File

@@ -75,7 +75,7 @@ public class ConfigUtilTest {
}
@Test
public void testStoreLoadSection() throws Exception {
public void storeLoadSection() throws Exception {
SectionInfo d = SectionInfo.defaults();
SectionInfo in = new SectionInfo();
in.missing = "42";
@@ -142,7 +142,7 @@ public class ConfigUtilTest {
}
@Test
public void testTimeUnit() {
public void timeUnit() {
assertEquals(ms(0, MILLISECONDS), parse("0"));
assertEquals(ms(2, MILLISECONDS), parse("2ms"));
assertEquals(ms(200, MILLISECONDS), parse("200 milliseconds"));

View File

@@ -25,14 +25,14 @@ public class GitwebConfigTest {
private static final String SOME_INVALID_CHARACTERS = "09AZaz$-_.+!',";
@Test
public void testValidPathSeparator() {
public void validPathSeparator() {
for (char c : VALID_CHARACTERS.toCharArray()) {
assertTrue("valid character rejected: " + c, GitwebConfig.isValidPathSeparator(c));
}
}
@Test
public void testInalidPathSeparator() {
public void inalidPathSeparator() {
for (char c : SOME_INVALID_CHARACTERS.toCharArray()) {
assertFalse("invalid character accepted: " + c, GitwebConfig.isValidPathSeparator(c));
}

View File

@@ -55,7 +55,7 @@ public class ListCapabilitiesTest {
}
@Test
public void testList() throws Exception {
public void list() throws Exception {
Map<String, CapabilityInfo> m =
injector.getInstance(ListCapabilities.class)
.apply(new ConfigResource());

View File

@@ -40,13 +40,13 @@ public class RepositoryConfigTest {
}
@Test
public void testDefaultSubmitTypeWhenNotConfigured() {
public void defaultSubmitTypeWhenNotConfigured() {
assertThat(repoCfg.getDefaultSubmitType(new NameKey("someProject")))
.isEqualTo(SubmitType.MERGE_IF_NECESSARY);
}
@Test
public void testDefaultSubmitTypeForStarFilter() {
public void defaultSubmitTypeForStarFilter() {
configureDefaultSubmitType("*", SubmitType.CHERRY_PICK);
assertThat(repoCfg.getDefaultSubmitType(new NameKey("someProject")))
.isEqualTo(SubmitType.CHERRY_PICK);
@@ -65,7 +65,7 @@ public class RepositoryConfigTest {
}
@Test
public void testDefaultSubmitTypeForSpecificFilter() {
public void defaultSubmitTypeForSpecificFilter() {
configureDefaultSubmitType("someProject", SubmitType.CHERRY_PICK);
assertThat(repoCfg.getDefaultSubmitType(new NameKey("someOtherProject")))
.isEqualTo(SubmitType.MERGE_IF_NECESSARY);
@@ -74,7 +74,7 @@ public class RepositoryConfigTest {
}
@Test
public void testDefaultSubmitTypeForStartWithFilter() {
public void defaultSubmitTypeForStartWithFilter() {
configureDefaultSubmitType("somePath/somePath/*",
SubmitType.REBASE_IF_NECESSARY);
configureDefaultSubmitType("somePath/*", SubmitType.CHERRY_PICK);
@@ -100,12 +100,12 @@ public class RepositoryConfigTest {
}
@Test
public void testOwnerGroupsWhenNotConfigured() {
public void ownerGroupsWhenNotConfigured() {
assertThat(repoCfg.getOwnerGroups(new NameKey("someProject"))).isEmpty();
}
@Test
public void testOwnerGroupsForStarFilter() {
public void ownerGroupsForStarFilter() {
ImmutableList<String> ownerGroups = ImmutableList.of("group1", "group2");
configureOwnerGroups("*", ownerGroups);
assertThat(repoCfg.getOwnerGroups(new NameKey("someProject")))
@@ -113,7 +113,7 @@ public class RepositoryConfigTest {
}
@Test
public void testOwnerGroupsForSpecificFilter() {
public void ownerGroupsForSpecificFilter() {
ImmutableList<String> ownerGroups = ImmutableList.of("group1", "group2");
configureOwnerGroups("someProject", ownerGroups);
assertThat(repoCfg.getOwnerGroups(new NameKey("someOtherProject")))
@@ -123,7 +123,7 @@ public class RepositoryConfigTest {
}
@Test
public void testOwnerGroupsForStartWithFilter() {
public void ownerGroupsForStartWithFilter() {
ImmutableList<String> ownerGroups1 = ImmutableList.of("group1");
ImmutableList<String> ownerGroups2 = ImmutableList.of("group2");
ImmutableList<String> ownerGroups3 = ImmutableList.of("group3");
@@ -150,12 +150,12 @@ public class RepositoryConfigTest {
}
@Test
public void testBasePathWhenNotConfigured() {
public void basePathWhenNotConfigured() {
assertThat((Object)repoCfg.getBasePath(new NameKey("someProject"))).isNull();
}
@Test
public void testBasePathForStarFilter() {
public void basePathForStarFilter() {
String basePath = "/someAbsolutePath/someDirectory";
configureBasePath("*", basePath);
assertThat(repoCfg.getBasePath(new NameKey("someProject")).toString())
@@ -163,7 +163,7 @@ public class RepositoryConfigTest {
}
@Test
public void testBasePathForSpecificFilter() {
public void basePathForSpecificFilter() {
String basePath = "/someAbsolutePath/someDirectory";
configureBasePath("someProject", basePath);
assertThat((Object) repoCfg.getBasePath(new NameKey("someOtherProject")))
@@ -173,7 +173,7 @@ public class RepositoryConfigTest {
}
@Test
public void testBasePathForStartWithFilter() {
public void basePathForStartWithFilter() {
String basePath1 = "/someAbsolutePath1/someDirectory";
String basePath2 = "someRelativeDirectory2";
String basePath3 = "/someAbsolutePath3/someDirectory";
@@ -196,7 +196,7 @@ public class RepositoryConfigTest {
}
@Test
public void testAllBasePath() {
public void allBasePath() {
ImmutableList<Path> allBasePaths = ImmutableList.of(
Paths.get("/someBasePath1"),
Paths.get("/someBasePath2"),

View File

@@ -32,7 +32,7 @@ public class ScheduleConfigTest {
private static final DateTime NOW = DateTime.parse("2014-06-13T10:00:00-00:00");
@Test
public void testInitialDelay() throws Exception {
public void initialDelay() throws Exception {
assertEquals(ms(1, HOURS), initialDelay("11:00", "1h"));
assertEquals(ms(30, MINUTES), initialDelay("05:30", "1h"));
assertEquals(ms(30, MINUTES), initialDelay("09:30", "1h"));
@@ -56,7 +56,7 @@ public class ScheduleConfigTest {
}
@Test
public void testCustomKeys() {
public void customKeys() {
Config rc = new Config();
rc.setString("a", "b", "i", "1h");
rc.setString("a", "b", "s", "01:00");

View File

@@ -33,7 +33,7 @@ import java.nio.file.Paths;
public class SitePathsTest extends GerritBaseTests {
@Test
public void testCreate_NotExisting() throws IOException {
public void create_NotExisting() throws IOException {
final Path root = random();
final SitePaths site = new SitePaths(root);
assertTrue(site.isNew);
@@ -42,7 +42,7 @@ public class SitePathsTest extends GerritBaseTests {
}
@Test
public void testCreate_Empty() throws IOException {
public void create_Empty() throws IOException {
final Path root = random();
try {
Files.createDirectory(root);
@@ -56,7 +56,7 @@ public class SitePathsTest extends GerritBaseTests {
}
@Test
public void testCreate_NonEmpty() throws IOException {
public void create_NonEmpty() throws IOException {
final Path root = random();
final Path txt = root.resolve("test.txt");
try {
@@ -73,7 +73,7 @@ public class SitePathsTest extends GerritBaseTests {
}
@Test
public void testCreate_NotDirectory() throws IOException {
public void create_NotDirectory() throws IOException {
final Path root = random();
try {
Files.createFile(root);
@@ -85,7 +85,7 @@ public class SitePathsTest extends GerritBaseTests {
}
@Test
public void testResolve() throws IOException {
public void resolve() throws IOException {
final Path root = random();
final SitePaths site = new SitePaths(root);

View File

@@ -28,7 +28,7 @@ import org.junit.Test;
public class EventDeserializerTest {
@Test
public void testRefUpdatedEvent() {
public void refUpdatedEvent() {
RefUpdatedEvent refUpdatedEvent = new RefUpdatedEvent();
RefUpdateAttribute refUpdatedAttribute = new RefUpdateAttribute();

View File

@@ -34,7 +34,7 @@ public class EventTypesTest {
}
@Test
public void testEventTypeRegistration() {
public void eventTypeRegistration() {
EventTypes.register(TestEvent.TYPE, TestEvent.class);
EventTypes.register(AnotherTestEvent.TYPE, AnotherTestEvent.class);
assertThat(EventTypes.getClass(TestEvent.TYPE)).isEqualTo(TestEvent.class);
@@ -43,7 +43,7 @@ public class EventTypesTest {
}
@Test
public void testGetClassForNonExistingType() {
public void getClassForNonExistingType() {
Class<?> clazz = EventTypes.getClass("does-not-exist-event");
assertThat(clazz).isNull();
}

View File

@@ -54,7 +54,7 @@ public class GroupListTest {
}
@Test
public void testByUUID() throws Exception {
public void byUUID() throws Exception {
AccountGroup.UUID uuid =
new AccountGroup.UUID("d96b998f8a66ff433af50befb975d0e2bb6e0999");
@@ -65,7 +65,7 @@ public class GroupListTest {
}
@Test
public void testPut() {
public void put() {
AccountGroup.UUID uuid = new AccountGroup.UUID("abc");
GroupReference groupReference = new GroupReference(uuid, "Hutzliputz");
@@ -77,7 +77,7 @@ public class GroupListTest {
}
@Test
public void testReferences() throws Exception {
public void references() throws Exception {
Collection<GroupReference> result = groupList.references();
assertEquals(2, result.size());
@@ -89,7 +89,7 @@ public class GroupListTest {
}
@Test
public void testUUIDs() throws Exception {
public void uUIDs() throws Exception {
Set<AccountGroup.UUID> result = groupList.uuids();
assertEquals(2, result.size());
@@ -99,7 +99,7 @@ public class GroupListTest {
}
@Test
public void testValidationError() throws Exception {
public void validationError() throws Exception {
ValidationError.Sink sink = createMock(ValidationError.Sink.class);
sink.error(anyObject(ValidationError.class));
expectLastCall().times(2);
@@ -109,7 +109,7 @@ public class GroupListTest {
}
@Test
public void testRetainAll() throws Exception {
public void retainAll() throws Exception {
AccountGroup.UUID uuid =
new AccountGroup.UUID("d96b998f8a66ff433af50befb975d0e2bb6e0999");
groupList.retainUUIDs(Collections.singleton(uuid));
@@ -120,7 +120,7 @@ public class GroupListTest {
}
@Test
public void testAsText() throws Exception {
public void asText() throws Exception {
assertTrue(TEXT.equals(groupList.asText()));
}
}

View File

@@ -64,7 +64,7 @@ public class LocalDiskRepositoryManagerTest extends EasyMockSupport {
}
@Test
public void testProjectCreation() throws Exception {
public void projectCreation() throws Exception {
Project.NameKey projectA = new Project.NameKey("projectA");
try (Repository repo = repoManager.createRepository(projectA)) {
assertThat(repo).isNotNull();
@@ -181,7 +181,7 @@ public class LocalDiskRepositoryManagerTest extends EasyMockSupport {
}
@Test
public void testOpenRepositoryCreatedDirectlyOnDisk() throws Exception {
public void openRepositoryCreatedDirectlyOnDisk() throws Exception {
Project.NameKey projectA = new Project.NameKey("projectA");
createRepository(repoManager.getBasePath(projectA), projectA.get());
try (Repository repo = repoManager.openRepository(projectA)) {
@@ -231,7 +231,7 @@ public class LocalDiskRepositoryManagerTest extends EasyMockSupport {
}
@Test
public void testList() throws Exception {
public void list() throws Exception {
Project.NameKey projectA = new Project.NameKey("projectA");
createRepository(repoManager.getBasePath(projectA), projectA.get());

View File

@@ -69,7 +69,7 @@ public class MultiBaseLocalDiskRepositoryManagerTest extends GerritBaseTests {
}
@Test
public void testDefaultRepositoryLocation()
public void defaultRepositoryLocation()
throws RepositoryCaseMismatchException, RepositoryNotFoundException,
IOException {
Project.NameKey someProjectKey = new Project.NameKey("someProject");
@@ -97,7 +97,7 @@ public class MultiBaseLocalDiskRepositoryManagerTest extends GerritBaseTests {
}
@Test
public void testAlternateRepositoryLocation() throws IOException {
public void alternateRepositoryLocation() throws IOException {
Path alternateBasePath = TempFileUtil.createTempDirectory().toPath();
Project.NameKey someProjectKey = new Project.NameKey("someProject");
reset(configMock);
@@ -130,7 +130,7 @@ public class MultiBaseLocalDiskRepositoryManagerTest extends GerritBaseTests {
}
@Test
public void testListReturnRepoFromProperLocation() throws IOException {
public void listReturnRepoFromProperLocation() throws IOException {
Project.NameKey basePathProject = new Project.NameKey("basePathProject");
Project.NameKey altPathProject = new Project.NameKey("altPathProject");
Project.NameKey misplacedProject1 =

View File

@@ -78,7 +78,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testReadConfig() throws Exception {
public void readConfig() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//
@@ -125,7 +125,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testReadConfigLabelDefaultValue() throws Exception {
public void readConfigLabelDefaultValue() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//
@@ -142,7 +142,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testReadConfigLabelDefaultValueInRange() throws Exception {
public void readConfigLabelDefaultValueInRange() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//
@@ -160,7 +160,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testReadConfigLabelDefaultValueNotInRange() throws Exception {
public void readConfigLabelDefaultValueNotInRange() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//
@@ -179,7 +179,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testReadConfigLabelScores() throws Exception {
public void readConfigLabelScores() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//
@@ -203,7 +203,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testEditConfig() throws Exception {
public void editConfig() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//
@@ -256,7 +256,7 @@ public class ProjectConfigTest extends LocalDiskRepositoryTestCase {
}
@Test
public void testEditConfigMissingGroupTableEntry() throws Exception {
public void editConfigMissingGroupTableEntry() throws Exception {
RevCommit rev = util.commit(util.tree( //
util.file("groups", util.blob(group(developers))), //
util.file("project.config", util.blob(""//

View File

@@ -65,13 +65,13 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testIndexPredicate() throws Exception {
public void indexPredicate() throws Exception {
Predicate<ChangeData> in = parse("file:a");
assertThat(rewrite(in)).isEqualTo(query(in));
}
@Test
public void testNonIndexPredicate() throws Exception {
public void nonIndexPredicate() throws Exception {
Predicate<ChangeData> in = parse("foo:a");
Predicate<ChangeData> out = rewrite(in);
assertThat(AndChangeSource.class).isSameAs(out.getClass());
@@ -81,13 +81,13 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testIndexPredicates() throws Exception {
public void indexPredicates() throws Exception {
Predicate<ChangeData> in = parse("file:a file:b");
assertThat(rewrite(in)).isEqualTo(query(in));
}
@Test
public void testNonIndexPredicates() throws Exception {
public void nonIndexPredicates() throws Exception {
Predicate<ChangeData> in = parse("foo:a OR foo:b");
Predicate<ChangeData> out = rewrite(in);
assertThat(AndChangeSource.class).isSameAs(out.getClass());
@@ -97,7 +97,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testOneIndexPredicate() throws Exception {
public void oneIndexPredicate() throws Exception {
Predicate<ChangeData> in = parse("foo:a file:b");
Predicate<ChangeData> out = rewrite(in);
assertThat(AndChangeSource.class).isSameAs(out.getClass());
@@ -109,7 +109,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testThreeLevelTreeWithAllIndexPredicates() throws Exception {
public void threeLevelTreeWithAllIndexPredicates() throws Exception {
Predicate<ChangeData> in =
parse("-status:abandoned (file:a OR file:b)");
assertThat(rewrite.rewrite(in, options(0, DEFAULT_MAX_QUERY_LIMIT)))
@@ -117,7 +117,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testThreeLevelTreeWithSomeIndexPredicates() throws Exception {
public void threeLevelTreeWithSomeIndexPredicates() throws Exception {
Predicate<ChangeData> in = parse("-foo:a (file:b OR file:c)");
Predicate<ChangeData> out = rewrite(in);
assertThat(out.getClass()).isSameAs(AndChangeSource.class);
@@ -129,7 +129,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testMultipleIndexPredicates() throws Exception {
public void multipleIndexPredicates() throws Exception {
Predicate<ChangeData> in =
parse("file:a OR foo:b OR file:c OR foo:d");
Predicate<ChangeData> out = rewrite(in);
@@ -143,7 +143,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testIndexAndNonIndexPredicates() throws Exception {
public void indexAndNonIndexPredicates() throws Exception {
Predicate<ChangeData> in = parse("status:new bar:p file:a");
Predicate<ChangeData> out = rewrite(in);
assertThat(AndChangeSource.class).isSameAs(out.getClass());
@@ -155,7 +155,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testDuplicateCompoundNonIndexOnlyPredicates() throws Exception {
public void duplicateCompoundNonIndexOnlyPredicates() throws Exception {
Predicate<ChangeData> in =
parse("(status:new OR status:draft) bar:p file:a");
Predicate<ChangeData> out = rewrite(in);
@@ -168,7 +168,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testDuplicateCompoundIndexOnlyPredicates() throws Exception {
public void duplicateCompoundIndexOnlyPredicates() throws Exception {
Predicate<ChangeData> in =
parse("(status:new OR file:a) bar:p file:b");
Predicate<ChangeData> out = rewrite(in);
@@ -181,7 +181,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testOptionsArgumentOverridesAllLimitPredicates()
public void optionsArgumentOverridesAllLimitPredicates()
throws Exception {
Predicate<ChangeData> in = parse("limit:1 file:a limit:3");
Predicate<ChangeData> out = rewrite(in, options(0, 5));
@@ -195,7 +195,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testStartIncreasesLimitInQueryButNotPredicate() throws Exception {
public void startIncreasesLimitInQueryButNotPredicate() throws Exception {
int n = 3;
Predicate<ChangeData> f = parse("file:a");
Predicate<ChangeData> l = parse("limit:" + n);
@@ -209,7 +209,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testGetPossibleStatus() throws Exception {
public void getPossibleStatus() throws Exception {
assertThat(status("file:a")).isEqualTo(EnumSet.allOf(Change.Status.class));
assertThat(status("is:new")).containsExactly(NEW);
assertThat(status("-is:new"))
@@ -225,7 +225,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testUnsupportedIndexOperator() throws Exception {
public void unsupportedIndexOperator() throws Exception {
Predicate<ChangeData> in = parse("status:merged file:a");
assertThat(rewrite(in)).isEqualTo(query(in));
@@ -240,7 +240,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testTooManyTerms() throws Exception {
public void tooManyTerms() throws Exception {
String q = "file:a OR file:b OR file:c";
Predicate<ChangeData> in = parse(q);
assertEquals(query(in), rewrite(in));
@@ -258,7 +258,7 @@ public class ChangeIndexRewriterTest extends GerritBaseTests {
}
@Test
public void testAddingStartToLimitDoesNotExceedBackendLimit() throws Exception {
public void addingStartToLimitDoesNotExceedBackendLimit() throws Exception {
int max = CONFIG.maxLimit();
assertEquals(options(0, max), convertOptions(options(0, max)));
assertEquals(options(0, max), convertOptions(options(1, max)));

View File

@@ -48,7 +48,7 @@ public class ColumnFormatterTest {
* Test that only lines with at least one column of text emit output.
*/
@Test
public void testEmptyLine() {
public void emptyLine() {
final PrintWriterComparator comparator = new PrintWriterComparator();
final ColumnFormatter formatter =
new ColumnFormatter(comparator.getPrintWriter(), '\t');
@@ -67,7 +67,7 @@ public class ColumnFormatterTest {
* Test that there is no output if no columns are ever added.
*/
@Test
public void testEmptyOutput() {
public void emptyOutput() {
final PrintWriterComparator comparator = new PrintWriterComparator();
final ColumnFormatter formatter =
new ColumnFormatter(comparator.getPrintWriter(), '\t');
@@ -82,7 +82,7 @@ public class ColumnFormatterTest {
* the output immediately after the creation of the {@link ColumnFormatter}.
*/
@Test
public void testNoNextLine() {
public void noNextLine() {
final PrintWriterComparator comparator = new PrintWriterComparator();
final ColumnFormatter formatter =
new ColumnFormatter(comparator.getPrintWriter(), '\t');
@@ -95,7 +95,7 @@ public class ColumnFormatterTest {
* (which of course shouldn't be escaped) is left alone.
*/
@Test
public void testEscapingTakesPlace() {
public void escapingTakesPlace() {
final PrintWriterComparator comparator = new PrintWriterComparator();
final ColumnFormatter formatter =
new ColumnFormatter(comparator.getPrintWriter(), '\t');
@@ -112,7 +112,7 @@ public class ColumnFormatterTest {
* of columns in each line varies.
*/
@Test
public void testMultiLineDifferentColumnCount() {
public void multiLineDifferentColumnCount() {
final PrintWriterComparator comparator = new PrintWriterComparator();
final ColumnFormatter formatter =
new ColumnFormatter(comparator.getPrintWriter(), '\t');
@@ -131,7 +131,7 @@ public class ColumnFormatterTest {
* Test that we get the correct output with a single column of input.
*/
@Test
public void testOneColumn() {
public void oneColumn() {
final PrintWriterComparator comparator = new PrintWriterComparator();
final ColumnFormatter formatter =
new ColumnFormatter(comparator.getPrintWriter(), '\t');

View File

@@ -23,63 +23,63 @@ import org.junit.Test;
public class AddressTest extends GerritBaseTests {
@Test
public void testParse_NameEmail1() {
public void parse_NameEmail1() {
final Address a = Address.parse("A U Thor <author@example.com>");
assertThat(a.name).isEqualTo("A U Thor");
assertThat(a.email).isEqualTo("author@example.com");
}
@Test
public void testParse_NameEmail2() {
public void parse_NameEmail2() {
final Address a = Address.parse("A <a@b>");
assertThat(a.name).isEqualTo("A");
assertThat(a.email).isEqualTo("a@b");
}
@Test
public void testParse_NameEmail3() {
public void parse_NameEmail3() {
final Address a = Address.parse("<a@b>");
assertThat(a.name).isNull();
assertThat(a.email).isEqualTo("a@b");
}
@Test
public void testParse_NameEmail4() {
public void parse_NameEmail4() {
final Address a = Address.parse("A U Thor<author@example.com>");
assertThat(a.name).isEqualTo("A U Thor");
assertThat(a.email).isEqualTo("author@example.com");
}
@Test
public void testParse_NameEmail5() {
public void parse_NameEmail5() {
final Address a = Address.parse("A U Thor <author@example.com>");
assertThat(a.name).isEqualTo("A U Thor");
assertThat(a.email).isEqualTo("author@example.com");
}
@Test
public void testParse_Email1() {
public void parse_Email1() {
final Address a = Address.parse("author@example.com");
assertThat(a.name).isNull();
assertThat(a.email).isEqualTo("author@example.com");
}
@Test
public void testParse_Email2() {
public void parse_Email2() {
final Address a = Address.parse("a@b");
assertThat(a.name).isNull();
assertThat(a.email).isEqualTo("a@b");
}
@Test
public void testParse_NewTLD() {
public void parse_NewTLD() {
Address a = Address.parse("A U Thor <author@example.systems>");
assertThat(a.name).isEqualTo("A U Thor");
assertThat(a.email).isEqualTo("author@example.systems");
}
@Test
public void testParseInvalid() {
public void parseInvalid() {
assertInvalid("");
assertInvalid("a");
assertInvalid("a<");
@@ -107,49 +107,49 @@ public class AddressTest extends GerritBaseTests {
}
@Test
public void testToHeaderString_NameEmail1() {
public void toHeaderString_NameEmail1() {
assertThat(format("A", "a@a")).isEqualTo("A <a@a>");
}
@Test
public void testToHeaderString_NameEmail2() {
public void toHeaderString_NameEmail2() {
assertThat(format("A B", "a@a")).isEqualTo("A B <a@a>");
}
@Test
public void testToHeaderString_NameEmail3() {
public void toHeaderString_NameEmail3() {
assertThat(format("A B. C", "a@a")).isEqualTo("\"A B. C\" <a@a>");
}
@Test
public void testToHeaderString_NameEmail4() {
public void toHeaderString_NameEmail4() {
assertThat(format("A B, C", "a@a")).isEqualTo("\"A B, C\" <a@a>");
}
@Test
public void testToHeaderString_NameEmail5() {
public void toHeaderString_NameEmail5() {
assertThat(format("A \" C", "a@a")).isEqualTo("\"A \\\" C\" <a@a>");
}
@Test
public void testToHeaderString_NameEmail6() {
public void toHeaderString_NameEmail6() {
assertThat(format("A \u20ac B", "a@a"))
.isEqualTo("=?UTF-8?Q?A_=E2=82=AC_B?= <a@a>");
}
@Test
public void testToHeaderString_NameEmail7() {
public void toHeaderString_NameEmail7() {
assertThat(format("A \u20ac B (Code Review)", "a@a"))
.isEqualTo("=?UTF-8?Q?A_=E2=82=AC_B_=28Code_Review=29?= <a@a>");
}
@Test
public void testToHeaderString_Email1() {
public void toHeaderString_Email1() {
assertThat(format(null, "a@a")).isEqualTo("a@a");
}
@Test
public void testToHeaderString_Email2() {
public void toHeaderString_Email2() {
assertThat(format(null, "a,b@a")).isEqualTo("<a,b@a>");
}

View File

@@ -27,7 +27,7 @@ import org.junit.Test;
public class MetadataParserTest {
@Test
public void testParseMetadataFromHeader() {
public void parseMetadataFromHeader() {
// This tests if the metadata parser is able to parse metadata from the
// email headers of the message.
MailMessage.Builder b = MailMessage.builder();
@@ -56,7 +56,7 @@ public class MetadataParserTest {
}
@Test
public void testParseMetadataFromText() {
public void parseMetadataFromText() {
// This tests if the metadata parser is able to parse metadata from the
// the text body of the message.
MailMessage.Builder b = MailMessage.builder();
@@ -88,7 +88,7 @@ public class MetadataParserTest {
}
@Test
public void testParseMetadataFromHTML() {
public void parseMetadataFromHTML() {
// This tests if the metadata parser is able to parse metadata from the
// the HTML body of the message.
MailMessage.Builder b = MailMessage.builder();

View File

@@ -29,7 +29,7 @@ import org.junit.Test;
public class RawMailParserTest extends GerritBaseTests {
@Test
public void testParseEmail() throws Exception {
public void parseEmail() throws Exception {
RawMailMessage[] messages = new RawMailMessage[] {
new SimpleTextMessage(),
new Base64HeaderMessage(),

View File

@@ -53,17 +53,17 @@ public class CommentFormatterTest {
}
@Test
public void testParseNullAsEmpty() {
public void parseNullAsEmpty() {
assertThat(CommentFormatter.parse(null)).isEmpty();
}
@Test
public void testParseEmpty() {
public void parseEmpty() {
assertThat(CommentFormatter.parse("")).isEmpty();
}
@Test
public void testParseSimple() {
public void parseSimple() {
String comment = "Para1";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -72,7 +72,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseMultilinePara() {
public void parseMultilinePara() {
String comment = "Para 1\nStill para 1";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -81,7 +81,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseParaBreak() {
public void parseParaBreak() {
String comment = "Para 1\n\nPara 2\n\nPara 3";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -92,7 +92,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseQuote() {
public void parseQuote() {
String comment = "> Quote text";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -102,7 +102,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseExcludesEmpty() {
public void parseExcludesEmpty() {
String comment = "Para 1\n\n\n\nPara 2";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -112,7 +112,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseQuoteLeadSpace() {
public void parseQuoteLeadSpace() {
String comment = " > Quote text";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -122,7 +122,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseMultiLineQuote() {
public void parseMultiLineQuote() {
String comment = "> Quote line 1\n> Quote line 2\n > Quote line 3\n";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -133,7 +133,7 @@ public class CommentFormatterTest {
}
@Test
public void testParsePre() {
public void parsePre() {
String comment = " Four space indent.";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -142,7 +142,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseOneSpacePre() {
public void parseOneSpacePre() {
String comment = " One space indent.\n Another line.";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -151,7 +151,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseTabPre() {
public void parseTabPre() {
String comment = "\tOne tab indent.\n\tAnother line.\n Yet another!";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -160,7 +160,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseIntermediateLeadingWhitespacePre() {
public void parseIntermediateLeadingWhitespacePre() {
String comment = "No indent.\n\tNonzero indent.\nNo indent again.";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -169,7 +169,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseStarList() {
public void parseStarList() {
String comment = "* Item 1\n* Item 2\n* Item 3";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -180,7 +180,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseDashList() {
public void parseDashList() {
String comment = "- Item 1\n- Item 2\n- Item 3";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -191,7 +191,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseMixedList() {
public void parseMixedList() {
String comment = "- Item 1\n* Item 2\n- Item 3\n* Item 4";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -203,7 +203,7 @@ public class CommentFormatterTest {
}
@Test
public void testParseMixedBlockTypes() {
public void parseMixedBlockTypes() {
String comment = "Paragraph\nacross\na\nfew\nlines."
+ "\n\n"
+ "> Quote\n> across\n> not many lines."
@@ -235,7 +235,7 @@ public class CommentFormatterTest {
}
@Test
public void testBulletList1() {
public void bulletList1() {
String comment = "A\n\n* line 1\n* 2nd line";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -246,7 +246,7 @@ public class CommentFormatterTest {
}
@Test
public void testBulletList2() {
public void bulletList2() {
String comment = "A\n\n* line 1\n* 2nd line\n\nB";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -258,7 +258,7 @@ public class CommentFormatterTest {
}
@Test
public void testBulletList3() {
public void bulletList3() {
String comment = "* line 1\n* 2nd line\n\nB";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -269,7 +269,7 @@ public class CommentFormatterTest {
}
@Test
public void testBulletList4() {
public void bulletList4() {
String comment = "To see this bug, you have to:\n" //
+ "* Be on IMAP or EAS (not on POP)\n"//
+ "* Be very unlucky\n";
@@ -282,7 +282,7 @@ public class CommentFormatterTest {
}
@Test
public void testBulletList5() {
public void bulletList5() {
String comment = "To see this bug,\n" //
+ "you have to:\n" //
+ "* Be on IMAP or EAS (not on POP)\n"//
@@ -296,7 +296,7 @@ public class CommentFormatterTest {
}
@Test
public void testDashList1() {
public void dashList1() {
String comment = "A\n\n- line 1\n- 2nd line";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -307,7 +307,7 @@ public class CommentFormatterTest {
}
@Test
public void testDashList2() {
public void dashList2() {
String comment = "A\n\n- line 1\n- 2nd line\n\nB";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -319,7 +319,7 @@ public class CommentFormatterTest {
}
@Test
public void testDashList3() {
public void dashList3() {
String comment = "- line 1\n- 2nd line\n\nB";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -330,7 +330,7 @@ public class CommentFormatterTest {
}
@Test
public void testPreformat1() {
public void preformat1() {
String comment = "A\n\n This is pre\n formatted";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -340,7 +340,7 @@ public class CommentFormatterTest {
}
@Test
public void testPreformat2() {
public void preformat2() {
String comment = "A\n\n This is pre\n formatted\n\nbut this is not";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -351,7 +351,7 @@ public class CommentFormatterTest {
}
@Test
public void testPreformat3() {
public void preformat3() {
String comment = "A\n\n Q\n <R>\n S\n\nB";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -362,7 +362,7 @@ public class CommentFormatterTest {
}
@Test
public void testPreformat4() {
public void preformat4() {
String comment = " Q\n <R>\n S\n\nB";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -372,7 +372,7 @@ public class CommentFormatterTest {
}
@Test
public void testQuote1() {
public void quote1() {
String comment = "> I'm happy\n > with quotes!\n\nSee above.";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -384,7 +384,7 @@ public class CommentFormatterTest {
}
@Test
public void testQuote2() {
public void quote2() {
String comment = "See this said:\n\n > a quoted\n > string block\n\nOK?";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);
@@ -397,7 +397,7 @@ public class CommentFormatterTest {
}
@Test
public void testNestedQuotes1() {
public void nestedQuotes1() {
String comment = " > > prior\n > \n > next\n";
List<CommentFormatter.Block> result = CommentFormatter.parse(comment);

View File

@@ -68,12 +68,12 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testDefaultIsMIXED() {
public void defaultIsMIXED() {
assertThat(create()).isInstanceOf(FromAddressGeneratorProvider.PatternGen.class);
}
@Test
public void testSelectUSER() {
public void selectUSER() {
setFrom("USER");
assertThat(create()).isInstanceOf(FromAddressGeneratorProvider.UserGen.class);
@@ -85,7 +85,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSER_FullyConfiguredUser() {
public void USER_FullyConfiguredUser() {
setFrom("USER");
final String name = "A U. Thor";
@@ -101,7 +101,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSER_NoFullNameUser() {
public void USER_NoFullNameUser() {
setFrom("USER");
final String email = "a.u.thor@test.example.com";
@@ -116,7 +116,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSER_NoPreferredEmailUser() {
public void USER_NoPreferredEmailUser() {
setFrom("USER");
final String name = "A U. Thor";
@@ -131,7 +131,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSER_NullUser() {
public void USER_NullUser() {
setFrom("USER");
replay(accountCache);
final Address r = create().from(null);
@@ -142,7 +142,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSERAllowDomain() {
public void USERAllowDomain() {
setFrom("USER");
setDomains(Arrays.asList("*.example.com"));
final String name = "A U. Thor";
@@ -158,7 +158,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSERNoAllowDomain() {
public void USERNoAllowDomain() {
setFrom("USER");
setDomains(Arrays.asList("example.com"));
final String name = "A U. Thor";
@@ -174,7 +174,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSERAllowDomainTwice() {
public void USERAllowDomainTwice() {
setFrom("USER");
setDomains(Arrays.asList("example.com"));
setDomains(Arrays.asList("test.com"));
@@ -191,7 +191,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSERAllowDomainTwiceReverse() {
public void USERAllowDomainTwiceReverse() {
setFrom("USER");
setDomains(Arrays.asList("test.com"));
setDomains(Arrays.asList("example.com"));
@@ -208,7 +208,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testUSERAllowTwoDomains() {
public void USERAllowTwoDomains() {
setFrom("USER");
setDomains(Arrays.asList("example.com", "test.com"));
final String name = "A U. Thor";
@@ -224,7 +224,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testSelectSERVER() {
public void selectSERVER() {
setFrom("SERVER");
assertThat(create()).isInstanceOf(FromAddressGeneratorProvider.ServerGen.class);
@@ -236,7 +236,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testSERVER_FullyConfiguredUser() {
public void SERVER_FullyConfiguredUser() {
setFrom("SERVER");
final String name = "A U. Thor";
@@ -252,7 +252,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testSERVER_NullUser() {
public void SERVER_NullUser() {
setFrom("SERVER");
replay(accountCache);
final Address r = create().from(null);
@@ -263,7 +263,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testSelectMIXED() {
public void selectMIXED() {
setFrom("MIXED");
assertThat(create()).isInstanceOf(FromAddressGeneratorProvider.PatternGen.class);
@@ -275,7 +275,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testMIXED_FullyConfiguredUser() {
public void MIXED_FullyConfiguredUser() {
setFrom("MIXED");
final String name = "A U. Thor";
@@ -291,7 +291,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testMIXED_NoFullNameUser() {
public void MIXED_NoFullNameUser() {
setFrom("MIXED");
final String email = "a.u.thor@test.example.com";
@@ -306,7 +306,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testMIXED_NoPreferredEmailUser() {
public void MIXED_NoPreferredEmailUser() {
setFrom("MIXED");
final String name = "A U. Thor";
@@ -321,7 +321,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testMIXED_NullUser() {
public void MIXED_NullUser() {
setFrom("MIXED");
replay(accountCache);
final Address r = create().from(null);
@@ -332,7 +332,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testCUSTOM_FullyConfiguredUser() {
public void CUSTOM_FullyConfiguredUser() {
setFrom("A ${user} B <my.server@email.address>");
final String name = "A U. Thor";
@@ -348,7 +348,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testCUSTOM_NoFullNameUser() {
public void CUSTOM_NoFullNameUser() {
setFrom("A ${user} B <my.server@email.address>");
final String email = "a.u.thor@test.example.com";
@@ -363,7 +363,7 @@ public class FromAddressGeneratorProviderTest {
}
@Test
public void testCUSTOM_NullUser() {
public void CUSTOM_NullUser() {
setFrom("A ${user} B <my.server@email.address>");
replay(accountCache);

View File

@@ -25,7 +25,7 @@ import org.junit.Test;
public class PatchListEntryTest {
@Test
public void testEmpty1() {
public void empty1() {
final String name = "empty-file";
final PatchListEntry e = PatchListEntry.empty(name);
assertNull(e.getOldName());

View File

@@ -357,14 +357,14 @@ public class RefControlTest {
}
@Test
public void testOwnerProject() {
public void ownerProject() {
allow(local, OWNER, ADMIN, "refs/*");
assertAdminsAreOwnersAndDevsAreNot();
}
@Test
public void testDenyOwnerProject() {
public void denyOwnerProject() {
allow(local, OWNER, ADMIN, "refs/*");
deny(local, OWNER, DEVS, "refs/*");
@@ -372,7 +372,7 @@ public class RefControlTest {
}
@Test
public void testBlockOwnerProject() {
public void blockOwnerProject() {
allow(local, OWNER, ADMIN, "refs/*");
block(local, OWNER, DEVS, "refs/*");
@@ -380,7 +380,7 @@ public class RefControlTest {
}
@Test
public void testBranchDelegation1() {
public void branchDelegation1() {
allow(local, OWNER, ADMIN, "refs/*");
allow(local, OWNER, DEVS, "refs/heads/x/*");
@@ -397,7 +397,7 @@ public class RefControlTest {
}
@Test
public void testBranchDelegation2() {
public void branchDelegation2() {
allow(local, OWNER, ADMIN, "refs/*");
allow(local, OWNER, DEVS, "refs/heads/x/*");
allow(local, OWNER, fixers, "refs/heads/x/y/*");
@@ -426,7 +426,7 @@ public class RefControlTest {
}
@Test
public void testInheritRead_SingleBranchDeniesUpload() {
public void inheritRead_SingleBranchDeniesUpload() {
allow(parent, READ, REGISTERED_USERS, "refs/*");
allow(parent, PUSH, REGISTERED_USERS, "refs/for/refs/*");
allow(local, READ, REGISTERED_USERS, "refs/heads/foobar");
@@ -440,7 +440,7 @@ public class RefControlTest {
}
@Test
public void testBlockPushDrafts() {
public void blockPushDrafts() {
allow(parent, PUSH, REGISTERED_USERS, "refs/for/refs/*");
block(parent, PUSH, ANONYMOUS_USERS, "refs/drafts/*");
@@ -450,7 +450,7 @@ public class RefControlTest {
}
@Test
public void testBlockPushDraftsUnblockAdmin() {
public void blockPushDraftsUnblockAdmin() {
block(parent, PUSH, ANONYMOUS_USERS, "refs/drafts/*");
allow(parent, PUSH, ADMIN, "refs/drafts/*");
@@ -461,7 +461,7 @@ public class RefControlTest {
}
@Test
public void testInheritRead_SingleBranchDoesNotOverrideInherited() {
public void inheritRead_SingleBranchDoesNotOverrideInherited() {
allow(parent, READ, REGISTERED_USERS, "refs/*");
allow(parent, PUSH, REGISTERED_USERS, "refs/for/refs/*");
allow(local, READ, REGISTERED_USERS, "refs/heads/foobar");
@@ -473,7 +473,7 @@ public class RefControlTest {
}
@Test
public void testInheritDuplicateSections() throws Exception {
public void inheritDuplicateSections() throws Exception {
allow(parent, READ, ADMIN, "refs/*");
allow(local, READ, DEVS, "refs/heads/*");
assertCanRead(user(local, "a", ADMIN));
@@ -486,7 +486,7 @@ public class RefControlTest {
}
@Test
public void testInheritRead_OverrideWithDeny() {
public void inheritRead_OverrideWithDeny() {
allow(parent, READ, REGISTERED_USERS, "refs/*");
deny(local, READ, REGISTERED_USERS, "refs/*");
@@ -494,7 +494,7 @@ public class RefControlTest {
}
@Test
public void testInheritRead_AppendWithDenyOfRef() {
public void inheritRead_AppendWithDenyOfRef() {
allow(parent, READ, REGISTERED_USERS, "refs/*");
deny(local, READ, REGISTERED_USERS, "refs/heads/*");
@@ -506,7 +506,7 @@ public class RefControlTest {
}
@Test
public void testInheritRead_OverridesAndDeniesOfRef() {
public void inheritRead_OverridesAndDeniesOfRef() {
allow(parent, READ, REGISTERED_USERS, "refs/*");
deny(local, READ, REGISTERED_USERS, "refs/*");
allow(local, READ, REGISTERED_USERS, "refs/heads/*");
@@ -519,7 +519,7 @@ public class RefControlTest {
}
@Test
public void testInheritSubmit_OverridesAndDeniesOfRef() {
public void inheritSubmit_OverridesAndDeniesOfRef() {
allow(parent, SUBMIT, REGISTERED_USERS, "refs/*");
deny(local, SUBMIT, REGISTERED_USERS, "refs/*");
allow(local, SUBMIT, REGISTERED_USERS, "refs/heads/*");
@@ -531,7 +531,7 @@ public class RefControlTest {
}
@Test
public void testCannotUploadToAnyRef() {
public void cannotUploadToAnyRef() {
allow(parent, READ, REGISTERED_USERS, "refs/*");
allow(local, READ, DEVS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/for/refs/heads/*");
@@ -542,14 +542,14 @@ public class RefControlTest {
}
@Test
public void testUsernamePatternCanUploadToAnyRef() {
public void usernamePatternCanUploadToAnyRef() {
allow(local, PUSH, REGISTERED_USERS, "refs/heads/users/${username}/*");
ProjectControl u = user(local, "a-registered-user");
assertCanUpload(u);
}
@Test
public void testUsernamePatternNonRegex() {
public void usernamePatternNonRegex() {
allow(local, READ, DEVS, "refs/sb/${username}/heads/*");
ProjectControl u = user(local, "u", DEVS);
@@ -559,7 +559,7 @@ public class RefControlTest {
}
@Test
public void testUsernamePatternWithRegex() {
public void usernamePatternWithRegex() {
allow(local, READ, DEVS, "^refs/sb/${username}/heads/.*");
ProjectControl u = user(local, "d.v", DEVS);
@@ -569,7 +569,7 @@ public class RefControlTest {
}
@Test
public void testUsernameEmailPatternWithRegex() {
public void usernameEmailPatternWithRegex() {
allow(local, READ, DEVS, "^refs/sb/${username}/heads/.*");
ProjectControl u = user(local, "d.v@ger-rit.org", DEVS);
@@ -579,7 +579,7 @@ public class RefControlTest {
}
@Test
public void testSortWithRegex() {
public void sortWithRegex() {
allow(local, READ, DEVS, "^refs/heads/.*");
allow(parent, READ, ANONYMOUS_USERS, "^refs/heads/.*-QA-.*");
@@ -590,7 +590,7 @@ public class RefControlTest {
}
@Test
public void testBlockRule_ParentBlocksChild() {
public void blockRule_ParentBlocksChild() {
allow(local, PUSH, DEVS, "refs/tags/*");
block(parent, PUSH, ANONYMOUS_USERS, "refs/tags/*");
ProjectControl u = user(local, DEVS);
@@ -598,7 +598,7 @@ public class RefControlTest {
}
@Test
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild() {
public void blockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild() {
allow(local, PUSH, DEVS, "refs/tags/*");
block(local, PUSH, ANONYMOUS_USERS, "refs/tags/*");
block(parent, PUSH, ANONYMOUS_USERS, "refs/tags/*");
@@ -608,7 +608,7 @@ public class RefControlTest {
}
@Test
public void testBlockLabelRange_ParentBlocksChild() {
public void blockLabelRange_ParentBlocksChild() {
allow(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
block(parent, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
@@ -622,7 +622,7 @@ public class RefControlTest {
}
@Test
public void testBlockLabelRange_ParentBlocksChildEvenIfAlreadyBlockedInChild() {
public void blockLabelRange_ParentBlocksChildEvenIfAlreadyBlockedInChild() {
allow(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
block(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
block(parent, LABEL + "Code-Review", -2, +2, DEVS,
@@ -639,7 +639,7 @@ public class RefControlTest {
}
@Test
public void testInheritSubmit_AllowInChildDoesntAffectUnblockInParent() {
public void inheritSubmit_AllowInChildDoesntAffectUnblockInParent() {
block(parent, SUBMIT, ANONYMOUS_USERS, "refs/heads/*");
allow(parent, SUBMIT, REGISTERED_USERS, "refs/heads/*");
allow(local, SUBMIT, REGISTERED_USERS, "refs/heads/*");
@@ -649,7 +649,7 @@ public class RefControlTest {
}
@Test
public void testUnblockNoForce() {
public void unblockNoForce() {
block(local, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/heads/*");
@@ -658,7 +658,7 @@ public class RefControlTest {
}
@Test
public void testUnblockForce() {
public void unblockForce() {
PermissionRule r = block(local, PUSH, ANONYMOUS_USERS, "refs/heads/*");
r.setForce(true);
allow(local, PUSH, DEVS, "refs/heads/*").setForce(true);
@@ -668,7 +668,7 @@ public class RefControlTest {
}
@Test
public void testUnblockForceWithAllowNoForce_NotPossible() {
public void unblockForceWithAllowNoForce_NotPossible() {
PermissionRule r = block(local, PUSH, ANONYMOUS_USERS, "refs/heads/*");
r.setForce(true);
allow(local, PUSH, DEVS, "refs/heads/*");
@@ -678,7 +678,7 @@ public class RefControlTest {
}
@Test
public void testUnblockMoreSpecificRef_Fails() {
public void unblockMoreSpecificRef_Fails() {
block(local, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/heads/master");
@@ -687,7 +687,7 @@ public class RefControlTest {
}
@Test
public void testUnblockMoreSpecificRefInLocal_Fails() {
public void unblockMoreSpecificRefInLocal_Fails() {
block(parent, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/heads/master");
@@ -696,7 +696,7 @@ public class RefControlTest {
}
@Test
public void testUnblockMoreSpecificRefWithExclusiveFlag() {
public void unblockMoreSpecificRefWithExclusiveFlag() {
block(local, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/heads/master", true);
@@ -705,7 +705,7 @@ public class RefControlTest {
}
@Test
public void testUnblockMoreSpecificRefInLocalWithExclusiveFlag_Fails() {
public void unblockMoreSpecificRefInLocalWithExclusiveFlag_Fails() {
block(parent, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/heads/master", true);
@@ -714,7 +714,7 @@ public class RefControlTest {
}
@Test
public void testUnblockOtherPermissionWithMoreSpecificRefAndExclusiveFlag_Fails() {
public void unblockOtherPermissionWithMoreSpecificRefAndExclusiveFlag_Fails() {
block(local, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, DEVS, "refs/heads/master");
allow(local, SUBMIT, DEVS, "refs/heads/master", true);
@@ -724,7 +724,7 @@ public class RefControlTest {
}
@Test
public void testUnblockLargerScope_Fails() {
public void unblockLargerScope_Fails() {
block(local, PUSH, ANONYMOUS_USERS, "refs/heads/master");
allow(local, PUSH, DEVS, "refs/heads/*");
@@ -733,7 +733,7 @@ public class RefControlTest {
}
@Test
public void testUnblockInLocal_Fails() {
public void unblockInLocal_Fails() {
block(parent, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(local, PUSH, fixers, "refs/heads/*");
@@ -742,7 +742,7 @@ public class RefControlTest {
}
@Test
public void testUnblockInParentBlockInLocal() {
public void unblockInParentBlockInLocal() {
block(parent, PUSH, ANONYMOUS_USERS, "refs/heads/*");
allow(parent, PUSH, DEVS, "refs/heads/*");
block(local, PUSH, DEVS, "refs/heads/*");
@@ -752,7 +752,7 @@ public class RefControlTest {
}
@Test
public void testUnblockVisibilityByRegisteredUsers() {
public void unblockVisibilityByRegisteredUsers() {
block(local, READ, ANONYMOUS_USERS, "refs/heads/*");
allow(local, READ, REGISTERED_USERS, "refs/heads/*");
@@ -763,7 +763,7 @@ public class RefControlTest {
}
@Test
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails() {
public void unblockInLocalVisibilityByRegisteredUsers_Fails() {
block(parent, READ, ANONYMOUS_USERS, "refs/heads/*");
allow(local, READ, REGISTERED_USERS, "refs/heads/*");
@@ -774,7 +774,7 @@ public class RefControlTest {
}
@Test
public void testUnblockForceEditTopicName() {
public void unblockForceEditTopicName() {
block(local, EDIT_TOPIC_NAME, ANONYMOUS_USERS, "refs/heads/*");
allow(local, EDIT_TOPIC_NAME, DEVS, "refs/heads/*").setForce(true);
@@ -785,7 +785,7 @@ public class RefControlTest {
}
@Test
public void testUnblockInLocalForceEditTopicName_Fails() {
public void unblockInLocalForceEditTopicName_Fails() {
block(parent, EDIT_TOPIC_NAME, ANONYMOUS_USERS, "refs/heads/*");
allow(local, EDIT_TOPIC_NAME, DEVS, "refs/heads/*").setForce(true);
@@ -796,7 +796,7 @@ public class RefControlTest {
}
@Test
public void testUnblockRange() {
public void unblockRange() {
block(local, LABEL + "Code-Review", -1, +1, ANONYMOUS_USERS, "refs/heads/*");
allow(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
@@ -807,7 +807,7 @@ public class RefControlTest {
}
@Test
public void testUnblockRangeOnMoreSpecificRef_Fails() {
public void unblockRangeOnMoreSpecificRef_Fails() {
block(local, LABEL + "Code-Review", -1, +1, ANONYMOUS_USERS, "refs/heads/*");
allow(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/master");
@@ -818,7 +818,7 @@ public class RefControlTest {
}
@Test
public void testUnblockRangeOnLargerScope_Fails() {
public void unblockRangeOnLargerScope_Fails() {
block(local, LABEL + "Code-Review", -1, +1, ANONYMOUS_USERS, "refs/heads/master");
allow(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
@@ -829,7 +829,7 @@ public class RefControlTest {
}
@Test
public void testUnblockInLocalRange_Fails() {
public void unblockInLocalRange_Fails() {
block(parent, LABEL + "Code-Review", -1, 1, ANONYMOUS_USERS,
"refs/heads/*");
allow(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
@@ -842,7 +842,7 @@ public class RefControlTest {
}
@Test
public void testUnblockRangeForChangeOwner() {
public void unblockRangeForChangeOwner() {
allow(local, LABEL + "Code-Review", -2, +2, CHANGE_OWNER, "refs/heads/*");
ProjectControl u = user(local, DEVS);
@@ -853,7 +853,7 @@ public class RefControlTest {
}
@Test
public void testUnblockRangeForNotChangeOwner() {
public void unblockRangeForNotChangeOwner() {
allow(local, LABEL + "Code-Review", -2, +2, CHANGE_OWNER, "refs/heads/*");
ProjectControl u = user(local, DEVS);
@@ -864,7 +864,7 @@ public class RefControlTest {
}
@Test
public void testBlockOwner() {
public void blockOwner() {
block(parent, OWNER, ANONYMOUS_USERS, "refs/*");
allow(local, OWNER, DEVS, "refs/*");
@@ -872,7 +872,7 @@ public class RefControlTest {
}
@Test
public void testValidateRefPatternsOK() throws Exception {
public void validateRefPatternsOK() throws Exception {
RefPattern.validate("refs/*");
RefPattern.validate("^refs/heads/*");
RefPattern.validate("^refs/tags/[0-9a-zA-Z-_.]+");
@@ -891,7 +891,7 @@ public class RefControlTest {
}
@Test
public void testValidateRefPatternNoDanglingCharacter() throws Exception {
public void validateRefPatternNoDanglingCharacter() throws Exception {
RefPattern.validate("^refs/heads/tmp/sdk/[0-9]{3,3}_R[1-9][A-Z][0-9]{3,3}");
}

View File

@@ -29,7 +29,7 @@ import java.util.List;
public class AndPredicateTest extends PredicateTest {
@Test
public void testChildren() {
public void children() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
final Predicate<String> n = and(a, b);
@@ -39,7 +39,7 @@ public class AndPredicateTest extends PredicateTest {
}
@Test
public void testChildrenUnmodifiable() {
public void childrenUnmodifiable() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
final Predicate<String> n = and(a, b);

View File

@@ -46,7 +46,7 @@ public class FieldPredicateTest extends PredicateTest {
}
@Test
public void testNameValue() {
public void nameValue() {
final String name = "author";
final String value = "alice";
final OperatorPredicate<String> f = f(name, value);

View File

@@ -30,7 +30,7 @@ import java.util.List;
public class NotPredicateTest extends PredicateTest {
@Test
public void testNotNot() {
public void notNot() {
final TestPredicate p = f("author", "bob");
final Predicate<String> n = not(p);
assertTrue(n instanceof NotPredicate);
@@ -39,7 +39,7 @@ public class NotPredicateTest extends PredicateTest {
}
@Test
public void testChildren() {
public void children() {
final TestPredicate p = f("author", "bob");
final Predicate<String> n = not(p);
assertEquals(1, n.getChildCount());
@@ -47,7 +47,7 @@ public class NotPredicateTest extends PredicateTest {
}
@Test
public void testChildrenUnmodifiable() {
public void childrenUnmodifiable() {
final TestPredicate p = f("author", "bob");
final Predicate<String> n = not(p);

View File

@@ -29,7 +29,7 @@ import java.util.List;
public class OrPredicateTest extends PredicateTest {
@Test
public void testChildren() {
public void children() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
final Predicate<String> n = or(a, b);
@@ -39,7 +39,7 @@ public class OrPredicateTest extends PredicateTest {
}
@Test
public void testChildrenUnmodifiable() {
public void childrenUnmodifiable() {
final TestPredicate a = f("author", "alice");
final TestPredicate b = f("author", "bob");
final Predicate<String> n = or(a, b);

View File

@@ -20,7 +20,7 @@ import org.junit.Test;
public class QueryParserTest {
@Test
public void testProjectBare() throws QueryParseException {
public void projectBare() throws QueryParseException {
Tree r;
r = parse("project:tools/gerrit");

View File

@@ -27,7 +27,7 @@ import java.util.Arrays;
public class RegexPathPredicateTest {
@Test
public void testPrefixOnlyOptimization() throws OrmException {
public void prefixOnlyOptimization() throws OrmException {
RegexPathPredicate p = predicate("^a/b/.*");
assertTrue(p.match(change("a/b/source.c")));
assertFalse(p.match(change("source.c")));
@@ -37,7 +37,7 @@ public class RegexPathPredicateTest {
}
@Test
public void testPrefixReducesSearchSpace() throws OrmException {
public void prefixReducesSearchSpace() throws OrmException {
RegexPathPredicate p = predicate("^a/b/.*\\.[ch]");
assertTrue(p.match(change("a/b/source.c")));
assertFalse(p.match(change("a/b/source.res")));
@@ -47,7 +47,7 @@ public class RegexPathPredicateTest {
}
@Test
public void testFileExtension_Constant() throws OrmException {
public void fileExtension_Constant() throws OrmException {
RegexPathPredicate p = predicate("^.*\\.res");
assertTrue(p.match(change("test.res")));
assertTrue(p.match(change("foo/bar/test.res")));
@@ -55,7 +55,7 @@ public class RegexPathPredicateTest {
}
@Test
public void testFileExtension_CharacterGroup() throws OrmException {
public void fileExtension_CharacterGroup() throws OrmException {
RegexPathPredicate p = predicate("^.*\\.[ch]");
assertTrue(p.match(change("test.c")));
assertTrue(p.match(change("test.h")));
@@ -63,7 +63,7 @@ public class RegexPathPredicateTest {
}
@Test
public void testEndOfString() throws OrmException {
public void endOfString() throws OrmException {
assertTrue(predicate("^a$").match(change("a")));
assertFalse(predicate("^a$").match(change("a$")));
@@ -72,7 +72,7 @@ public class RegexPathPredicateTest {
}
@Test
public void testExactMatch() throws OrmException {
public void exactMatch() throws OrmException {
RegexPathPredicate p = predicate("^foo.c");
assertTrue(p.match(change("foo.c")));
assertFalse(p.match(change("foo.cc")));

View File

@@ -32,7 +32,7 @@ public class HANATest {
}
@Test
public void testGetUrl() throws Exception {
public void getUrl() throws Exception {
config.setString("database", null, "instance", "3");
assertThat(hana.getUrl()).isEqualTo("jdbc:sap://my.host:30315");
@@ -41,7 +41,7 @@ public class HANATest {
}
@Test
public void testGetIndexScript() throws Exception {
public void getIndexScript() throws Exception {
assertThat(hana.getIndexScript()).isSameAs(ScriptRunner.NOOP);
}
}

View File

@@ -72,7 +72,7 @@ public class SchemaCreatorTest {
}
@Test
public void testGetCauses_CreateSchema() throws OrmException, SQLException,
public void getCauses_CreateSchema() throws OrmException, SQLException,
IOException {
// Initially the schema should be empty.
String[] types = {"TABLE", "VIEW"};
@@ -108,7 +108,7 @@ public class SchemaCreatorTest {
}
@Test
public void testCreateSchema_LabelTypes() throws Exception {
public void createSchema_LabelTypes() throws Exception {
List<String> labels = new ArrayList<>();
for (LabelType label : getLabelTypes().getLabelTypes()) {
labels.add(label.getName());
@@ -117,7 +117,7 @@ public class SchemaCreatorTest {
}
@Test
public void testCreateSchema_Label_CodeReview() throws Exception {
public void createSchema_Label_CodeReview() throws Exception {
LabelType codeReview = getLabelTypes().byLabel("Code-Review");
assertThat(codeReview).isNotNull();
assertThat(codeReview.getName()).isEqualTo("Code-Review");

View File

@@ -72,7 +72,7 @@ public class SchemaUpdaterTest {
}
@Test
public void testUpdate() throws OrmException, FileNotFoundException,
public void update() throws OrmException, FileNotFoundException,
IOException {
db.create();

View File

@@ -64,7 +64,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testEmptyMessages() throws Exception {
public void emptyMessages() throws Exception {
// Empty input must yield empty output so commit will abort.
// Note we must consider different commit templates formats.
//
@@ -85,7 +85,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testChangeIdAlreadySet() throws Exception {
public void changeIdAlreadySet() throws Exception {
// If a Change-Id is already present in the footer, the hook must
// not modify the message but instead must leave the identity alone.
//
@@ -107,7 +107,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testTimeAltersId() throws Exception {
public void timeAltersId() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n",//
@@ -127,7 +127,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testFirstParentAltersId() throws Exception {
public void firstParentAltersId() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n",//
@@ -141,7 +141,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testDirCacheAltersId() throws Exception {
public void dirCacheAltersId() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n",//
@@ -158,7 +158,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testSingleLineMessages() throws Exception {
public void singleLineMessages() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n",//
@@ -184,7 +184,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testMultiLineMessagesWithoutFooter() throws Exception {
public void multiLineMessagesWithoutFooter() throws Exception {
assertEquals("a\n" + //
"\n" + //
"b\n" + //
@@ -210,7 +210,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testSingleLineMessagesWithSignedOffBy() throws Exception {
public void singleLineMessagesWithSignedOffBy() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" + //
@@ -226,7 +226,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testMultiLineMessagesWithSignedOffBy() throws Exception {
public void multiLineMessagesWithSignedOffBy() throws Exception {
assertEquals("a\n" + //
"\n" + //
"b\nc\nd\ne\n" + //
@@ -275,7 +275,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testNoteInMiddle() throws Exception {
public void noteInMiddle() throws Exception {
assertEquals("a\n" + //
"\n" + //
"NOTE: This\n" + //
@@ -289,7 +289,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testKernelStyleFooter() throws Exception {
public void kernelStyleFooter() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I1bd787f9e7590a2ac82b02c404c955ffb21877c4\n" + //
@@ -306,7 +306,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testChangeIdAfterBugOrIssue() throws Exception {
public void changeIdAfterBugOrIssue() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Bug: 42\n" + //
@@ -329,7 +329,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testCommitDashV() throws Exception {
public void commitDashV() throws Exception {
assertEquals("a\n" + //
"\n" + //
"Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" + //
@@ -347,7 +347,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testWithEndingURL() throws Exception {
public void withEndingURL() throws Exception {
assertEquals("a\n" + //
"\n" + //
"http://example.com/ fixes this\n" + //
@@ -383,7 +383,7 @@ public class CommitMsgHookTest extends HookTestCase {
}
@Test
public void testWithFalseTags() throws Exception {
public void withFalseTags() throws Exception {
assertEquals("foo\n" + //
"\n" + //
"FakeLine:\n" + //

View File

@@ -37,7 +37,7 @@ public class IdGeneratorTest {
}
@Test
public void testFormat() {
public void format() {
assertEquals("0000000f", IdGenerator.format(0xf));
assertEquals("801234ab", IdGenerator.format(0x801234ab));
assertEquals("deadbeef", IdGenerator.format(0xdeadbeef));