diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2012-04-17 03:38:12 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2012-04-17 03:38:12 -0400 |
commit | dd1e66e1d7f346f6e16e30c209497b436d00a69e (patch) | |
tree | f78d1f5aab6273dabaf8d303c868117823febfb4 | |
parent | bf33a6eeedb121128fc020d9e990730348b08caa (diff) | |
parent | ee90d6afba1946345386efcee8b14a017e0eb01c (diff) | |
download | jgit-dd1e66e1d7f346f6e16e30c209497b436d00a69e.tar.gz jgit-dd1e66e1d7f346f6e16e30c209497b436d00a69e.zip |
Merge "Fix tests for Ant task "git-clone""
-rw-r--r-- | org.eclipse.jgit.ant.test/src/org/eclipse/jgit/ant/tasks/GitCloneTaskTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.jgit.ant.test/src/org/eclipse/jgit/ant/tasks/GitCloneTaskTest.java b/org.eclipse.jgit.ant.test/src/org/eclipse/jgit/ant/tasks/GitCloneTaskTest.java index c7b949c25b..760d0dce69 100644 --- a/org.eclipse.jgit.ant.test/src/org/eclipse/jgit/ant/tasks/GitCloneTaskTest.java +++ b/org.eclipse.jgit.ant.test/src/org/eclipse/jgit/ant/tasks/GitCloneTaskTest.java @@ -45,6 +45,7 @@ package org.eclipse.jgit.ant.tasks; import static org.junit.Assert.assertTrue; import java.io.File; +import java.io.IOException; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DefaultLogger; @@ -60,13 +61,17 @@ public class GitCloneTaskTest extends LocalDiskRepositoryTestCase { private GitCloneTask task; private Project project; + private File dest; @Before - public void before() { + public void before() throws IOException { project = new Project(); + project.init(); enableLogging(); project.addTaskDefinition("git-clone", GitCloneTask.class); task = (GitCloneTask) project.createTask("git-clone"); + dest = createTempFile(); + task.setDest(dest); } @Test(expected = BuildException.class) @@ -97,8 +102,6 @@ public class GitCloneTaskTest extends LocalDiskRepositoryTestCase { FileRepository repo = createBareRepository(); File directory = repo.getDirectory(); task.setUri("file://" + directory); - File dest = createTempFile(); - task.setDest(dest); task.execute(); assertTrue(RepositoryCache.FileKey.isGitRepository(new File(dest, ".git"), FS.DETECTED)); @@ -110,8 +113,6 @@ public class GitCloneTaskTest extends LocalDiskRepositoryTestCase { File directory = repo.getDirectory(); task.setUri("file://" + directory); task.setBare(true); - File dest = createTempFile(); - task.setDest(dest); task.execute(); assertTrue(RepositoryCache.FileKey.isGitRepository(dest, FS.DETECTED)); |