1 package org
.spearce
.egit
.core
.test
;
4 import java
.io
.IOException
;
6 import junit
.framework
.TestCase
;
8 public abstract class GitTestCase
extends TestCase
{
10 protected TestProject project
;
12 protected File gitDir
;
14 protected void setUp() throws Exception
{
16 project
= new TestProject();
17 gitDir
= new File(project
.getProject().getWorkspace().getRoot()
18 .getRawLocation().toFile(), ".git");
22 protected void tearDown() throws Exception
{
28 private void rmrf(File d
) throws IOException
{
32 File
[] files
= d
.listFiles();
34 for (int i
= 0; i
< files
.length
; ++i
) {
35 if (files
[i
].isDirectory())
37 else if (!files
[i
].delete())
38 throw new IOException(files
[i
] + " in use or undeletable");
42 throw new IOException(d
+ " in use or undeletable");