recursiveDelete(tmp, false, true);
if (tmp != null && !tmp.exists())
CleanupThread.removed(tmp);
+
+ SystemReader.setInstance(null);
}
/** Increment the {@link #author} and {@link #committer} times. */
import org.eclipse.jgit.junit.MockSystemReader;
import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.SystemReader;
+import org.junit.After;
import org.junit.Test;
/**
* Test reading of git config
*/
public class ConfigTest {
+
+ @After
+ public void tearDown() {
+ SystemReader.setInstance(null);
+ }
+
@Test
public void test001_ReadBareKey() throws ConfigInvalidException {
final Config c = parse("[foo]\nbar\n");
import org.eclipse.jgit.junit.MockSystemReader;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.util.GitDateFormatter.Format;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
.parsePersonIdent("A U Thor <author@example.com> 1316560165 -0400");
}
+ @After
+ public void tearDown() {
+ SystemReader.setInstance(null);
+ }
+
@Test
public void DEFAULT() {
assertEquals("Tue Sep 20 19:09:25 2011 -0400", new GitDateFormatter(
import java.util.GregorianCalendar;
import org.eclipse.jgit.junit.MockSystemReader;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
SystemReader.setInstance(mockSystemReader);
}
+ @After
+ public void tearDown() {
+ SystemReader.setInstance(null);
+ }
+
@Test
public void yesterday() throws ParseException {
GregorianCalendar cal = new GregorianCalendar(SystemReader
import org.eclipse.jgit.junit.MockSystemReader;
import org.eclipse.jgit.util.RelativeDateFormatter;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
SystemReader.setInstance(new MockSystemReader());
}
+ @After
+ public void tearDown() {
+ SystemReader.setInstance(null);
+ }
+
private static void assertFormat(long ageFromNow, long timeUnit,
String expectedFormat) {
Date d = new Date(SystemReader.getInstance().getCurrentTime()
/**
* @param newReader
- * the new instance to use when accessing properties.
+ * the new instance to use when accessing properties, or null for
+ * the default instance.
*/
public static void setInstance(SystemReader newReader) {
if (newReader == null)