Explorar el Código

Ensure FSTest uses MockSystemReader

Tests shall not modify ~/.gitconfig. When running tests with bazel this
test failed since bazel isolates tests in a sandbox.

Change-Id: I7dd092afd14972da58a95eb7c200d353f0959fa1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v5.1.9.201908210455-r
Matthias Sohn hace 4 años
padre
commit
69ce7fc7fb
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2
    0
      org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java

+ 2
- 0
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java Ver fichero

import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;


import org.eclipse.jgit.errors.CommandFailedException; import org.eclipse.jgit.errors.CommandFailedException;
import org.eclipse.jgit.junit.MockSystemReader;
import org.eclipse.jgit.junit.RepositoryTestCase; import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.RepositoryCache; import org.eclipse.jgit.lib.RepositoryCache;
import org.junit.After; import org.junit.After;


@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
SystemReader.setInstance(new MockSystemReader());
trash = File.createTempFile("tmp_", ""); trash = File.createTempFile("tmp_", "");
trash.delete(); trash.delete();
assertTrue("mkdir " + trash, trash.mkdir()); assertTrue("mkdir " + trash, trash.mkdir());

Cargando…
Cancelar
Guardar