Package org.eclipse.core.resources.mapping

Examples of org.eclipse.core.resources.mapping.RemoteResourceMappingContext


    };

    syncJob.addJobChangeListener(new JobChangeAdapter() {
      @Override
      public void done(IJobChangeEvent event) {
        RemoteResourceMappingContext remoteContext = new GitSubscriberResourceMappingContext(subscriber,
            gsdSet);
        SubscriberScopeManager manager = new SubscriberScopeManager(
            subscriber.getName(), mappings, subscriber,
            remoteContext, true);
        GitSubscriberMergeContext context = new GitSubscriberMergeContext(
View Full Code Here


        "commit b");

    IFile iFile1 = testRepo.getIFile(iProject, file1);
    IFile iFile2 = testRepo.getIFile(iProject, file2);

    RemoteResourceMappingContext context = prepareContext(MASTER, MASTER);
    assertFalse(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertFalse(context.hasLocalChange(iFile2, new NullProgressMonitor()));

    JGitTestUtil.write(file1, "changed content a");
    JGitTestUtil.write(file2, "changed content b");

    refresh(context, iFile1, iFile2);
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasLocalChange(iFile2, new NullProgressMonitor()));

    JGitTestUtil.write(file2, "content b");

    refresh(context, iFile2);
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertFalse(context.hasLocalChange(iFile2, new NullProgressMonitor()));
  }
View Full Code Here

    IFile iFile1 = testRepo.getIFile(iProject, file1);
    IFile iFile2 = testRepo.getIFile(iProject, file2);
    IFile iFile3 = testRepo.getIFile(iProject, file3);

    RemoteResourceMappingContext context = prepareContext(MASTER, MASTER);
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasLocalChange(iFile2, new NullProgressMonitor()));
    assertTrue(context.hasLocalChange(iFile3, new NullProgressMonitor()));

    iFile1.delete(false, null);
    refresh(context, iFile1, iFile2, iFile3);
    assertTrue(context.hasLocalChange(iFile2, new NullProgressMonitor()));
    assertTrue(context.hasLocalChange(iFile3, new NullProgressMonitor()));
  }
View Full Code Here

  }

  @Test
  public void hasLocalChangeInNewFolder() throws Exception {
    iProject.getFolder("folder").create(false, true, null);
    RemoteResourceMappingContext context = prepareContext(MASTER, MASTER);
    // Folder is now known, but not yet file in it

    File file = testRepo.createFile(iProject, "folder/b.txt");
    IFile iFile = testRepo.getIFile(iProject, file);
    refresh(context, iFile);
    assertTrue(context.hasLocalChange(iFile, new NullProgressMonitor()));

    testRepo.addToIndex(iProject, file);
    refresh(context, iFile);
    assertTrue(context.hasLocalChange(iFile, new NullProgressMonitor()));

    JGitTestUtil.write(file, "changed content b");
    refresh(context, iFile);
    assertTrue(context.hasLocalChange(iFile, new NullProgressMonitor()));
  }
View Full Code Here

    setContentsAndCommit(iFile2, "change in branch - file 2",
        "branch commit - file2");

    testRepo.checkoutBranch(MASTER);

    RemoteResourceMappingContext context = prepareContext(MASTER, BRANCH);
    assertFalse(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
    assertFalse(context.hasLocalChange(iFile2, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile2, new NullProgressMonitor()));

    setContents(iFile1, "change in master - file 1");
    refresh(context, iFile1);
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile1, new NullProgressMonitor()));

    setContents(iFile2, "change in branch - file 2");
    refresh(context, iFile2);
    assertTrue(context.hasLocalChange(iFile2, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile2, new NullProgressMonitor()));

    setContentsAndCommit(iFile1, "change in branch - file 1",
        "change in master (same as in branch) - file 2");
    refresh(context, iFile1);
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
  }
View Full Code Here

        "second file - initial commit");
    IFile iFile2 = testRepo.getIFile(iProject, file2);

    testRepo.checkoutBranch(MASTER);

    RemoteResourceMappingContext context = prepareContext(MASTER, BRANCH);
    assertFalse(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile2, new NullProgressMonitor()));
  }
View Full Code Here

        "second file - initial commit");
    IFile iFile2 = testRepo.getIFile(iProject, file2);

    testRepo.checkoutBranch(MASTER);

    RemoteResourceMappingContext context = prepareContext(MASTER, BRANCH);
    assertFalse(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasRemoteChange(iFile2, new NullProgressMonitor()));
  }
View Full Code Here

    testRepo.checkoutBranch(MASTER);
    setContentsAndCommit(iFile1, "changed content in master",
        "second commit in MASTER");

    RemoteResourceMappingContext context = prepareContext(MASTER, BRANCH);
    assertTrue(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
  }
View Full Code Here

    testRepo.checkoutBranch(MASTER);
    setContentsAndCommit(iFile1, "changed content in master",
        "second commit in MASTER");

    RemoteResourceMappingContext context = prepareContext(MASTER, BRANCH);
    assertTrue(context.hasRemoteChange(iFile1, new NullProgressMonitor()));
    assertTrue(context.hasLocalChange(iFile1, new NullProgressMonitor()));
  }
View Full Code Here

    IFile file = folder.getFile("a.txt");
    file.create(new ByteArrayInputStream("a".getBytes("UTF-8")), false,
        null);

    RemoteResourceMappingContext context = prepareContext(MASTER, MASTER);
    refresh(context, file);

    assertTrue(context.hasLocalChange(file, new NullProgressMonitor()));

    file.delete(false, null);

    // Refresh of folder, not file directly
    refresh(context, folder);

    assertFalse(context.hasLocalChange(file, new NullProgressMonitor()));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.mapping.RemoteResourceMappingContext

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.