Package org.eclipse.egit.core.test

Examples of org.eclipse.egit.core.test.TestRepository


  @Before
  public void setUp() throws Exception {
    super.setUp();
    gitDir = new File(project.getProject()
        .getLocationURI().getPath(), Constants.DOT_GIT);
    testRepository = new TestRepository(gitDir);
    testRepository.connect(project.getProject());

    File file1 = testRepository.createFile(project.getProject(), "file1-1");
    testRepository.addAndCommit(project.getProject(), file1,
        "master commit 1");
View Full Code Here


  private TestProject project2;

  @Before
  public void setUp() throws Exception {
    super.setUp();
    repository = new TestRepository(gitDir);
  }
View Full Code Here

  @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
    new Git(repo).commit().setAuthor("JUnit", "junit@jgit.org")
View Full Code Here

  @Before
  public void setUp() throws Exception {
    super.setUp();
    gitDir = new File(project.getProject()
        .getLocationURI().getPath(), Constants.DOT_GIT);
    testRepo = new TestRepository(gitDir);
    testRepo.connect(project.getProject());
    testRepo.commit("initial commit");

    project2 = new TestProject(true, "Project-2");
    gitDir2 = new File(project2.getProject()
        .getLocationURI().getPath(), Constants.DOT_GIT);
    testRepo2 = new TestRepository(gitDir2);
    testRepo2.connect(project2.getProject());
    testRepo2.commit("initial commit repo 2");
  }
View Full Code Here

  @Test
  public void shouldRemoveFromIndexOnInitialCommit() throws Exception {
    testRepo.dispose();
    FileUtils.delete(gitDir, FileUtils.RECURSIVE | FileUtils.RETRY);
    testRepo = new TestRepository(gitDir);
    testRepo.connect(project.getProject());

    IFile file = testUtils.addFileToProject(project.getProject(), "file.txt", "content");
    new AddToIndexOperation(asList(file)).execute(null);
View Full Code Here

  @Before
  public void setUp() throws Exception {
    super.setUp();
    gitDir = new File(project.getProject()
        .getLocationURI().getPath(), Constants.DOT_GIT);
    testRepository = new TestRepository(gitDir);
    repository = testRepository.getRepository();
    testRepository.connect(project.getProject());
    testRepository.commit("initial commit");
  }
View Full Code Here

  @Before
  @Override
  public void setUp() throws Exception {
    super.setUp();

    TestRepository testRepo = new TestRepository(gitDir);
    testRepo.connect(project.project);
    repository = testRepo.getRepository();
  }
View Full Code Here

  public void setUp() throws Exception {

    workdir = testUtils.createTempDir("Repository1");
    workdir2 = testUtils.createTempDir("Repository2");

    repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));

    // now we create a project in repo1
    IProject project = testUtils.createProjectInLocalFileSystem(workdir,
        projectName);
    testUtils.addFileToProject(project, "folder1/file1.txt", "Hello world");

    repository1.connect(project);
    repository1.trackAllFiles(project);
    repository1.commit("Initial commit");

    // let's get rid of the project
    project.delete(false, false, null);

    // let's clone repository1 to repository2
    URIish uri = new URIish("file:///"
        + repository1.getRepository().getDirectory().toString());
    CloneOperation clop = new CloneOperation(uri, true, null, workdir2,
        "refs/heads/master", "origin", 0);
    clop.run(null);

    Repository existingRepo = Activator
        .getDefault()
        .getRepositoryCache()
        .lookupRepository(
            new File(workdir2, Constants.DOT_GIT));
    repository2 = new TestRepository(existingRepo);
    // we push to branch "test" of repository2
    RefUpdate createBranch = repository2.getRepository().updateRef(
        "refs/heads/test");
    createBranch.setNewObjectId(repository2.getRepository().resolve(
        "refs/heads/master"));
View Full Code Here

  private TestRepository testRepo;

  @Before
  public void createGitRepository() throws Exception {
    iProject = project.project;
    testRepo = new TestRepository(gitDir);
    testRepo.connect(iProject);
    repo = RepositoryMapping.getMapping(iProject).getRepository();
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    super.setUp();
    gitDir = new File(project.getProject().getLocationURI().getPath(),
        Constants.DOT_GIT);
    testRepository = new TestRepository(gitDir);
    testRepository.connect(project.getProject());

    file = testRepository.createFile(project.getProject(), "test-file");

    commit = testRepository.addAndCommit(project.getProject(), file,
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.test.TestRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.