diff options
author | James Moger <james.moger@gitblit.com> | 2011-06-08 20:48:07 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-06-08 20:48:07 -0400 |
commit | 008322bec70a3a20bd00ed2219215a9f42fe0ca5 (patch) | |
tree | a5b8e4a6ba7169c94bc89d5a8a0ad838f5aea20a /tests | |
parent | 716745e2dd9b3925b1229433e7072580206f731e (diff) | |
download | gitblit-008322bec70a3a20bd00ed2219215a9f42fe0ca5.tar.gz gitblit-008322bec70a3a20bd00ed2219215a9f42fe0ca5.zip |
Blame support finished, requires JGit 1.0.0. Checkstyle. Findbugs.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/com/gitblit/tests/JGitUtilsTest.java | 15 | ||||
-rw-r--r-- | tests/com/gitblit/tests/MetricUtilsTest.java | 2 | ||||
-rw-r--r-- | tests/com/gitblit/tests/StringUtilsTest.java | 8 | ||||
-rw-r--r-- | tests/com/gitblit/tests/TicgitUtilsTest.java | 4 |
4 files changed, 16 insertions, 13 deletions
diff --git a/tests/com/gitblit/tests/JGitUtilsTest.java b/tests/com/gitblit/tests/JGitUtilsTest.java index 277166cf..1b575856 100644 --- a/tests/com/gitblit/tests/JGitUtilsTest.java +++ b/tests/com/gitblit/tests/JGitUtilsTest.java @@ -96,10 +96,11 @@ public class JGitUtilsTest extends TestCase { public void testCreateRepository() throws Exception {
String[] repositories = { "NewTestRepository.git", "NewTestRepository" };
- for (String repositoryName : repositories) {
+ for (String repositoryName : repositories) {
Repository repository = JGitUtils.createRepository(GitBlitSuite.REPOSITORIES,
repositoryName);
- File folder = FileKey.resolve(new File(GitBlitSuite.REPOSITORIES, repositoryName), FS.DETECTED);
+ File folder = FileKey.resolve(new File(GitBlitSuite.REPOSITORIES, repositoryName),
+ FS.DETECTED);
assertTrue(repository != null);
assertFalse(JGitUtils.hasCommits(repository));
assertTrue(JGitUtils.getFirstCommit(repository, null) == null);
@@ -121,10 +122,11 @@ public class JGitUtilsTest extends TestCase { List<RefModel> list = entry.getValue();
for (RefModel ref : list) {
if (ref.displayName.equals("refs/tags/spearce-gpg-pub")) {
- assertTrue(ref.getObjectId().getName().equals("8bbde7aacf771a9afb6992434f1ae413e010c6d8"));
+ assertTrue(ref.getObjectId().getName()
+ .equals("8bbde7aacf771a9afb6992434f1ae413e010c6d8"));
assertTrue(ref.getAuthorIdent().getEmailAddress().equals("spearce@spearce.org"));
assertTrue(ref.getShortMessage().startsWith("GPG key"));
- assertTrue(ref.getFullMessage().startsWith("GPG key"));
+ assertTrue(ref.getFullMessage().startsWith("GPG key"));
assertTrue(ref.getReferencedObjectType() == Constants.OBJ_BLOB);
} else if (ref.displayName.equals("refs/tags/v0.12.1")) {
assertTrue(ref.isAnnotatedTag());
@@ -168,13 +170,14 @@ public class JGitUtilsTest extends TestCase { + model.getName().hashCode());
}
repository.close();
-
+
repository = GitBlitSuite.getBluezGnomeRepository();
for (RefModel model : JGitUtils.getTags(repository, true, -1)) {
if (model.getObjectId().getName().equals("728643ec0c438c77e182898c2f2967dbfdc231c8")) {
assertFalse(model.isAnnotatedTag());
assertTrue(model.getAuthorIdent().getEmailAddress().equals("marcel@holtmann.org"));
- assertTrue(model.getFullMessage().equals("Update changelog and bump version number\n"));
+ assertTrue(model.getFullMessage().equals(
+ "Update changelog and bump version number\n"));
}
}
repository.close();
diff --git a/tests/com/gitblit/tests/MetricUtilsTest.java b/tests/com/gitblit/tests/MetricUtilsTest.java index db994b80..c9d007df 100644 --- a/tests/com/gitblit/tests/MetricUtilsTest.java +++ b/tests/com/gitblit/tests/MetricUtilsTest.java @@ -32,7 +32,7 @@ public class MetricUtilsTest extends TestCase { repository.close();
assertTrue("No date metrics found!", metrics.size() > 0);
}
-
+
public void testAuthorMetrics() throws Exception {
Repository repository = GitBlitSuite.getHelloworldRepository();
List<Metric> byEmail = MetricUtils.getAuthorMetrics(repository, null, true);
diff --git a/tests/com/gitblit/tests/StringUtilsTest.java b/tests/com/gitblit/tests/StringUtilsTest.java index 49938ae4..df51a4bb 100644 --- a/tests/com/gitblit/tests/StringUtilsTest.java +++ b/tests/com/gitblit/tests/StringUtilsTest.java @@ -38,10 +38,10 @@ public class StringUtilsTest extends TestCase { public void testEscapeForHtml() throws Exception {
String input = "& < > \" \t";
- String output_nochange = "& < > " \t";
- String output_change = "& < > " ";
- assertTrue(StringUtils.escapeForHtml(input, false).equals(output_nochange));
- assertTrue(StringUtils.escapeForHtml(input, true).equals(output_change));
+ String outputNoChange = "& < > " \t";
+ String outputChange = "& < > " ";
+ assertTrue(StringUtils.escapeForHtml(input, false).equals(outputNoChange));
+ assertTrue(StringUtils.escapeForHtml(input, true).equals(outputChange));
}
public void testFlattenStrings() throws Exception {
diff --git a/tests/com/gitblit/tests/TicgitUtilsTest.java b/tests/com/gitblit/tests/TicgitUtilsTest.java index 792c4269..9f5a488b 100644 --- a/tests/com/gitblit/tests/TicgitUtilsTest.java +++ b/tests/com/gitblit/tests/TicgitUtilsTest.java @@ -33,7 +33,7 @@ public class TicgitUtilsTest extends TestCase { RefModel branch = TicgitUtils.getTicketsBranch(repository);
repository.close();
assertTrue("Ticgit branch does not exist!", branch != null);
-
+
repository = GitBlitSuite.getHelloworldRepository();
branch = TicgitUtils.getTicketsBranch(repository);
repository.close();
@@ -60,7 +60,7 @@ public class TicgitUtilsTest extends TestCase { assertTrue(commentA.hashCode() == commentA.text.hashCode());
}
}
-
+
repository = GitBlitSuite.getHelloworldRepository();
List<TicketModel> ticketsC = TicgitUtils.getTickets(repository);
repository.close();
|