summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/com/gitblit/tests/GitServletTest.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/com/gitblit/tests/GitServletTest.java b/tests/com/gitblit/tests/GitServletTest.java
index 0ede7cab..6a839742 100644
--- a/tests/com/gitblit/tests/GitServletTest.java
+++ b/tests/com/gitblit/tests/GitServletTest.java
@@ -12,6 +12,7 @@ import junit.framework.TestCase;
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 class GitServletTest extends TestCase {
}
public void testClone() throws Exception {
- FileUtils.delete(folder, FileUtils.RECURSIVE);
+ 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 @@ public class GitServletTest extends TestCase {
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();
+ }
}