* upgrade to spring boot 1.5.2 * add full update to REST API * modify ratings controller * upgrade herold * fix integration test * fix integration test * minor fix * fix integration test * fix integration test * minor cleanup * minor cleanup * remove log4j properties * use standard logbook.xml * remove log4j dependencies * remove commons-logging * merge * fix conflict * exclude commons-logging dependency * cleanup * minor fix * minor fix * fix dependency issues * Revert "fix dependency issues" This reverts commit 83bf1f9fd2e1a9a55f9cacb085669568b06b49ec. * fix dependency issues * minor fix * minor fix * minor fix * cleanup generated files * fix commons-logging issue * add parent to pom * cleanup parent dependencies * cleanup pom * cleanup pom * add missing parent * fix logging issue * fix test names
32 lines
1.0 KiB
Java
32 lines
1.0 KiB
Java
import com.baeldung.jgit.helper.Helper;
|
|
import org.eclipse.jgit.lib.ObjectLoader;
|
|
import org.eclipse.jgit.lib.ObjectReader;
|
|
import org.eclipse.jgit.lib.Ref;
|
|
import org.eclipse.jgit.lib.Repository;
|
|
import org.eclipse.jgit.revwalk.RevWalk;
|
|
import org.junit.Test;
|
|
import java.io.IOException;
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
/**
|
|
* Tests which show issues with JGit that we reported upstream.
|
|
*/
|
|
public class JGitBugIntegrationTest {
|
|
@Test
|
|
public void testRevWalkDisposeClosesReader() throws IOException {
|
|
try (Repository repo = Helper.openJGitRepository()) {
|
|
try (ObjectReader reader = repo.newObjectReader()) {
|
|
try (RevWalk walk = new RevWalk(reader)) {
|
|
walk.dispose();
|
|
|
|
Ref head = repo.exactRef("refs/heads/master");
|
|
System.out.println("Found head: " + head);
|
|
|
|
ObjectLoader loader = reader.open(head.getObjectId());
|
|
assertNotNull(loader);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|