return config.getInitParameter(name);
}
- public Enumeration getInitParameterNames() {
+ public Enumeration<String> getInitParameterNames() {
return config.getInitParameterNames();
}
return null;
}
- public Enumeration getInitParameterNames() {
+ public Enumeration<String> getInitParameterNames() {
return new Enumeration<String>() {
public boolean hasMoreElements() {
return false;
return null;
}
- public Enumeration getInitParameterNames() {
+ public Enumeration<String> getInitParameterNames() {
return new Enumeration<String>() {
public boolean hasMoreElements() {
return false;
import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.eclipse.jetty.server.Request;
public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
private Repository db;
- private ReceivePackFactory factory;
+ private ReceivePackFactory<HttpServletRequest> factory;
@Before
public void setUp() throws Exception {
@Test
public void testDisabledSingleton() throws ServiceNotAuthorizedException {
- factory = ReceivePackFactory.DISABLED;
+ factory = (ReceivePackFactory<HttpServletRequest>) ReceivePackFactory.DISABLED;
try {
factory.create(new R(null, "localhost"), db);
import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.eclipse.jetty.server.Request;
public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase {
private Repository db;
- private UploadPackFactory factory;
+ private UploadPackFactory<HttpServletRequest> factory;
@Before
public void setUp() throws Exception {
@Test
public void testDisabledSingleton() throws ServiceNotAuthorizedException {
- factory = UploadPackFactory.DISABLED;
+ factory = (UploadPackFactory<HttpServletRequest>) UploadPackFactory.DISABLED;
try {
factory.create(new R(null, "localhost"), db);
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevBlob;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.storage.file.FileRepository;
import org.eclipse.jgit.transport.FetchConnection;
import org.eclipse.jgit.transport.HttpTransport;
import org.eclipse.jgit.transport.Transport;
public void setUp() throws Exception {
super.setUp();
- final TestRepository src = createTestRepository();
+ final TestRepository<FileRepository> src = createTestRepository();
final File srcGit = src.getRepository().getDirectory();
final URI base = srcGit.getParentFile().toURI();
@Test
public void testInitialClone_Packed() throws Exception {
- new TestRepository(remoteRepository).packAndPrune();
+ new TestRepository<Repository>(remoteRepository).packAndPrune();
Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt));
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevBlob;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.storage.file.FileRepository;
import org.eclipse.jgit.transport.FetchConnection;
import org.eclipse.jgit.transport.HttpTransport;
import org.eclipse.jgit.transport.Transport;
public void setUp() throws Exception {
super.setUp();
- final TestRepository src = createTestRepository();
+ final TestRepository<FileRepository> src = createTestRepository();
final String srcName = src.getRepository().getDirectory().getName();
ServletContextHandler app = server.addContext("/git");
@Test
public void testInitialClone_Packed() throws Exception {
- new TestRepository(remoteRepository).packAndPrune();
+ new TestRepository<Repository>(remoteRepository).packAndPrune();
Repository dst = createBareRepository();
assertFalse(dst.hasObject(A_txt));
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.resolver.FileResolver;
+import org.eclipse.jgit.transport.resolver.RepositoryResolver;
import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.util.FileUtils;
import org.junit.Test;
private void assertUnreasonable(String name)
throws ServiceNotEnabledException {
- FileResolver r = new FileResolver(new File("."), false);
+ FileResolver<RepositoryResolver> r = new FileResolver<RepositoryResolver>(
+ new File("."), false);
try {
r.open(null, name);
fail("Opened unreasonable name \"" + name + "\"");
final String name = a.getDirectory().getName();
final File base = a.getDirectory().getParentFile();
final File export = new File(a.getDirectory(), "git-daemon-export-ok");
- FileResolver resolver;
+ FileResolver<RepositoryResolver> resolver;
assertFalse("no git-daemon-export-ok", export.exists());
- resolver = new FileResolver(base, false /* require flag */);
+ resolver = new FileResolver<RepositoryResolver>(base, false /*
+ * require
+ * flag
+ */);
try {
resolver.open(null, name);
fail("opened non-exported repository");
assertEquals("Service not enabled", e.getMessage());
}
- resolver = new FileResolver(base, true /* export all */);
+ resolver = new FileResolver<RepositoryResolver>(base, true /*
+ * export
+ * all
+ */);
try {
resolver.open(null, name).close();
} catch (ServiceNotEnabledException e) {
}
FileUtils.createNewFile(export);
- resolver = new FileResolver(base, false /* require flag */);
+ resolver = new FileResolver<RepositoryResolver>(base, false /*
+ * require
+ * flag
+ */);
try {
resolver.open(null, name).close();
} catch (ServiceNotEnabledException e) {
final Repository a = createBareRepository();
final String name = a.getDirectory().getName() + "-not-a-git";
final File base = a.getDirectory().getParentFile();
- FileResolver resolver = new FileResolver(base, false);
+ FileResolver<RepositoryResolver> resolver = new FileResolver<RepositoryResolver>(
+ base, false);
try {
resolver.open(null, name);
// Create a new commit on the remote.
//
- b = new TestRepository(remoteRepository).branch(master);
+ b = new TestRepository<Repository>(remoteRepository).branch(master);
RevCommit Z = b.commit().message("Z").create();
// Now incrementally update.
// Create a new commit on the remote.
//
- b = new TestRepository(remoteRepository).branch(master);
+ b = new TestRepository<Repository>(remoteRepository).branch(master);
RevCommit Z = b.commit().message("Z").create();
// Now incrementally update.
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryTestCase;
import org.eclipse.jgit.patch.FileHeader;
import org.eclipse.jgit.patch.HunkHeader;
private DiffFormatter df;
- private TestRepository testDb;
+ private TestRepository<Repository> testDb;
@Override
@Before
public void setUp() throws Exception {
super.setUp();
- testDb = new TestRepository(db);
+ testDb = new TestRepository<Repository>(db);
df = new DiffFormatter(DisabledOutputStream.INSTANCE);
df.setRepository(db);
df.setAbbreviationLength(8);
import org.eclipse.jgit.lib.AbbreviatedObjectId;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryTestCase;
import org.junit.Before;
import org.junit.Test;
private RenameDetector rd;
- private TestRepository testDb;
+ private TestRepository<Repository> testDb;
@Override
@Before
public void setUp() throws Exception {
super.setUp();
- testDb = new TestRepository(db);
+ testDb = new TestRepository<Repository>(db);
rd = new RenameDetector(db);
}
@Test
public void testTinyThinPack() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
RevBlob a = d.blob("a");
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@Test
public void testPackWithTrailingGarbage() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
RevBlob a = d.blob("a");
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@Test
public void testMaxObjectSizeFullBlob() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
final byte[] data = Constants.encode("0123456789");
d.blob(data);
@Test
public void testMaxObjectSizeDeltaBlock() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
RevBlob a = d.blob("a");
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@Test
public void testMaxObjectSizeDeltaResultSize() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
RevBlob a = d.blob("0123456789");
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@Test
public void testNonMarkingInputStream() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
RevBlob a = d.blob("a");
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@Test
public void testDataAfterPackFooterSingleRead() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
RevBlob a = d.blob("a");
TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(32*1024);
@Test
public void testDataAfterPackFooterSplitHeaderRead() throws Exception {
- TestRepository d = new TestRepository(db);
+ TestRepository d = new TestRepository<Repository>(db);
final byte[] data = Constants.encode("a");
RevBlob b = d.blob(data);
// Fill dst with a some common history.
//
- TestRepository d = new TestRepository(dst);
+ TestRepository<Repository> d = new TestRepository<Repository>(dst);
a = d.blob("a");
A = d.commit(d.tree(d.file("a", a)));
B = d.commit().parent(A).create();
// Now use b but in a different commit than what is hidden.
//
- TestRepository s = new TestRepository(src);
+ TestRepository<Repository> s = new TestRepository<Repository>(src);
RevCommit N = s.commit().parent(B).add("q", b).create();
s.update(R_MASTER, N);