Merge "Remove test prefix from test methods"

* submodules:
* Update plugins/replication from branch 'master'
  - Remove test prefix from test methods in replication plugin
    
    We previously used 'test' to prefix tests but have decided to stop this.
    This change removes the prefix from all test code.
    
    Change-Id: I42e6191ece7872f4647e425e3ca0acf8c6452412
This commit is contained in:
David Pursehouse
2016-12-07 12:48:37 +00:00
committed by Gerrit Code Review
81 changed files with 544 additions and 543 deletions

View File

@@ -27,12 +27,12 @@ public class SandboxTest extends AbstractDaemonTest {
}
@Test
public void testUserNotPresent1() throws Exception {
public void userNotPresent1() throws Exception {
assertThat(gApi.accounts().query("sandboxuser").get()).isEmpty();
}
@Test
public void testUserNotPresent2() throws Exception {
public void userNotPresent2() throws Exception {
assertThat(gApi.accounts().query("sandboxuser").get()).isEmpty();
}
}

View File

@@ -2238,7 +2238,7 @@ public class ChangeIT extends AbstractDaemonTest {
}
@Test
public void testCreateMergePatchSet() throws Exception {
public void createMergePatchSet() throws Exception {
PushOneCommit.Result start = pushTo("refs/heads/master");
start.assertOkStatus();
// create a change for master
@@ -2275,7 +2275,7 @@ public class ChangeIT extends AbstractDaemonTest {
}
@Test
public void testCreateMergePatchSetInheritParent() throws Exception {
public void createMergePatchSetInheritParent() throws Exception {
PushOneCommit.Result start = pushTo("refs/heads/master");
start.assertOkStatus();
// create a change for master

View File

@@ -130,14 +130,14 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testCreateGroup() throws Exception {
public void createGroup() throws Exception {
String newGroupName = name("newGroup");
GroupInfo g = gApi.groups().create(newGroupName).get();
assertGroupInfo(getFromCache(newGroupName), g);
}
@Test
public void testCreateDuplicateInternalGroupCaseSensitiveName_Conflict()
public void createDuplicateInternalGroupCaseSensitiveName_Conflict()
throws Exception {
String dupGroupName = name("dupGroup");
gApi.groups().create(dupGroupName);
@@ -147,7 +147,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testCreateDuplicateInternalGroupCaseInsensitiveName()
public void createDuplicateInternalGroupCaseInsensitiveName()
throws Exception {
String dupGroupName = name("dupGroupA");
String dupGroupNameLowerCase = name("dupGroupA").toLowerCase();
@@ -158,7 +158,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testCreateDuplicateSystemGroupCaseSensitiveName_Conflict()
public void createDuplicateSystemGroupCaseSensitiveName_Conflict()
throws Exception {
String newGroupName = "Registered Users";
exception.expect(ResourceConflictException.class);
@@ -167,7 +167,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testCreateDuplicateSystemGroupCaseInsensitiveName_Conflict()
public void createDuplicateSystemGroupCaseInsensitiveName_Conflict()
throws Exception {
String newGroupName = "registered users";
exception.expect(ResourceConflictException.class);
@@ -176,7 +176,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testCreateGroupWithProperties() throws Exception {
public void createGroupWithProperties() throws Exception {
GroupInput in = new GroupInput();
in.name = name("newGroup");
in.description = "Test description";
@@ -189,14 +189,14 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testCreateGroupWithoutCapability_Forbidden() throws Exception {
public void createGroupWithoutCapability_Forbidden() throws Exception {
setApiUser(user);
exception.expect(AuthException.class);
gApi.groups().create(name("newGroup"));
}
@Test
public void testGetGroup() throws Exception {
public void getGroup() throws Exception {
AccountGroup adminGroup = groupCache.get(new AccountGroup.NameKey("Administrators"));
testGetGroup(adminGroup.getGroupUUID().get(), adminGroup);
testGetGroup(adminGroup.getName(), adminGroup);
@@ -210,7 +210,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testGroupName() throws Exception {
public void groupName() throws Exception {
String name = name("group");
gApi.groups().create(name);
@@ -229,7 +229,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testGroupRename() throws Exception {
public void groupRename() throws Exception {
String name = name("group");
gApi.groups().create(name);
@@ -244,7 +244,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testGroupDescription() throws Exception {
public void groupDescription() throws Exception {
String name = name("group");
gApi.groups().create(name);
@@ -266,7 +266,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testGroupOptions() throws Exception {
public void groupOptions() throws Exception {
String name = name("group");
gApi.groups().create(name);
@@ -281,7 +281,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testGroupOwner() throws Exception {
public void groupOwner() throws Exception {
String name = name("group");
GroupInfo info = gApi.groups().create(name).get();
String adminUUID = getFromCache("Administrators").getGroupUUID().get();
@@ -395,7 +395,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testListAllGroups() throws Exception {
public void listAllGroups() throws Exception {
List<String> expectedGroups = groupCache.all().stream()
.map(a -> a.getName())
.sorted()
@@ -406,7 +406,7 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testOnlyVisibleGroupsReturned() throws Exception {
public void onlyVisibleGroupsReturned() throws Exception {
String newGroupName = name("newGroup");
GroupInput in = new GroupInput();
in.name = newGroupName;
@@ -427,14 +427,14 @@ public class GroupsIT extends AbstractDaemonTest {
}
@Test
public void testSuggestGroup() throws Exception {
public void suggestGroup() throws Exception {
Map<String, GroupInfo> groups = gApi.groups().list().withSuggest("adm").getAsMap();
assertThat(groups).containsKey("Administrators");
assertThat(groups).hasSize(1);
}
@Test
public void testAllGroupInfoFieldsSetCorrectly() throws Exception {
public void allGroupInfoFieldsSetCorrectly() throws Exception {
AccountGroup adminGroup = getFromCache("Administrators");
Map<String, GroupInfo> groups =
gApi.groups().list().addGroup(adminGroup.getName()).getAsMap();

View File

@@ -740,7 +740,7 @@ public class ChangeEditIT extends AbstractDaemonTest {
}
@Test
public void testHasEditPredicate() throws Exception {
public void hasEditPredicate() throws Exception {
assertThat(modifier.createEdit(change, ps)).isEqualTo(RefUpdate.Result.NEW);
assertThat(queryEdits()).hasSize(1);

View File

@@ -33,14 +33,14 @@ public class DraftChangeBlockedIT extends AbstractDaemonTest {
}
@Test
public void testPushDraftChange_Blocked() throws Exception {
public void pushDraftChange_Blocked() throws Exception {
// create draft by pushing to 'refs/drafts/'
PushOneCommit.Result r = pushTo("refs/drafts/master");
r.assertErrorStatus("cannot upload drafts");
}
@Test
public void testPushDraftChangeMagic_Blocked() throws Exception {
public void pushDraftChangeMagic_Blocked() throws Exception {
// create draft by using 'draft' option
PushOneCommit.Result r = pushTo("refs/for/master%draft");
r.assertErrorStatus("cannot upload drafts");

View File

@@ -32,7 +32,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
private static final String THIS_SERVER = "http://localhost/";
@Test
public void testFollowMasterBranch() throws Exception {
public void followMasterBranch() throws Exception {
Project.NameKey p = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -54,7 +54,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testFollowMatchingBranch() throws Exception {
public void followMatchingBranch() throws Exception {
Project.NameKey p = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -89,7 +89,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testFollowAnotherBranch() throws Exception {
public void followAnotherBranch() throws Exception {
Project.NameKey p = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -112,7 +112,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithAnotherURI() throws Exception {
public void withAnotherURI() throws Exception {
Project.NameKey p = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -135,7 +135,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithSlashesInProjectName() throws Exception {
public void withSlashesInProjectName() throws Exception {
Project.NameKey p = createProject("project/with/slashes/a");
Config cfg = new Config();
cfg.fromText(""
@@ -158,7 +158,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithSlashesInPath() throws Exception {
public void withSlashesInPath() throws Exception {
Project.NameKey p = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -181,7 +181,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithMoreSections() throws Exception {
public void withMoreSections() throws Exception {
Project.NameKey p1 = createProject("a");
Project.NameKey p2 = createProject("b");
Config cfg = new Config();
@@ -211,7 +211,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithSubProjectFound() throws Exception {
public void withSubProjectFound() throws Exception {
Project.NameKey p1 = createProject("a/b");
Project.NameKey p2 = createProject("b");
Config cfg = new Config();
@@ -241,7 +241,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithAnInvalidSection() throws Exception {
public void withAnInvalidSection() throws Exception {
Project.NameKey p1 = createProject("a");
Project.NameKey p2 = createProject("b");
Project.NameKey p3 = createProject("d");
@@ -285,7 +285,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithSectionOfNonexistingProject() throws Exception {
public void withSectionOfNonexistingProject() throws Exception {
Config cfg = new Config();
cfg.fromText("\n"
+ "[submodule \"a\"]\n"
@@ -304,7 +304,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithSectionToOtherServer() throws Exception {
public void withSectionToOtherServer() throws Exception {
Project.NameKey p1 = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -323,7 +323,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithRelativeURI() throws Exception {
public void withRelativeURI() throws Exception {
Project.NameKey p1 = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -346,7 +346,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithDeepRelativeURI() throws Exception {
public void withDeepRelativeURI() throws Exception {
Project.NameKey p1 = createProject("a");
Config cfg = new Config();
cfg.fromText(""
@@ -369,7 +369,7 @@ public class SubmoduleSectionParserIT extends AbstractDaemonTest {
}
@Test
public void testWithOverlyDeepRelativeURI() throws Exception {
public void withOverlyDeepRelativeURI() throws Exception {
Project.NameKey p1 = createProject("nested/a");
Config cfg = new Config();
cfg.fromText(""

View File

@@ -55,7 +55,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWithoutSpecificSubscription() throws Exception {
public void subscriptionWithoutSpecificSubscription() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -67,7 +67,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionToEmptyRepo() throws Exception {
public void subscriptionToEmptyRepo() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -84,7 +84,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionToExistingRepo() throws Exception {
public void subscriptionToExistingRepo() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -101,7 +101,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLForSingleBranch() throws Exception {
public void subscriptionWildcardACLForSingleBranch() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
// master is allowed to be subscribed to master branch only:
@@ -125,7 +125,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLForMissingProject() throws Exception {
public void subscriptionWildcardACLForMissingProject() throws Exception {
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/*",
"not-existing-super-project", "refs/heads/*");
@@ -133,7 +133,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLForMissingBranch() throws Exception {
public void subscriptionWildcardACLForMissingBranch() throws Exception {
createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/*",
@@ -142,7 +142,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLForMissingGitmodules() throws Exception {
public void subscriptionWildcardACLForMissingGitmodules() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/*",
@@ -152,7 +152,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLOneOnOneMapping() throws Exception {
public void subscriptionWildcardACLOneOnOneMapping() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
// any branch is allowed to be subscribed to the same superprojects branch:
@@ -189,7 +189,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLForManyBranches() throws Exception {
public void subscriptionWildcardACLForManyBranches() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -206,7 +206,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionWildcardACLOneToManyBranches() throws Exception {
public void subscriptionWildcardACLOneToManyBranches() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -286,7 +286,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubmoduleCommitMessage() throws Exception {
public void submoduleCommitMessage() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -314,7 +314,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionUnsubscribe() throws Exception {
public void subscriptionUnsubscribe() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -340,7 +340,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionUnsubscribeByDeletingGitModules()
public void subscriptionUnsubscribeByDeletingGitModules()
throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -367,7 +367,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionToDifferentBranches() throws Exception {
public void subscriptionToDifferentBranches() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/foo",
@@ -383,7 +383,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testBranchCircularSubscription() throws Exception {
public void branchCircularSubscription() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -407,7 +407,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testProjectCircularSubscription() throws Exception {
public void projectCircularSubscription() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -439,7 +439,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionFailOnMissingACL() throws Exception {
public void subscriptionFailOnMissingACL() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -452,7 +452,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionFailOnWrongProjectACL() throws Exception {
public void subscriptionFailOnWrongProjectACL() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -467,7 +467,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionFailOnWrongBranchACL() throws Exception {
public void subscriptionFailOnWrongBranchACL() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -482,7 +482,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionInheritACL() throws Exception {
public void subscriptionInheritACL() throws Exception {
createProjectWithPush("config-repo");
createProjectWithPush("config-repo2",
new Project.NameKey(name("config-repo")));
@@ -501,7 +501,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testAllowedButNotSubscribed() throws Exception {
public void allowedButNotSubscribed() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -526,7 +526,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
}
@Test
public void testSubscriptionDeepRelative() throws Exception {
public void subscriptionDeepRelative() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush(
"nested/subscribed-to-project");

View File

@@ -67,7 +67,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testSubscriptionUpdateOfManyChanges() throws Exception {
public void subscriptionUpdateOfManyChanges() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
allowMatchingSubmoduleSubscription("subscribed-to-project", "refs/heads/master",
@@ -149,7 +149,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testSubscriptionUpdateIncludingChangeInSuperproject()
public void subscriptionUpdateIncludingChangeInSuperproject()
throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -216,7 +216,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testUpdateManySubmodules() throws Exception {
public void updateManySubmodules() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> sub1 = createProjectWithPush("sub1");
TestRepository<?> sub2 = createProjectWithPush("sub2");
@@ -264,7 +264,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testDoNotUseFastForward() throws Exception {
public void doNotUseFastForward() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project", false);
TestRepository<?> sub = createProjectWithPush("sub", false);
@@ -292,7 +292,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testUseFastForwardWhenNoSubmodule() throws Exception {
public void useFastForwardWhenNoSubmodule() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project", false);
TestRepository<?> sub = createProjectWithPush("sub", false);
@@ -314,7 +314,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testSameProjectSameBranchDifferentPaths() throws Exception {
public void sameProjectSameBranchDifferentPaths() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> sub = createProjectWithPush("sub");
@@ -347,7 +347,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testSameProjectDifferentBranchDifferentPaths() throws Exception {
public void sameProjectDifferentBranchDifferentPaths() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> sub = createProjectWithPush("sub");
@@ -391,7 +391,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testNonSubmoduleInSameTopic() throws Exception {
public void nonSubmoduleInSameTopic() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> sub = createProjectWithPush("sub");
TestRepository<?> standAlone = createProjectWithPush("standalone");
@@ -431,7 +431,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testRecursiveSubmodules() throws Exception {
public void recursiveSubmodules() throws Exception {
TestRepository<?> topRepo = createProjectWithPush("top-project");
TestRepository<?> midRepo = createProjectWithPush("mid-project");
TestRepository<?> bottomRepo = createProjectWithPush("bottom-project");
@@ -465,7 +465,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testTriangleSubmodules() throws Exception {
public void triangleSubmodules() throws Exception {
TestRepository<?> topRepo = createProjectWithPush("top-project");
TestRepository<?> midRepo = createProjectWithPush("mid-project");
TestRepository<?> bottomRepo = createProjectWithPush("bottom-project");
@@ -535,19 +535,19 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testBranchCircularSubscription() throws Exception {
public void branchCircularSubscription() throws Exception {
String changeId = prepareBranchCircularSubscription();
gApi.changes().id(changeId).current().submit();
}
@Test
public void testBranchCircularSubscriptionPreview() throws Exception {
public void branchCircularSubscriptionPreview() throws Exception {
String changeId = prepareBranchCircularSubscription();
gApi.changes().id(changeId).current().submitPreview();
}
@Test
public void testProjectCircularSubscriptionWholeTopic() throws Exception {
public void projectCircularSubscriptionWholeTopic() throws Exception {
TestRepository<?> superRepo = createProjectWithPush("super-project");
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project");
@@ -585,7 +585,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testProjectNoSubscriptionWholeTopic() throws Exception {
public void projectNoSubscriptionWholeTopic() throws Exception {
TestRepository<?> repoA = createProjectWithPush("project-a");
TestRepository<?> repoB = createProjectWithPush("project-b");
// bootstrap the dev branch
@@ -637,7 +637,7 @@ public class SubmoduleSubscriptionsWholeTopicMergeIT
}
@Test
public void testTwoProjectsMultipleBranchesWholeTopic() throws Exception {
public void twoProjectsMultipleBranchesWholeTopic() throws Exception {
TestRepository<?> repoA = createProjectWithPush("project-a");
TestRepository<?> repoB = createProjectWithPush("project-b");
// bootstrap the dev branch

View File

@@ -38,7 +38,7 @@ import org.junit.Test;
public class CapabilitiesIT extends AbstractDaemonTest {
@Test
public void testCapabilitiesUser() throws Exception {
public void capabilitiesUser() throws Exception {
Iterable<String> all = Iterables.filter(
GlobalCapability.getAllNames(),
c -> !ADMINISTRATE_SERVER.equals(c) && !PRIORITY.equals(c));
@@ -72,7 +72,7 @@ public class CapabilitiesIT extends AbstractDaemonTest {
}
@Test
public void testCapabilitiesAdmin() throws Exception {
public void capabilitiesAdmin() throws Exception {
RestResponse r =
adminRestSession.get("/accounts/self/capabilities");
r.assertOK();

View File

@@ -48,13 +48,13 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testGetNoAssignee() throws Exception {
public void getNoAssignee() throws Exception {
PushOneCommit.Result r = createChange();
assertThat(getAssignee(r)).isNull();
}
@Test
public void testAddGetAssignee() throws Exception {
public void addGetAssignee() throws Exception {
PushOneCommit.Result r = createChange();
assertThat(setAssignee(r, user.email)._accountId)
.isEqualTo(user.getId().get());
@@ -62,7 +62,7 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testSetNewAssigneeWhenExists() throws Exception {
public void setNewAssigneeWhenExists() throws Exception {
PushOneCommit.Result r = createChange();
setAssignee(r, user.email);
assertThat(setAssignee(r, user.email)._accountId)
@@ -70,7 +70,7 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testGetPastAssignees() throws Exception {
public void getPastAssignees() throws Exception {
assume().that(notesMigration.readChanges()).isTrue();
PushOneCommit.Result r = createChange();
setAssignee(r, user.email);
@@ -83,7 +83,7 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testAssigneeAddedAsReviewer() throws Exception {
public void assigneeAddedAsReviewer() throws Exception {
ReviewerState state;
// Assignee is added as CC, if back-end is reviewDb (that does not support
// CC) CC is stored as REVIEWER
@@ -104,7 +104,7 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testSetAlreadyExistingAssignee() throws Exception {
public void setAlreadyExistingAssignee() throws Exception {
PushOneCommit.Result r = createChange();
setAssignee(r, user.email);
assertThat(setAssignee(r, user.email)._accountId)
@@ -112,7 +112,7 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testDeleteAssignee() throws Exception {
public void deleteAssignee() throws Exception {
PushOneCommit.Result r = createChange();
assertThat(setAssignee(r, user.email)._accountId)
.isEqualTo(user.getId().get());
@@ -121,7 +121,7 @@ public class AssigneeIT extends AbstractDaemonTest {
}
@Test
public void testDeleteAssigneeWhenNoAssignee() throws Exception {
public void deleteAssigneeWhenNoAssignee() throws Exception {
PushOneCommit.Result r = createChange();
assertThat(deleteAssignee(r)).isNull();
}

View File

@@ -52,14 +52,14 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testGetNoHashtags() throws Exception {
public void getNoHashtags() throws Exception {
// Get on a change with no hashtags returns an empty list.
PushOneCommit.Result r = createChange();
assertThatGet(r).isEmpty();
}
@Test
public void testAddSingleHashtag() throws Exception {
public void addSingleHashtag() throws Exception {
PushOneCommit.Result r = createChange();
// Adding a single hashtag returns a single hashtag.
@@ -75,7 +75,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testAddMultipleHashtags() throws Exception {
public void addMultipleHashtags() throws Exception {
PushOneCommit.Result r = createChange();
// Adding multiple hashtags returns a sorted list of hashtags.
@@ -91,7 +91,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testAddAlreadyExistingHashtag() throws Exception {
public void addAlreadyExistingHashtag() throws Exception {
// Adding a hashtag that already exists on the change returns a sorted list
// of hashtags without duplicates.
PushOneCommit.Result r = createChange();
@@ -110,7 +110,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testHashtagsWithPrefix() throws Exception {
public void hashtagsWithPrefix() throws Exception {
PushOneCommit.Result r = createChange();
// Leading # is stripped from added tag.
@@ -150,7 +150,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testRemoveSingleHashtag() throws Exception {
public void removeSingleHashtag() throws Exception {
// Removing a single tag from a change that only has that tag returns an
// empty list.
PushOneCommit.Result r = createChange();
@@ -169,7 +169,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testRemoveMultipleHashtags() throws Exception {
public void removeMultipleHashtags() throws Exception {
// Removing multiple tags from a change that only has those tags returns an
// empty list.
PushOneCommit.Result r = createChange();
@@ -189,7 +189,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testRemoveNotExistingHashtag() throws Exception {
public void removeNotExistingHashtag() throws Exception {
// Removing a single hashtag from change that has no hashtags returns an
// empty list.
PushOneCommit.Result r = createChange();
@@ -216,7 +216,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testAddAndRemove() throws Exception {
public void addAndRemove() throws Exception {
// Adding and remove hashtags in a single request performs correctly.
PushOneCommit.Result r = createChange();
addHashtags(r, "tag1", "tag2");
@@ -238,7 +238,7 @@ public class HashtagsIT extends AbstractDaemonTest {
}
@Test
public void testHashtagWithMixedCase() throws Exception {
public void hashtagWithMixedCase() throws Exception {
PushOneCommit.Result r = createChange();
addHashtags(r, "MyHashtag");
assertThatGet(r).containsExactly("MyHashtag");

View File

@@ -401,7 +401,7 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge {
}
@Test
public void testGerritWorkflow() throws Exception {
public void gerritWorkflow() throws Exception {
RevCommit initialHead = getRemoteHead();
// We'll setup a master and a stable branch.

View File

@@ -52,7 +52,7 @@ import java.util.Set;
public class CreateProjectIT extends AbstractDaemonTest {
@Test
public void testCreateProjectHttp() throws Exception {
public void createProjectHttp() throws Exception {
String newProjectName = name("newProject");
RestResponse r = adminRestSession.put("/projects/" + newProjectName);
r.assertCreated();
@@ -65,7 +65,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectHttpWhenProjectAlreadyExists_Conflict()
public void createProjectHttpWhenProjectAlreadyExists_Conflict()
throws Exception {
adminRestSession
.put("/projects/" + allProjects.get())
@@ -73,7 +73,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectHttpWhenProjectAlreadyExists_PreconditionFailed()
public void createProjectHttpWhenProjectAlreadyExists_PreconditionFailed()
throws Exception {
adminRestSession
.putWithHeader("/projects/" + allProjects.get(),
@@ -91,7 +91,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectHttpWithNameMismatch_BadRequest() throws Exception {
public void createProjectHttpWithNameMismatch_BadRequest() throws Exception {
ProjectInput in = new ProjectInput();
in.name = name("otherName");
adminRestSession
@@ -100,7 +100,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectHttpWithInvalidRefName_BadRequest()
public void createProjectHttpWithInvalidRefName_BadRequest()
throws Exception {
ProjectInput in = new ProjectInput();
in.branches = Collections.singletonList(name("invalid ref name"));
@@ -110,7 +110,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProject() throws Exception {
public void createProject() throws Exception {
String newProjectName = name("newProject");
ProjectInfo p = gApi.projects().create(newProjectName).get();
assertThat(p.name).isEqualTo(newProjectName);
@@ -121,7 +121,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithGitSuffix() throws Exception {
public void createProjectWithGitSuffix() throws Exception {
String newProjectName = name("newProject");
ProjectInfo p = gApi.projects().create(newProjectName + ".git").get();
assertThat(p.name).isEqualTo(newProjectName);
@@ -132,7 +132,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithProperties() throws Exception {
public void createProjectWithProperties() throws Exception {
String newProjectName = name("newProject");
ProjectInput in = new ProjectInput();
in.name = newProjectName;
@@ -155,7 +155,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateChildProject() throws Exception {
public void createChildProject() throws Exception {
String parentName = name("parent");
ProjectInput in = new ProjectInput();
in.name = parentName;
@@ -171,7 +171,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateChildProjectUnderNonExistingParent_UnprocessableEntity()
public void createChildProjectUnderNonExistingParent_UnprocessableEntity()
throws Exception {
ProjectInput in = new ProjectInput();
in.name = name("newProjectName");
@@ -180,7 +180,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithOwner() throws Exception {
public void createProjectWithOwner() throws Exception {
String newProjectName = name("newProject");
ProjectInput in = new ProjectInput();
in.name = newProjectName;
@@ -199,7 +199,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithNonExistingOwner_UnprocessableEntity()
public void createProjectWithNonExistingOwner_UnprocessableEntity()
throws Exception {
ProjectInput in = new ProjectInput();
in.name = name("newProjectName");
@@ -208,7 +208,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreatePermissionOnlyProject() throws Exception {
public void createPermissionOnlyProject() throws Exception {
String newProjectName = name("newProject");
ProjectInput in = new ProjectInput();
in.name = newProjectName;
@@ -218,7 +218,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithEmptyCommit() throws Exception {
public void createProjectWithEmptyCommit() throws Exception {
String newProjectName = name("newProject");
ProjectInput in = new ProjectInput();
in.name = newProjectName;
@@ -228,7 +228,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithBranches() throws Exception {
public void createProjectWithBranches() throws Exception {
String newProjectName = name("newProject");
ProjectInput in = new ProjectInput();
in.name = newProjectName;
@@ -244,7 +244,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWithoutCapability_Forbidden() throws Exception {
public void createProjectWithoutCapability_Forbidden() throws Exception {
setApiUser(user);
ProjectInput in = new ProjectInput();
in.name = name("newProject");
@@ -252,7 +252,7 @@ public class CreateProjectIT extends AbstractDaemonTest {
}
@Test
public void testCreateProjectWhenProjectAlreadyExists_Conflict()
public void createProjectWhenProjectAlreadyExists_Conflict()
throws Exception {
ProjectInput in = new ProjectInput();
in.name = allProjects.get();

View File

@@ -37,12 +37,12 @@ public class GarbageCollectionIT extends AbstractDaemonTest {
}
@Test
public void testGcNonExistingProject_NotFound() throws Exception {
public void gcNonExistingProject_NotFound() throws Exception {
POST("/projects/non-existing/gc").assertNotFound();
}
@Test
public void testGcNotAllowed_Forbidden() throws Exception {
public void gcNotAllowed_Forbidden() throws Exception {
userRestSession
.post("/projects/" + allProjects.get() + "/gc")
.assertForbidden();

View File

@@ -300,7 +300,7 @@ public class SubmittedTogetherIT extends AbstractDaemonTest {
}
@Test
public void testTopicChaining() throws Exception {
public void topicChaining() throws Exception {
RevCommit initialHead = getRemoteHead();
// Create two independent commits and push.
RevCommit c1_1 = commitBuilder()
@@ -337,7 +337,7 @@ public class SubmittedTogetherIT extends AbstractDaemonTest {
}
@Test
public void testNewBranchTwoChangesTogether() throws Exception {
public void newBranchTwoChangesTogether() throws Exception {
Project.NameKey p1 = createProject("a-new-project", null, false);
TestRepository<?> repo1 = cloneProject(p1);
@@ -379,7 +379,7 @@ public class SubmittedTogetherIT extends AbstractDaemonTest {
}
@Test
public void testSubmissionIdSavedOnMergeInOneProject() throws Exception {
public void submissionIdSavedOnMergeInOneProject() throws Exception {
// Create two commits and push.
RevCommit c1_1 = commitBuilder()
.add("a.txt", "1")

View File

@@ -78,7 +78,7 @@ public class MailIT extends AbstractDaemonTest {
}
@Test
public void testDelete() throws Exception {
public void delete() throws Exception {
GreenMailUser user = mockPop3Server.setUser(USERNAME, USERNAME, PASSWORD);
user.deliver(createSimpleMessage());
assertThat(mockPop3Server.getReceivedMessages().length).isEqualTo(1);

View File

@@ -78,7 +78,7 @@ public class GarbageCollectionIT extends AbstractDaemonTest {
}
@Test
public void testGcWithoutCapability_Error() throws Exception {
public void gcWithoutCapability_Error() throws Exception {
userSshSession.exec("gerrit gc --all");
assertThat(userSshSession.hasError()).isTrue();
String error = userSshSession.getError();

View File

@@ -41,7 +41,7 @@ public class QueryIT extends AbstractDaemonTest {
private static Gson gson = new Gson();
@Test
public void testBasicQueryJSON() throws Exception {
public void basicQueryJSON() throws Exception {
String changeId1 = createChange().getChangeId();
String changeId2 = createChange().getChangeId();
@@ -68,7 +68,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testAllApprovalsOptionJSON() throws Exception {
public void allApprovalsOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
gApi.changes().id(changeId).current().review(ReviewInput.approve());
List<ChangeAttribute> changes = executeSuccessfulQuery(changeId);
@@ -83,7 +83,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testAllReviewersOptionJSON() throws Exception {
public void allReviewersOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
AddReviewerInput in = new AddReviewerInput();
in.reviewer = user.email;
@@ -100,7 +100,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testCommitMessageOptionJSON() throws Exception {
public void commitMessageOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
List<ChangeAttribute> changes =
executeSuccessfulQuery("--commit-message " + changeId);
@@ -110,7 +110,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testCurrentPatchSetOptionJSON() throws Exception {
public void currentPatchSetOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
amendChange(changeId);
@@ -133,7 +133,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testPatchSetsOptionJSON() throws Exception {
public void patchSetsOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
amendChange(changeId);
amendChange(changeId);
@@ -159,7 +159,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testFileOptionJSON() throws Exception {
public void fileOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
List<ChangeAttribute> changes =
@@ -185,7 +185,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testCommentOptionJSON() throws Exception {
public void commentOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
List<ChangeAttribute> changes = executeSuccessfulQuery(changeId);
@@ -199,7 +199,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testCommentOptionsInCurrentPatchSetJSON() throws Exception {
public void commentOptionsInCurrentPatchSetJSON() throws Exception {
String changeId = createChange().getChangeId();
ReviewInput review = new ReviewInput();
@@ -224,7 +224,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testCommentOptionInPatchSetsJSON() throws Exception {
public void commentOptionInPatchSetsJSON() throws Exception {
String changeId = createChange().getChangeId();
ReviewInput review = new ReviewInput();
@@ -268,7 +268,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testDependenciesOptionJSON() throws Exception {
public void dependenciesOptionJSON() throws Exception {
String changeId1 = createChange().getChangeId();
String changeId2 = createChange().getChangeId();
List<ChangeAttribute> changes = executeSuccessfulQuery(changeId1);
@@ -290,7 +290,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testSubmitRecordsOptionJSON() throws Exception {
public void submitRecordsOptionJSON() throws Exception {
String changeId = createChange().getChangeId();
List<ChangeAttribute> changes = executeSuccessfulQuery(changeId);
assertThat(changes.size()).isEqualTo(1);
@@ -303,7 +303,7 @@ public class QueryIT extends AbstractDaemonTest {
}
@Test
public void testQueryWithNonVisibleCurrentPatchSet() throws Exception {
public void queryWithNonVisibleCurrentPatchSet() throws Exception {
String changeId = createChange().getChangeId();
amendChangeAsDraft(changeId);
String query = "--current-patch-set --patch-sets " + changeId;

View File

@@ -20,12 +20,12 @@ import org.junit.Test;
public class EncodePathSeparatorTest {
@Test
public void testDefaultBehaviour() {
public void defaultBehaviour() {
assertEquals("a/b", new GitwebType().replacePathSeparator("a/b"));
}
@Test
public void testExclamationMark() {
public void exclamationMark() {
GitwebType gitwebType = new GitwebType();
gitwebType.setPathSeparator('!');
assertEquals("a!b", gitwebType.replacePathSeparator("a/b"));

View File

@@ -27,7 +27,7 @@ import java.util.Map;
public class ParameterizedStringTest {
@Test
public void testEmptyString() {
public void emptyString() {
final ParameterizedString p = new ParameterizedString("");
assertEquals("", p.getPattern());
assertEquals("", p.getRawPattern());
@@ -40,7 +40,7 @@ public class ParameterizedStringTest {
}
@Test
public void testAsis1() {
public void asis1() {
final ParameterizedString p = ParameterizedString.asis("${bar}c");
assertEquals("${bar}c", p.getPattern());
assertEquals("${bar}c", p.getRawPattern());
@@ -54,7 +54,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplace1() {
public void replace1() {
final ParameterizedString p = new ParameterizedString("${bar}c");
assertEquals("${bar}c", p.getPattern());
assertEquals("{0}c", p.getRawPattern());
@@ -70,7 +70,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplace2() {
public void replace2() {
final ParameterizedString p = new ParameterizedString("a${bar}c");
assertEquals("a${bar}c", p.getPattern());
assertEquals("a{0}c", p.getRawPattern());
@@ -86,7 +86,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplace3() {
public void replace3() {
final ParameterizedString p = new ParameterizedString("a${bar}");
assertEquals("a${bar}", p.getPattern());
assertEquals("a{0}", p.getRawPattern());
@@ -102,7 +102,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplace4() {
public void replace4() {
final ParameterizedString p = new ParameterizedString("a${bar}c");
assertEquals("a${bar}c", p.getPattern());
assertEquals("a{0}c", p.getRawPattern());
@@ -117,7 +117,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToLowerCase() {
public void replaceToLowerCase() {
final ParameterizedString p = new ParameterizedString("${a.toLowerCase}");
assertEquals(1, p.getParameterNames().size());
assertTrue(p.getParameterNames().contains("a"));
@@ -138,7 +138,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToUpperCase() {
public void replaceToUpperCase() {
final ParameterizedString p = new ParameterizedString("${a.toUpperCase}");
assertEquals(1, p.getParameterNames().size());
assertTrue(p.getParameterNames().contains("a"));
@@ -159,7 +159,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceLocalName() {
public void replaceLocalName() {
final ParameterizedString p = new ParameterizedString("${a.localPart}");
assertEquals(1, p.getParameterNames().size());
assertTrue(p.getParameterNames().contains("a"));
@@ -180,7 +180,7 @@ public class ParameterizedStringTest {
}
@Test
public void testUndefinedFunctionName() {
public void undefinedFunctionName() {
ParameterizedString p =
new ParameterizedString(
"hi, ${userName.toUpperCase},your eamil address is '${email.toLowerCase.localPart}'.right?");
@@ -200,7 +200,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToUpperCaseToLowerCase() {
public void replaceToUpperCaseToLowerCase() {
final ParameterizedString p =
new ParameterizedString("${a.toUpperCase.toLowerCase}");
assertEquals(1, p.getParameterNames().size());
@@ -222,7 +222,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToUpperCaseLocalName() {
public void replaceToUpperCaseLocalName() {
final ParameterizedString p =
new ParameterizedString("${a.toUpperCase.localPart}");
assertEquals(1, p.getParameterNames().size());
@@ -244,7 +244,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToUpperCaseAnUndefinedMethod() {
public void replaceToUpperCaseAnUndefinedMethod() {
final ParameterizedString p =
new ParameterizedString("${a.toUpperCase.anUndefinedMethod}");
assertEquals(1, p.getParameterNames().size());
@@ -266,7 +266,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceLocalNameToUpperCase() {
public void replaceLocalNameToUpperCase() {
final ParameterizedString p =
new ParameterizedString("${a.localPart.toUpperCase}");
assertEquals(1, p.getParameterNames().size());
@@ -288,7 +288,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceLocalNameToLowerCase() {
public void replaceLocalNameToLowerCase() {
final ParameterizedString p =
new ParameterizedString("${a.localPart.toLowerCase}");
assertEquals(1, p.getParameterNames().size());
@@ -310,7 +310,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceLocalNameAnUndefinedMethod() {
public void replaceLocalNameAnUndefinedMethod() {
final ParameterizedString p =
new ParameterizedString("${a.localPart.anUndefinedMethod}");
assertEquals(1, p.getParameterNames().size());
@@ -332,7 +332,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToLowerCaseToUpperCase() {
public void replaceToLowerCaseToUpperCase() {
final ParameterizedString p =
new ParameterizedString("${a.toLowerCase.toUpperCase}");
assertEquals(1, p.getParameterNames().size());
@@ -354,7 +354,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToLowerCaseLocalName() {
public void replaceToLowerCaseLocalName() {
final ParameterizedString p =
new ParameterizedString("${a.toLowerCase.localPart}");
assertEquals(1, p.getParameterNames().size());
@@ -376,7 +376,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceToLowerCaseAnUndefinedMethod() {
public void replaceToLowerCaseAnUndefinedMethod() {
final ParameterizedString p =
new ParameterizedString("${a.toLowerCase.anUndefinedMethod}");
assertEquals(1, p.getParameterNames().size());
@@ -398,7 +398,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceSubmitTooltipWithVariables() {
public void replaceSubmitTooltipWithVariables() {
ParameterizedString p = new ParameterizedString(
"Submit patch set ${patchSet} into ${branch}");
assertEquals(2, p.getParameterNames().size());
@@ -415,7 +415,7 @@ public class ParameterizedStringTest {
}
@Test
public void testReplaceSubmitTooltipWithoutVariables() {
public void replaceSubmitTooltipWithoutVariables() {
ParameterizedString p = new ParameterizedString(
"Submit patch set 40 into master");
Map<String, String> params = ImmutableMap.of(

View File

@@ -33,13 +33,13 @@ public class DynamicSetTest {
// {@code assertThat(ds.contains(...)).isFalse() @} instead.
@Test
public void testContainsWithEmpty() throws Exception {
public void containsWithEmpty() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
assertThat(ds.contains(2)).isFalse(); //See above comment about ds.contains
}
@Test
public void testContainsTrueWithSingleElement() throws Exception {
public void containsTrueWithSingleElement() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);
@@ -47,7 +47,7 @@ public class DynamicSetTest {
}
@Test
public void testContainsFalseWithSingleElement() throws Exception {
public void containsFalseWithSingleElement() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);
@@ -55,7 +55,7 @@ public class DynamicSetTest {
}
@Test
public void testContainsTrueWithTwoElements() throws Exception {
public void containsTrueWithTwoElements() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);
ds.add(4);
@@ -64,7 +64,7 @@ public class DynamicSetTest {
}
@Test
public void testContainsFalseWithTwoElements() throws Exception {
public void containsFalseWithTwoElements() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);
ds.add(4);
@@ -73,7 +73,7 @@ public class DynamicSetTest {
}
@Test
public void testContainsDynamic() throws Exception {
public void containsDynamic() throws Exception {
DynamicSet<Integer> ds = new DynamicSet<>();
ds.add(2);

View File

@@ -85,7 +85,7 @@ public class PublicKeyStoreTest {
}
@Test
public void testGet() throws Exception {
public void get() throws Exception {
TestKey key1 = validKeyWithoutExpiration();
tr.branch(REFS_GPG_KEYS)
.commit()
@@ -104,7 +104,7 @@ public class PublicKeyStoreTest {
}
@Test
public void testGetMultiple() throws Exception {
public void getMultiple() throws Exception {
TestKey key1 = validKeyWithoutExpiration();
TestKey key2 = validKeyWithExpiration();
tr.branch(REFS_GPG_KEYS)

View File

@@ -15,7 +15,8 @@
package com.google.gwtexpui.safehtml.client;
import static com.google.common.truth.Truth.assertThat;
import static com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme;
import com.google.gwtexpui.safehtml.client.LinkFindReplace;
import org.junit.Rule;
import org.junit.Test;
@@ -26,7 +27,7 @@ public class LinkFindReplaceTest {
public ExpectedException exception = ExpectedException.none();
@Test
public void testNoEscaping() {
public void noEscaping() {
String find = "find";
String link = "link";
LinkFindReplace a = new LinkFindReplace(find, link);
@@ -36,7 +37,7 @@ public class LinkFindReplaceTest {
}
@Test
public void testBackreference() {
public void backreference() {
LinkFindReplace l = new LinkFindReplace(
"(bug|issue)\\s*([0-9]+)", "/bug?id=$2");
assertThat(l.replace("issue 123"))
@@ -44,39 +45,39 @@ public class LinkFindReplaceTest {
}
@Test
public void testHasValidScheme() {
assertThat(hasValidScheme("/absolute/path")).isTrue();
assertThat(hasValidScheme("relative/path")).isTrue();
assertThat(hasValidScheme("http://url/")).isTrue();
assertThat(hasValidScheme("HTTP://url/")).isTrue();
assertThat(hasValidScheme("https://url/")).isTrue();
assertThat(hasValidScheme("mailto://url/")).isTrue();
assertThat(hasValidScheme("ftp://url/")).isFalse();
assertThat(hasValidScheme("data:evil")).isFalse();
assertThat(hasValidScheme("javascript:alert(1)")).isFalse();
public void hasValidScheme() {
assertThat(LinkFindReplace.hasValidScheme("/absolute/path")).isTrue();
assertThat(LinkFindReplace.hasValidScheme("relative/path")).isTrue();
assertThat(LinkFindReplace.hasValidScheme("http://url/")).isTrue();
assertThat(LinkFindReplace.hasValidScheme("HTTP://url/")).isTrue();
assertThat(LinkFindReplace.hasValidScheme("https://url/")).isTrue();
assertThat(LinkFindReplace.hasValidScheme("mailto://url/")).isTrue();
assertThat(LinkFindReplace.hasValidScheme("ftp://url/")).isFalse();
assertThat(LinkFindReplace.hasValidScheme("data:evil")).isFalse();
assertThat(LinkFindReplace.hasValidScheme("javascript:alert(1)")).isFalse();
}
@Test
public void testInvalidSchemeInReplace() {
public void invalidSchemeInReplace() {
exception.expect(IllegalArgumentException.class);
new LinkFindReplace("find", "javascript:alert(1)").replace("find");
}
@Test
public void testInvalidSchemeWithBackreference() {
public void invalidSchemeWithBackreference() {
exception.expect(IllegalArgumentException.class);
new LinkFindReplace(".*(script:[^;]*)", "java$1")
.replace("Look at this script: alert(1);");
}
@Test
public void testReplaceEscaping() {
public void replaceEscaping() {
assertThat(new LinkFindReplace("find", "a\"&'<>b").replace("find"))
.isEqualTo("<a href=\"a&quot;&amp;&#39;&lt;&gt;b\">find</a>");
}
@Test
public void testHtmlInFind() {
public void htmlInFind() {
String rawFind = "<b>&quot;bold&quot;</b>";
LinkFindReplace a = new LinkFindReplace(rawFind, "/bold");
assertThat(a.pattern().getSource()).isEqualTo(rawFind);

View File

@@ -20,7 +20,7 @@ import org.junit.Test;
public class RawFindReplaceTest {
@Test
public void testFindReplace() {
public void findReplace() {
final String find = "find";
final String replace = "replace";
final RawFindReplace a = new RawFindReplace(find, replace);

View File

@@ -25,7 +25,7 @@ public class SafeHtmlBuilderTest {
public ExpectedException exception = ExpectedException.none();
@Test
public void testEmpty() {
public void empty() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b.isEmpty()).isTrue();
assertThat(b.hasContent()).isFalse();
@@ -37,7 +37,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testToSafeHtml() {
public void toSafeHtml() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
b.append(1);
@@ -49,7 +49,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_boolean() {
public void append_boolean() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append(true));
assertThat(b).isSameAs(b.append(false));
@@ -57,7 +57,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_char() {
public void append_char() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append('a'));
assertThat(b).isSameAs(b.append('b'));
@@ -65,7 +65,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_int() {
public void append_int() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append(4));
assertThat(b).isSameAs(b.append(2));
@@ -74,7 +74,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_long() {
public void append_long() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append(4L));
assertThat(b).isSameAs(b.append(2L));
@@ -82,21 +82,21 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_float() {
public void append_float() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append(0.0f));
assertThat(b.asString()).isEqualTo("0.0");
}
@Test
public void testAppend_double() {
public void append_double() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append(0.0));
assertThat(b.asString()).isEqualTo("0.0");
}
@Test
public void testAppend_String() {
public void append_String() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append((String) null));
assertThat(b.asString()).isEmpty();
@@ -106,7 +106,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_StringBuilder() {
public void append_StringBuilder() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append((StringBuilder) null));
assertThat(b.asString()).isEmpty();
@@ -116,7 +116,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_StringBuffer() {
public void append_StringBuffer() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append((StringBuffer) null));
assertThat(b.asString()).isEmpty();
@@ -126,7 +126,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_Object() {
public void append_Object() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append((Object) null));
assertThat(b.asString()).isEmpty();
@@ -140,7 +140,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_CharSequence() {
public void append_CharSequence() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append((CharSequence) null));
assertThat(b.asString()).isEmpty();
@@ -150,7 +150,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testAppend_SafeHtml() {
public void append_SafeHtml() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.append((SafeHtml) null));
assertThat(b.asString()).isEmpty();
@@ -160,7 +160,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testHtmlSpecialCharacters() {
public void htmlSpecialCharacters() {
assertThat(escape("&")).isEqualTo("&amp;");
assertThat(escape("<")).isEqualTo("&lt;");
assertThat(escape(">")).isEqualTo("&gt;");
@@ -178,21 +178,21 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testEntityNbsp() {
public void entityNbsp() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.nbsp());
assertThat(b.asString()).isEqualTo("&nbsp;");
}
@Test
public void testTagBr() {
public void tagBr() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.br());
assertThat(b.asString()).isEqualTo("<br />");
}
@Test
public void testTagTableTrTd() {
public void tagTableTrTd() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.openElement("table"));
assertThat(b).isSameAs(b.openTr());
@@ -205,7 +205,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testTagDiv() {
public void tagDiv() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.openDiv());
assertThat(b).isSameAs(b.append("d<a>ta"));
@@ -214,7 +214,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testTagAnchor() {
public void tagAnchor() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.openAnchor());
@@ -234,7 +234,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testTagHeightWidth() {
public void tagHeightWidth() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.openElement("img"));
assertThat(b).isSameAs(b.setHeight(100));
@@ -244,7 +244,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testStyleName() {
public void styleName() {
final SafeHtmlBuilder b = new SafeHtmlBuilder();
assertThat(b).isSameAs(b.openSpan());
assertThat(b).isSameAs(b.setStyleName("foo"));
@@ -255,7 +255,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testRejectJavaScript_AnchorHref() {
public void rejectJavaScript_AnchorHref() {
final String href = "javascript:window.close();";
exception.expect(RuntimeException.class);
exception.expectMessage("javascript unsafe in href: " + href);
@@ -263,7 +263,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testRejectJavaScript_ImgSrc() {
public void rejectJavaScript_ImgSrc() {
final String href = "javascript:window.close();";
exception.expect(RuntimeException.class);
exception.expectMessage("javascript unsafe in href: " + href);
@@ -271,7 +271,7 @@ public class SafeHtmlBuilderTest {
}
@Test
public void testRejectJavaScript_FormAction() {
public void rejectJavaScript_FormAction() {
final String href = "javascript:window.close();";
exception.expect(RuntimeException.class);
exception.expectMessage("javascript unsafe in href: " + href);

View File

@@ -20,7 +20,7 @@ import org.junit.Test;
public class SafeHtml_LinkifyTest {
@Test
public void testLinkify_SimpleHttp1() {
public void linkify_SimpleHttp1() {
final SafeHtml o = html("A http://go.here/ B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -30,7 +30,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_SimpleHttps2() {
public void linkify_SimpleHttps2() {
final SafeHtml o = html("A https://go.here/ B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -40,7 +40,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_Parens1() {
public void linkify_Parens1() {
final SafeHtml o = html("A (http://go.here/) B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -50,7 +50,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_Parens() {
public void linkify_Parens() {
final SafeHtml o = html("A http://go.here/#m() B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -60,7 +60,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_AngleBrackets1() {
public void linkify_AngleBrackets1() {
final SafeHtml o = html("A <http://go.here/> B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -70,7 +70,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_TrailingPlainLetter() {
public void linkify_TrailingPlainLetter() {
final SafeHtml o = html("A http://go.here/foo B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -80,7 +80,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_TrailingDot() {
public void linkify_TrailingDot() {
final SafeHtml o = html("A http://go.here/. B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -90,7 +90,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_TrailingComma() {
public void linkify_TrailingComma() {
final SafeHtml o = html("A http://go.here/, B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);
@@ -100,7 +100,7 @@ public class SafeHtml_LinkifyTest {
}
@Test
public void testLinkify_TrailingDotDot() {
public void linkify_TrailingDotDot() {
final SafeHtml o = html("A http://go.here/.. B");
final SafeHtml n = o.linkify();
assertThat(o).isNotSameAs(n);

View File

@@ -24,14 +24,14 @@ import java.util.List;
public class SafeHtml_ReplaceTest {
@Test
public void testReplaceEmpty() {
public void replaceEmpty() {
SafeHtml o = html("A\nissue42\nB");
assertThat(o.replaceAll(null)).isSameAs(o);
assertThat(o.replaceAll(Collections.<FindReplace> emptyList())).isSameAs(o);
}
@Test
public void testReplaceOneLink() {
public void replaceOneLink() {
SafeHtml o = html("A\nissue 42\nB");
SafeHtml n = o.replaceAll(repls(
new RawFindReplace("(issue\\s(\\d+))", "<a href=\"?$2\">$1</a>")));
@@ -41,7 +41,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testReplaceNoLeadingOrTrailingText() {
public void replaceNoLeadingOrTrailingText() {
SafeHtml o = html("issue 42");
SafeHtml n = o.replaceAll(repls(
new RawFindReplace("(issue\\s(\\d+))", "<a href=\"?$2\">$1</a>")));
@@ -51,7 +51,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testReplaceTwoLinks() {
public void replaceTwoLinks() {
SafeHtml o = html("A\nissue 42\nissue 9918\nB");
SafeHtml n = o.replaceAll(repls(
new RawFindReplace("(issue\\s(\\d+))", "<a href=\"?$2\">$1</a>")));
@@ -64,7 +64,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testReplaceInOrder() {
public void replaceInOrder() {
SafeHtml o = html("A\nissue 42\nReally GWTEXPUI-9918 is better\nB");
SafeHtml n = o.replaceAll(repls(
new RawFindReplace("(GWTEXPUI-(\\d+))",
@@ -80,7 +80,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testReplaceOverlappingAfterFirstChar() {
public void replaceOverlappingAfterFirstChar() {
SafeHtml o = html("abcd");
RawFindReplace ab = new RawFindReplace("ab", "AB");
RawFindReplace bc = new RawFindReplace("bc", "23");
@@ -92,7 +92,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testReplaceOverlappingAtFirstCharLongestMatch() {
public void replaceOverlappingAtFirstCharLongestMatch() {
SafeHtml o = html("abcd");
RawFindReplace ab = new RawFindReplace("ab", "AB");
RawFindReplace abc = new RawFindReplace("[^d][^d][^d]", "234");
@@ -102,7 +102,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testReplaceOverlappingAtFirstCharFirstMatch() {
public void replaceOverlappingAtFirstCharFirstMatch() {
SafeHtml o = html("abcd");
RawFindReplace ab1 = new RawFindReplace("ab", "AB");
RawFindReplace ab2 = new RawFindReplace("[^cd][^cd]", "12");
@@ -112,7 +112,7 @@ public class SafeHtml_ReplaceTest {
}
@Test
public void testFailedSanitization() {
public void failedSanitization() {
SafeHtml o = html("abcd");
LinkFindReplace evil = new LinkFindReplace("(b)", "javascript:alert('$1')");
LinkFindReplace ok = new LinkFindReplace("(b)", "/$1");

View File

@@ -27,7 +27,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testBulletList1() {
public void bulletList1() {
final SafeHtml o = html("A\n\n* line 1\n* 2nd line");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -40,7 +40,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testBulletList2() {
public void bulletList2() {
final SafeHtml o = html("A\n\n* line 1\n* 2nd line\n\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -54,7 +54,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testBulletList3() {
public void bulletList3() {
final SafeHtml o = html("* line 1\n* 2nd line\n\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -67,7 +67,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testBulletList4() {
public void bulletList4() {
final SafeHtml o = html("To see this bug, you have to:\n" //
+ "* Be on IMAP or EAS (not on POP)\n"//
+ "* Be very unlucky\n");
@@ -82,7 +82,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testBulletList5() {
public void bulletList5() {
final SafeHtml o = html("To see this bug,\n" //
+ "you have to:\n" //
+ "* Be on IMAP or EAS (not on POP)\n"//
@@ -98,7 +98,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testDashList1() {
public void dashList1() {
final SafeHtml o = html("A\n\n- line 1\n- 2nd line");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -111,7 +111,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testDashList2() {
public void dashList2() {
final SafeHtml o = html("A\n\n- line 1\n- 2nd line\n\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -125,7 +125,7 @@ public class SafeHtml_WikifyListTest {
}
@Test
public void testDashList3() {
public void dashList3() {
final SafeHtml o = html("- line 1\n- 2nd line\n\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);

View File

@@ -27,7 +27,7 @@ public class SafeHtml_WikifyPreformatTest {
}
@Test
public void testPreformat1() {
public void preformat1() {
final SafeHtml o = html("A\n\n This is pre\n formatted");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -40,7 +40,7 @@ public class SafeHtml_WikifyPreformatTest {
}
@Test
public void testPreformat2() {
public void preformat2() {
final SafeHtml o = html("A\n\n This is pre\n formatted\n\nbut this is not");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -54,7 +54,7 @@ public class SafeHtml_WikifyPreformatTest {
}
@Test
public void testPreformat3() {
public void preformat3() {
final SafeHtml o = html("A\n\n Q\n <R>\n S\n\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -69,7 +69,7 @@ public class SafeHtml_WikifyPreformatTest {
}
@Test
public void testPreformat4() {
public void preformat4() {
final SafeHtml o = html(" Q\n <R>\n S\n\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);

View File

@@ -27,7 +27,7 @@ public class SafeHtml_WikifyQuoteTest {
}
@Test
public void testQuote1() {
public void quote1() {
final SafeHtml o = html("> I'm happy\n > with quotes!\n\nSee above.");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -37,7 +37,7 @@ public class SafeHtml_WikifyQuoteTest {
}
@Test
public void testQuote2() {
public void quote2() {
final SafeHtml o = html("See this said:\n\n > a quoted\n > string block\n\nOK?");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -48,7 +48,7 @@ public class SafeHtml_WikifyQuoteTest {
}
@Test
public void testNestedQuotes1() {
public void nestedQuotes1() {
final SafeHtml o = html(" > > prior\n > \n > next\n");
final SafeHtml n = o.wikify();
assertThat(n.asString()).isEqualTo(quote(quote("prior") + "next\n"));

View File

@@ -20,7 +20,7 @@ import org.junit.Test;
public class SafeHtml_WikifyTest {
@Test
public void testWikify_OneLine1() {
public void wikify_OneLine1() {
final SafeHtml o = html("A B");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -28,7 +28,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testWikify_OneLine2() {
public void wikify_OneLine2() {
final SafeHtml o = html("A B\n");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -36,7 +36,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testWikify_OneParagraph1() {
public void wikify_OneParagraph1() {
final SafeHtml o = html("A\nB");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -44,7 +44,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testWikify_OneParagraph2() {
public void wikify_OneParagraph2() {
final SafeHtml o = html("A\nB\n");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -52,7 +52,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testWikify_TwoParagraphs() {
public void wikify_TwoParagraphs() {
final SafeHtml o = html("A\nB\n\nC\nD");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -60,7 +60,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testLinkify_SimpleHttp1() {
public void linkify_SimpleHttp1() {
final SafeHtml o = html("A http://go.here/ B");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -70,7 +70,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testLinkify_SimpleHttps2() {
public void linkify_SimpleHttps2() {
final SafeHtml o = html("A https://go.here/ B");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -80,7 +80,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testLinkify_Parens1() {
public void linkify_Parens1() {
final SafeHtml o = html("A (http://go.here/) B");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -90,7 +90,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testLinkify_Parens() {
public void linkify_Parens() {
final SafeHtml o = html("A http://go.here/#m() B");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);
@@ -100,7 +100,7 @@ public class SafeHtml_WikifyTest {
}
@Test
public void testLinkify_AngleBrackets1() {
public void linkify_AngleBrackets1() {
final SafeHtml o = html("A <http://go.here/> B");
final SafeHtml n = o.wikify();
assertThat(o).isNotSameAs(n);

View File

@@ -36,19 +36,19 @@ public class RelativeDateFormatterTest {
}
@Test
public void testFuture() {
public void future() {
assertFormat(-100, YEAR_IN_MILLIS, "in the future");
assertFormat(-1, SECOND_IN_MILLIS, "in the future");
}
@Test
public void testFormatSeconds() {
public void formatSeconds() {
assertFormat(1, SECOND_IN_MILLIS, "1 seconds ago");
assertFormat(89, SECOND_IN_MILLIS, "89 seconds ago");
}
@Test
public void testFormatMinutes() {
public void formatMinutes() {
assertFormat(90, SECOND_IN_MILLIS, "2 minutes ago");
assertFormat(3, MINUTE_IN_MILLIS, "3 minutes ago");
assertFormat(60, MINUTE_IN_MILLIS, "60 minutes ago");
@@ -56,33 +56,33 @@ public class RelativeDateFormatterTest {
}
@Test
public void testFormatHours() {
public void formatHours() {
assertFormat(90, MINUTE_IN_MILLIS, "2 hours ago");
assertFormat(149, MINUTE_IN_MILLIS, "2 hours ago");
assertFormat(35, HOUR_IN_MILLIS, "35 hours ago");
}
@Test
public void testFormatDays() {
public void formatDays() {
assertFormat(36, HOUR_IN_MILLIS, "2 days ago");
assertFormat(13, DAY_IN_MILLIS, "13 days ago");
}
@Test
public void testFormatWeeks() {
public void formatWeeks() {
assertFormat(14, DAY_IN_MILLIS, "2 weeks ago");
assertFormat(69, DAY_IN_MILLIS, "10 weeks ago");
}
@Test
public void testFormatMonths() {
public void formatMonths() {
assertFormat(70, DAY_IN_MILLIS, "2 months ago");
assertFormat(75, DAY_IN_MILLIS, "3 months ago");
assertFormat(364, DAY_IN_MILLIS, "12 months ago");
}
@Test
public void testFormatYearsMonths() {
public void formatYearsMonths() {
assertFormat(366, DAY_IN_MILLIS, "1 year ago");
assertFormat(380, DAY_IN_MILLIS, "1 year, 1 month ago");
assertFormat(410, DAY_IN_MILLIS, "1 year, 2 months ago");
@@ -91,7 +91,7 @@ public class RelativeDateFormatterTest {
}
@Test
public void testFormatYears() {
public void formatYears() {
assertFormat(5, YEAR_IN_MILLIS, "5 years ago");
assertFormat(60, YEAR_IN_MILLIS, "60 years ago");
}

View File

@@ -24,7 +24,7 @@ import org.junit.Test;
public class LineMapperTest {
@Test
public void testAppendCommon() {
public void appendCommon() {
LineMapper mapper = new LineMapper();
mapper.appendCommon(10);
assertEquals(10, mapper.getLineA());
@@ -32,7 +32,7 @@ public class LineMapperTest {
}
@Test
public void testAppendInsert() {
public void appendInsert() {
LineMapper mapper = new LineMapper();
mapper.appendInsert(10);
assertEquals(0, mapper.getLineA());
@@ -40,7 +40,7 @@ public class LineMapperTest {
}
@Test
public void testAppendDelete() {
public void appendDelete() {
LineMapper mapper = new LineMapper();
mapper.appendDelete(10);
assertEquals(10, mapper.getLineA());
@@ -48,7 +48,7 @@ public class LineMapperTest {
}
@Test
public void testFindInCommon() {
public void findInCommon() {
LineMapper mapper = new LineMapper();
mapper.appendCommon(10);
assertEquals(new LineOnOtherInfo(9, true),
@@ -58,7 +58,7 @@ public class LineMapperTest {
}
@Test
public void testFindAfterCommon() {
public void findAfterCommon() {
LineMapper mapper = new LineMapper();
mapper.appendCommon(10);
assertEquals(new LineOnOtherInfo(10, true),
@@ -68,7 +68,7 @@ public class LineMapperTest {
}
@Test
public void testFindInInsertGap() {
public void findInInsertGap() {
LineMapper mapper = new LineMapper();
mapper.appendInsert(10);
assertEquals(new LineOnOtherInfo(-1, false),
@@ -76,7 +76,7 @@ public class LineMapperTest {
}
@Test
public void testFindAfterInsertGap() {
public void findAfterInsertGap() {
LineMapper mapper = new LineMapper();
mapper.appendInsert(10);
assertEquals(new LineOnOtherInfo(0, true),
@@ -86,7 +86,7 @@ public class LineMapperTest {
}
@Test
public void testFindInDeleteGap() {
public void findInDeleteGap() {
LineMapper mapper = new LineMapper();
mapper.appendDelete(10);
assertEquals(new LineOnOtherInfo(-1, false),
@@ -94,7 +94,7 @@ public class LineMapperTest {
}
@Test
public void testFindAfterDeleteGap() {
public void findAfterDeleteGap() {
LineMapper mapper = new LineMapper();
mapper.appendDelete(10);
assertEquals(new LineOnOtherInfo(0, true),
@@ -104,7 +104,7 @@ public class LineMapperTest {
}
@Test
public void testReplaceWithInsertInB() {
public void replaceWithInsertInB() {
// 0 c c
// 1 a b
// 2 a b

View File

@@ -85,7 +85,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testNoFilters() throws Exception {
public void noFilters() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock(FilterConfig.class);
@@ -107,7 +107,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testSingleFilterNoBubbling() throws Exception {
public void singleFilterNoBubbling() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock("config", FilterConfig.class);
@@ -134,7 +134,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testSingleFilterBubbling() throws Exception {
public void singleFilterBubbling() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock(FilterConfig.class);
@@ -166,7 +166,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testTwoFiltersNoBubbling() throws Exception {
public void twoFiltersNoBubbling() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock(FilterConfig.class);
@@ -199,7 +199,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testTwoFiltersBubbling() throws Exception {
public void twoFiltersBubbling() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock(FilterConfig.class);
@@ -239,7 +239,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testPostponedLoading() throws Exception {
public void postponedLoading() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock(FilterConfig.class);
@@ -291,7 +291,7 @@ public class AllRequestFilterFilterProxyTest {
}
@Test
public void testDynamicUnloading() throws Exception {
public void dynamicUnloading() throws Exception {
EasyMockSupport ems = new EasyMockSupport();
FilterConfig config = ems.createMock(FilterConfig.class);

View File

@@ -29,7 +29,7 @@ public class ContextMapperTest {
private static final String RESOURCE = "my-resource";
@Test
public void testUnauthorized() throws Exception {
public void unauthorized() throws Exception {
ContextMapper classUnderTest = new ContextMapper(CONTEXT);
HttpServletRequest originalRequest =
@@ -47,7 +47,7 @@ public class ContextMapperTest {
}
@Test
public void testAuthorized() throws Exception {
public void authorized() throws Exception {
ContextMapper classUnderTest = new ContextMapper(CONTEXT);
HttpServletRequest originalRequest =

View File

@@ -27,7 +27,7 @@ import org.junit.Test;
public class ParameterParserTest {
@Test
public void testConvertFormToJson() throws BadRequestException {
public void convertFormToJson() throws BadRequestException {
JsonObject obj = ParameterParser.formToJson(
ImmutableMap.of(
"message", new String[]{"this.is.text"},

View File

@@ -20,7 +20,7 @@ import org.junit.Test;
public class EditDeserializerTest {
@Test
public void testDiffDeserializer() {
public void diffDeserializer() {
assertNotNull("edit deserializer", new EditDeserializer());
}
}

View File

@@ -30,7 +30,7 @@ import java.util.Collections;
public class LibrariesTest {
@Test
public void testCreate() throws Exception {
public void create() throws Exception {
final SitePaths site = new SitePaths(Paths.get("."));
final ConsoleUI ui = createStrictMock(ConsoleUI.class);

View File

@@ -50,7 +50,7 @@ import java.util.List;
public class UpgradeFrom2_0_xTest extends InitTestCase {
@Test
public void testUpgrade() throws IOException, ConfigInvalidException {
public void upgrade() throws IOException, ConfigInvalidException {
final Path p = newSitePath();
final SitePaths site = new SitePaths(p);
assertTrue(site.isNew);

View File

@@ -34,7 +34,7 @@ public class AccountSshKeyTest {
private final Account.Id accountId = new Account.Id(1);
@Test
public void testValidity() throws Exception {
public void validity() throws Exception {
AccountSshKey key = new AccountSshKey(
new AccountSshKey.Id(accountId, -1), KEY);
assertThat(key.isValid()).isFalse();
@@ -45,7 +45,7 @@ public class AccountSshKeyTest {
}
@Test
public void testGetters() throws Exception {
public void getters() throws Exception {
AccountSshKey key = new AccountSshKey(
new AccountSshKey.Id(accountId, 1), KEY);
assertThat(key.getSshPublicKey()).isEqualTo(KEY);
@@ -55,7 +55,7 @@ public class AccountSshKeyTest {
}
@Test
public void testKeyWithNewLines() throws Exception {
public void keyWithNewLines() throws Exception {
AccountSshKey key = new AccountSshKey(
new AccountSshKey.Id(accountId, 1), KEY_WITH_NEWLINES);
assertThat(key.getSshPublicKey()).isEqualTo(KEY);

View File

@@ -82,7 +82,7 @@ public class PatchSetTest {
}
@Test
public void testToRefName() {
public void toRefName() {
assertThat(new PatchSet.Id(new Change.Id(1), 23).toRefName())
.isEqualTo("refs/changes/01/1/23");
assertThat(new PatchSet.Id(new Change.Id(1234), 5).toRefName())

View File

@@ -92,7 +92,7 @@ public class RefNamesTest {
}
@Test
public void testParseShardedRefsPart() throws Exception {
public void testparseShardedRefsPart() throws Exception {
assertThat(parseShardedRefPart("01/1")).isEqualTo(1);
assertThat(parseShardedRefPart("01/1-drafts")).isEqualTo(1);
assertThat(parseShardedRefPart("01/1-drafts/2")).isEqualTo(1);

View File

@@ -54,13 +54,13 @@ public class ProcMetricModuleTest {
MetricRegistry registry;
@Test
public void testConstantBuildLabel() {
public void constantBuildLabel() {
Gauge<String> buildLabel = gauge("build/label");
assertThat(buildLabel.getValue()).isEqualTo(Version.getVersion());
}
@Test
public void testProcUptime() {
public void procUptime() {
Gauge<Long> birth = gauge("proc/birth_timestamp");
assertThat(birth.getValue()).isAtMost(
TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()));
@@ -70,7 +70,7 @@ public class ProcMetricModuleTest {
}
@Test
public void testCounter0() {
public void counter0() {
Counter0 cntr = metrics.newCounter(
"test/count",
new Description("simple test")
@@ -87,7 +87,7 @@ public class ProcMetricModuleTest {
}
@Test
public void testCounter1() {
public void counter1() {
Counter1<String> cntr = metrics.newCounter(
"test/count",
new Description("simple test")
@@ -110,7 +110,7 @@ public class ProcMetricModuleTest {
}
@Test
public void testCounterPrefixFields() {
public void counterPrefixFields() {
Counter1<String> cntr = metrics.newCounter(
"test/count",
new Description("simple test")
@@ -134,7 +134,7 @@ public class ProcMetricModuleTest {
}
@Test
public void testCallbackMetric0() {
public void callbackMetric0() {
final CallbackMetric0<Long> cntr = metrics.newCallbackMetric(
"test/count",
Long.class,
@@ -161,13 +161,13 @@ public class ProcMetricModuleTest {
}
@Test
public void testInvalidName1() {
public void invalidName1() {
exception.expect(IllegalArgumentException.class);
metrics.newCounter("invalid name", new Description("fail"));
}
@Test
public void testInvalidName2() {
public void invalidName2() {
exception.expect(IllegalArgumentException.class);
metrics.newCounter("invalid/ name", new Description("fail"));
}

View File

@@ -70,12 +70,12 @@ public class GerritCommonTest extends PrologTestCase {
}
@Test
public void testGerritCommon() {
public void gerritCommon() {
runPrologBasedTests();
}
@Test
public void testReductionLimit() throws CompileException {
public void reductionLimit() throws CompileException {
PrologEnvironment env = envFactory.create(machine);
setUpEnvironment(env);

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));