Search in sources :

Example 21 with TestRepository

use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.

the class ProjectUtilTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    repository = new TestRepository(gitDir);
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) Before(org.junit.Before)

Example 22 with TestRepository

use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.

the class GitMoveDeleteHookTest method initRepoInsideProjectInsideWorkspace.

private TestProject initRepoInsideProjectInsideWorkspace() throws Exception {
    TestProject project = new TestProject(true, "Project-1", true, workspaceSupplement);
    File gitDir = new File(project.getProject().getLocationURI().getPath(), Constants.DOT_GIT);
    testDirs.add(gitDir);
    testRepository = new TestRepository(gitDir);
    repository = testRepository.getRepository();
    testRepository.connect(project.getProject());
    registerWorkspaceRelativeTestDir("Project-1");
    return project;
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) TestProject(org.eclipse.egit.core.test.TestProject) IFile(org.eclipse.core.resources.IFile) File(java.io.File)

Example 23 with TestRepository

use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.

the class GitMoveDeleteHookTest method initRepoInsideProjectOutsideWorkspace.

private TestProject initRepoInsideProjectOutsideWorkspace() throws Exception {
    TestProject project = new TestProject(true, "Project-1", false, workspaceSupplement);
    File gitDir = new File(project.getProject().getLocationURI().getPath(), Constants.DOT_GIT);
    testDirs.add(gitDir);
    testRepository = new TestRepository(gitDir);
    repository = testRepository.getRepository();
    testRepository.connect(project.getProject());
    return project;
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) TestProject(org.eclipse.egit.core.test.TestProject) IFile(org.eclipse.core.resources.IFile) File(java.io.File)

Example 24 with TestRepository

use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.

the class ProjectReferenceImporterTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    testRepository = new TestRepository(gitDir);
    repository = testRepository.getRepository();
    RepositoryUtil util = Activator.getDefault().getRepositoryUtil();
    util.addConfiguredRepository(repository.getDirectory());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) RepositoryUtil(org.eclipse.egit.core.RepositoryUtil) Before(org.junit.Before)

Example 25 with TestRepository

use of org.eclipse.egit.core.test.TestRepository in project egit by eclipse.

the class AbstractGitFlowOperationTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    gitDir = new File(project.getProject().getLocationURI().getPath(), DOT_GIT);
    testRepository = new TestRepository(gitDir);
    testRepository.connect(project.getProject());
}
Also used : TestRepository(org.eclipse.egit.core.test.TestRepository) File(java.io.File) IFile(org.eclipse.core.resources.IFile) Before(org.junit.Before)

Aggregations

TestRepository (org.eclipse.egit.core.test.TestRepository)45 Before (org.junit.Before)36 File (java.io.File)28 IFile (org.eclipse.core.resources.IFile)15 Git (org.eclipse.jgit.api.Git)6 TestProject (org.eclipse.egit.core.test.TestProject)5 Repository (org.eclipse.jgit.lib.Repository)5 Test (org.junit.Test)5 IProject (org.eclipse.core.resources.IProject)4 CloneOperation (org.eclipse.egit.core.op.CloneOperation)3 URIish (org.eclipse.jgit.transport.URIish)3 GitFlowRepository (org.eclipse.egit.gitflow.GitFlowRepository)2 RefUpdate (org.eclipse.jgit.lib.RefUpdate)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 IFolder (org.eclipse.core.resources.IFolder)1 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)1 IPath (org.eclipse.core.runtime.IPath)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1