use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitResourceVariantComparatorTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
iProject = project.project;
testRepo = new TestRepository(gitDir);
testRepo.connect(iProject);
repo = RepositoryMapping.getMapping(iProject).getRepository();
// make initial commit
try (Git git = new Git(repo)) {
git.commit().setAuthor("JUnit", "junit@jgit.org").setMessage("Initial commit").call();
}
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitResourceVariantTreeSubscriberTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
testRepo = new TestRepository(gitDir);
testRepo.connect(project.getProject());
String fileName = "Main.java";
File file = testRepo.createFile(project.getProject(), fileName);
initialCommit = testRepo.appendContentAndCommit(project.getProject(), file, "class Main {}", "initial commit");
changedFile = testRepo.getIFile(project.getProject(), file);
testRepo.createAndCheckoutBranch(Constants.HEAD, BRANCH);
commitBranch = testRepo.appendContentAndCommit(project.getProject(), file, "// test 1", "second commit");
testRepo.checkoutBranch(MASTER);
commitMaster = testRepo.appendContentAndCommit(project.getProject(), file, "// test 2", "third commit");
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class GitResourceVariantTreeTest method createGitRepository.
@Before
public void createGitRepository() throws Exception {
iProject = project.project;
testRepo = new TestRepository(gitDir);
testRepo.connect(iProject);
repo = RepositoryMapping.getMapping(iProject).getRepository();
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class IndexDiffCacheTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
testRepository = new TestRepository(gitDir);
repository = testRepository.getRepository();
listenerCalled = new AtomicBoolean(false);
indexDiffDataResult = new AtomicReference<>(null);
indexDiffListener = new IndexDiffChangedListener() {
@Override
public void indexDiffChanged(Repository repo, IndexDiffData indexDiffData) {
listenerCalled.set(true);
indexDiffDataResult.set(indexDiffData);
}
};
}
use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.
the class RepositoryMappingTest method setUp.
@Before
@Override
public void setUp() throws Exception {
super.setUp();
TestRepository testRepo = new TestRepository(gitDir);
testRepo.connect(project.project);
repository = testRepo.getRepository();
}
Aggregations