\r
@Test\r
public void testClone() throws Exception {\r
+ GitBlitSuite.close(ticgitFolder);\r
+ if (ticgitFolder.exists()) {\r
+ FileUtils.delete(ticgitFolder, FileUtils.RECURSIVE | FileUtils.RETRY);\r
+ }\r
+ \r
CloneCommand clone = Git.cloneRepository();\r
clone.setURI(MessageFormat.format("{0}/git/ticgit.git", url));\r
clone.setDirectory(ticgitFolder);\r
\r
@Test\r
public void testAnonymousPush() throws Exception {\r
+ GitBlitSuite.close(ticgitFolder);\r
+ if (ticgitFolder.exists()) {\r
+ FileUtils.delete(ticgitFolder, FileUtils.RECURSIVE | FileUtils.RETRY);\r
+ }\r
+\r
+ CloneCommand clone = Git.cloneRepository();\r
+ clone.setURI(MessageFormat.format("{0}/git/ticgit.git", url));\r
+ clone.setDirectory(ticgitFolder);\r
+ clone.setBare(false);\r
+ clone.setCloneAllBranches(true);\r
+ clone.setCredentialsProvider(new UsernamePasswordCredentialsProvider(account, password));\r
+ GitBlitSuite.close(clone.call()); \r
+ assertTrue(true);\r
+ \r
Git git = Git.open(ticgitFolder);\r
File file = new File(ticgitFolder, "TODO");\r
OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true), Constants.CHARSET);\r
\r
@Test\r
public void testSubfolderPush() throws Exception {\r
+ GitBlitSuite.close(jgitFolder);\r
+ if (jgitFolder.exists()) {\r
+ FileUtils.delete(jgitFolder, FileUtils.RECURSIVE | FileUtils.RETRY);\r
+ }\r
+ \r
CloneCommand clone = Git.cloneRepository();\r
clone.setURI(MessageFormat.format("{0}/git/test/jgit.git", url));\r
clone.setDirectory(jgitFolder);\r
\r
@Test\r
public void testPushToFrozenRepo() throws Exception {\r
+ GitBlitSuite.close(jgitFolder);\r
+ if (jgitFolder.exists()) {\r
+ FileUtils.delete(jgitFolder, FileUtils.RECURSIVE | FileUtils.RETRY);\r
+ }\r
+ \r
CloneCommand clone = Git.cloneRepository();\r
clone.setURI(MessageFormat.format("{0}/git/test/jgit.git", url));\r
clone.setDirectory(jgitFolder);\r