James Moger
2011-10-24 d40adc7553bc900328afa918f45b6d9e9c3087fb
tests/com/gitblit/tests/GitServletTest.java
@@ -12,6 +12,7 @@
import org.eclipse.jgit.api.CloneCommand;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
import org.eclipse.jgit.util.FileUtils;
import com.gitblit.GitBlitServer;
@@ -50,7 +51,9 @@
   }
   public void testClone() throws Exception {
      if (folder.exists()) {
      FileUtils.delete(folder, FileUtils.RECURSIVE);
      }
      CloneCommand clone = Git.cloneRepository();
      clone.setURI(MessageFormat.format("http://localhost:{0,number,#}/git/ticgit.git", port));
      clone.setDirectory(folder);
@@ -71,4 +74,18 @@
      git.push().setPushAll().call();
      git.getRepository().close();
   }
   public void testBogusLoginClone() throws Exception {
      File folder = new File(GitBlitSuite.REPOSITORIES, "working/gitblit");
      if (folder.exists()) {
         FileUtils.delete(folder, FileUtils.RECURSIVE);
      }
      CloneCommand clone = Git.cloneRepository();
      clone.setURI(MessageFormat.format("http://localhost:{0,number,#}/git/gitblit.git", port));
      clone.setDirectory(folder);
      clone.setBare(false);
      clone.setCloneAllBranches(true);
      clone.setCredentialsProvider(new UsernamePasswordCredentialsProvider("bogus", "bogus"));
      clone.call();
   }
}