James Moger
2011-04-20 45c0d6ed8c9c3afc4d09200358ee2d53f06023e2
src/com/gitblit/tests/JGitUtilsTest.java
@@ -15,7 +15,7 @@
import org.eclipse.jgit.storage.file.FileRepository;
import com.gitblit.utils.JGitUtils;
import com.gitblit.wicket.models.PathModel;
import com.gitblit.wicket.models.PathModel.PathChangeModel;
import com.gitblit.wicket.models.RefModel;
import com.gitblit.wicket.models.TicketModel;
@@ -50,6 +50,14 @@
      r.close();
      assertTrue("Could not get last repository change date!", date != null);
   }
   public void testFirstCommit() throws Exception {
      Repository r = getRepository();
      RevCommit commit = JGitUtils.getFirstCommit(r, null);
      r.close();
      assertTrue("Could not get first commit!", commit != null);
      System.out.println(commit.getName() + " " + commit.getShortMessage());
   }
   public void testRetrieveRevObject() throws Exception {
      Repository r = getRepository();
@@ -82,7 +90,7 @@
   public void testFilesInCommit() throws Exception {
      Repository r = getRepository();
      RevCommit commit = JGitUtils.getCommit(r, Constants.HEAD);
      List<PathModel> paths = JGitUtils.getFilesInCommit(r, commit);
      List<PathChangeModel> paths = JGitUtils.getFilesInCommit(r, commit);
      r.close();
      assertTrue("No changed paths found!", paths.size() > 0);
   }