Package org.eclipse.egit.core.test

Examples of org.eclipse.egit.core.test.TestProject.createFile()


    TestProject nested = new TestProject(true, "Project-1/Project-2");
    try {
      // Use Project-1 to create folder, Project-2 to get file to try to
      // confuse any caches in workspace root (location -> IResource).
      project.createFolder("Project-2/please");
      IFile ignoreme = nested.createFile("please/ignoreme", new byte[0]);
      IgnoreOperation operation = executeIgnore(ignoreme.getLocation());
      String content = nested.getFileContent("please/.gitignore");
      assertEquals("/ignoreme\n", content);
      assertFalse(operation.isGitignoreOutsideWSChanged());
    } finally {
View Full Code Here


  @Test
  public void getFileForLocationShouldReturnExistingFileInCaseOfNestedProject()
      throws Exception {
    TestProject nested = new TestProject(true, "Project-1/Project-0");
    connect(nested.getProject());
    IFile file = nested.createFile("a.txt", new byte[] {});
    IPath location = file.getLocation();

    IFile result = ResourceUtil.getFileForLocation(location);
    assertThat(result, notNullValue());
    assertTrue("Returned IFile should exist", result.exists());
View Full Code Here

    TestProject nested = new TestProject(true, "Project-1/Project-0");
    connect(nested.getProject());
    TestProject nested2 = new TestProject(true,
        "Project-1/Project-0/Project");
    connect(nested2.getProject());
    IFile file = nested2.createFile("a.txt", new byte[] {});
    IPath location = file.getLocation();
    nested2.project.close(new NullProgressMonitor());
    IFile result = ResourceUtil.getFileForLocation(location);
    assertThat(result, notNullValue());
    assertTrue("Returned IFile should exist", result.exists());
View Full Code Here

  @Test
  public void getFileForLocationShouldNotUseFilesWithoutRepositoryMapping()
      throws Exception {
    TestProject nested = new TestProject(true, "Project-1/Project-0");
    IFile file = nested.createFile("a.txt", new byte[] {});
    IPath location = file.getLocation();

    IFile result = ResourceUtil.getFileForLocation(location);
    assertThat(result, notNullValue());
    assertTrue("Returned IFile should exist", result.exists());
View Full Code Here

  public void testResourceCompare() throws Exception {
    // we just want to test that we can call the JFace resource name
    // comparator which itself is tested by JFace
    TestProject p = new TestProject();
    p.createFolder("test");
    IFile f1 = p.createFile("test/z.txt", "z".getBytes("UTF-8"));
    IFile f2 = p.createFile("test/d.txt", "d".getBytes("UTF-8"));
    IFile f3 = p.createFile("test/a.txt", "a".getBytes("UTF-8"));
    List<IResource> expected = Arrays
        .asList(new IResource[] { f3, f2,
        f1 });
View Full Code Here

    // we just want to test that we can call the JFace resource name
    // comparator which itself is tested by JFace
    TestProject p = new TestProject();
    p.createFolder("test");
    IFile f1 = p.createFile("test/z.txt", "z".getBytes("UTF-8"));
    IFile f2 = p.createFile("test/d.txt", "d".getBytes("UTF-8"));
    IFile f3 = p.createFile("test/a.txt", "a".getBytes("UTF-8"));
    List<IResource> expected = Arrays
        .asList(new IResource[] { f3, f2,
        f1 });
    List<IResource> tmp = new ArrayList<IResource>(expected);
View Full Code Here

    // comparator which itself is tested by JFace
    TestProject p = new TestProject();
    p.createFolder("test");
    IFile f1 = p.createFile("test/z.txt", "z".getBytes("UTF-8"));
    IFile f2 = p.createFile("test/d.txt", "d".getBytes("UTF-8"));
    IFile f3 = p.createFile("test/a.txt", "a".getBytes("UTF-8"));
    List<IResource> expected = Arrays
        .asList(new IResource[] { f3, f2,
        f1 });
    List<IResource> tmp = new ArrayList<IResource>(expected);
    Collections.shuffle(tmp, new Random(1));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.