summaryrefslogtreecommitdiffstats
path: root/src/test/java/com
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-08-14 08:56:27 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-17 17:34:00 -0400
commitf084f468756bde745d8e8e27c729f6e57bea5749 (patch)
tree5000ff4a8de48ed3259e2ad5b295e03bd829e859 /src/test/java/com
parent578319a659fba918ba720d12ca4d4fc105918595 (diff)
downloadgitblit-f084f468756bde745d8e8e27c729f6e57bea5749.tar.gz
gitblit-f084f468756bde745d8e8e27c729f6e57bea5749.zip
Implemented a graph servlet based on EGit/JGit's PlotWalk (issue-194)
The graph is generated server-side and therefore requires that the commit table row height be fixed and match the row height of the servlet. There will be layout misalignment if remotes refs are displayed. Perhaps this can be improved in the future. Change-Id: I39d0ffc7b1c3679976ce8c198c772ff86238f1a5
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/gitblit/tests/JGitUtilsTest.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/test/java/com/gitblit/tests/JGitUtilsTest.java b/src/test/java/com/gitblit/tests/JGitUtilsTest.java
index 463c0a84..06fd674a 100644
--- a/src/test/java/com/gitblit/tests/JGitUtilsTest.java
+++ b/src/test/java/com/gitblit/tests/JGitUtilsTest.java
@@ -37,6 +37,10 @@ import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryCache;
import org.eclipse.jgit.lib.RepositoryCache.FileKey;
+import org.eclipse.jgit.revplot.PlotCommit;
+import org.eclipse.jgit.revplot.PlotCommitList;
+import org.eclipse.jgit.revplot.PlotLane;
+import org.eclipse.jgit.revplot.PlotWalk;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.util.FS;
@@ -602,5 +606,17 @@ public class JGitUtilsTest {
assertTrue(zipFileB.length() > 0);
zipFileB.delete();
}
-
+
+ @Test
+ public void testPlots() throws Exception {
+ Repository repository = GitBlitSuite.getTicgitRepository();
+ PlotWalk pw = new PlotWalk(repository);
+ PlotCommitList<PlotLane> commits = new PlotCommitList<PlotLane>();
+ commits.source(pw);
+ commits.fillTo(25);
+ for (PlotCommit<PlotLane> commit : commits) {
+ System.out.println(commit);
+ }
+ repository.close();
+ }
} \ No newline at end of file