Package org.eclipse.egit.core

Examples of org.eclipse.egit.core.GitProvider$GitResourceRuleFactory


    Activator.getDefault().getRepositoryCache().clear();
  }

  @Test
  public void testGitProviderCanHandleLinkedResources() throws Exception {
    GitProvider provider = (GitProvider) RepositoryProvider
        .getProvider(project1);
    assertTrue(provider.canHandleLinkedResourceURI());
  }
View Full Code Here


    return f;
  }

  @Test
  public void testSingleRevision_1() {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359");
    assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevision.getContentIdentifier());
    assertEquals("J. Author",fileRevision.getAuthor());
  }
View Full Code Here

    assertEquals("J. Author",fileRevision.getAuthor());
  }

  @Test
  public void testSingleRevision_2() {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f");
    assertNull(fileRevision); // not matched by getFileHistoryFor
  }
View Full Code Here

    assertNull(fileRevision); // not matched by getFileHistoryFor
  }

  @Test
  public void testSingleRevision_3() {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/B.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f");
    assertEquals("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f", fileRevision.getContentIdentifier());
    assertEquals("J. Author",fileRevision.getAuthor());
  }
View Full Code Here

    assertEquals("J. Author",fileRevision.getAuthor());
  }

  @Test
  public void testIndexRevision() throws Exception {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision(GitFileRevision.INDEX);
    assertEquals(GitFileRevision.INDEX, fileRevision.getContentIdentifier());
    IStorage storage = fileRevision.getStorage(null);
    String content = testUtils.slurpAndClose(storage.getContents());
View Full Code Here

    assertEquals("A.txt - first version\n", content);
  }

  @Test
  public void testIndexRevisionSecondCommit() throws Exception {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/B.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision(GitFileRevision.INDEX);
    assertEquals(GitFileRevision.INDEX, fileRevision.getContentIdentifier());
    IStorage storage = fileRevision.getStorage(null);
    String content = testUtils.slurpAndClose(storage.getContents());
View Full Code Here

    String content = testUtils.slurpAndClose(storage.getContents());
    assertEquals("B.txt - second version\n", content);
  }
  @Test
  public void testShallowHistory() {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
    assertEquals(1, fileRevisions.length);
    assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevisions[0].getContentIdentifier());
    assertEquals("J. Author",fileRevisions[0].getAuthor());
View Full Code Here

    assertEquals("J. Author",fileRevisions[0].getAuthor());
  }

  @Test
  public void testDeepHistory_A() {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.NONE, new NullProgressMonitor());
    IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
    assertEquals(1, fileRevisions.length);
    assertEquals("60f0d7917fe2aed5c92b5bc35dfb55b9b8ada359", fileRevisions[0].getContentIdentifier());
    assertEquals("J. Author",fileRevisions[0].getAuthor());
View Full Code Here

    assertEquals("J. Author",fileRevisions[0].getAuthor());
  }

  @Test
  public void testDeepHistory_B() {
    GitProvider provider = (GitProvider)RepositoryProvider.getProvider(project.project);
    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/B.txt"), IFileHistoryProvider.NONE, new NullProgressMonitor());
    IFileRevision[] fileRevisions = fileHistory.getFileRevisions();
    assertEquals(2, fileRevisions.length);
    assertEquals("fd5a571c8a3a4a152e4c413d09d3ecb7d41e1e5f", fileRevisions[0].getContentIdentifier());
    assertEquals("J. Author",fileRevisions[0].getAuthor());
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.GitProvider$GitResourceRuleFactory

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.