use of org.eclipse.egit.core.internal.indexdiff.IndexDiffData in project egit by eclipse.
the class DecoratableResourceMappingTest method testNewResourceMappingIsUnstaged.
@Test
public void testNewResourceMappingIsUnstaged() throws Exception {
IDecoratableResource[] expectedDRs = new IDecoratableResource[] { newExpectedDecoratableResource(rmContentA), newExpectedDecoratableResource(rmContentB), newExpectedDecoratableResourceMapping() };
IndexDiffData indexDiffData = waitForIndexDiff(true);
IDecoratableResource[] actualDRs = { newDecoratableResource(indexDiffData, rmContentA), newDecoratableResource(indexDiffData, rmContentB), newDecoratableResourceMapping(resourceMapping) };
assertArrayEquals(expectedDRs, actualDRs);
assertDecorationUntracked(resourceMapping);
}
use of org.eclipse.egit.core.internal.indexdiff.IndexDiffData in project egit by eclipse.
the class DecoratableResourceMappingTest method testAllIgnoredIsUnstaged.
@Test
public void testAllIgnoredIsUnstaged() throws Exception {
IFile gitignore = createFile(project, ".gitignore", "*.testrm_*");
gitAdd(git, gitignore);
gitAdd(git, rmContentA);
gitAdd(git, rmContentB);
gitCommit(git);
project.refreshLocal(IResource.DEPTH_INFINITE, null);
rmContentA = findFile(project, RM_CONTENT_A_FILE_NAME);
gitignore = findFile(project, ".gitignore");
IDecoratableResource[] expectedDRs = new IDecoratableResource[] { newExpectedDecoratableResource(gitignore).tracked(), newExpectedDecoratableResource(rmContentA).ignored(), newExpectedDecoratableResource(rmContentB).ignored(), newExpectedDecoratableResourceMapping() };
IndexDiffData indexDiffData = waitForIndexDiff(true);
IDecoratableResource[] actualDRs = { newDecoratableResource(indexDiffData, gitignore), newDecoratableResource(indexDiffData, rmContentA), newDecoratableResource(indexDiffData, rmContentB), newDecoratableResourceMapping(resourceMapping) };
assertArrayEquals(expectedDRs, actualDRs);
assertDecorationUntracked(resourceMapping);
}
use of org.eclipse.egit.core.internal.indexdiff.IndexDiffData in project egit by eclipse.
the class DecoratableResourceMappingTest method testSameStagingStateIsState_Added.
@Test
public void testSameStagingStateIsState_Added() throws Exception {
gitAdd(git, rmContentA);
gitAdd(git, rmContentB);
IDecoratableResource[] expectedDRs = new IDecoratableResource[] { newExpectedDecoratableResource(rmContentA).tracked().added(), newExpectedDecoratableResource(rmContentB).tracked().added(), newExpectedDecoratableResourceMapping().tracked().added() };
IndexDiffData indexDiffData = waitForIndexDiff(true);
IDecoratableResource[] actualDRs = { newDecoratableResource(indexDiffData, rmContentA), newDecoratableResource(indexDiffData, rmContentB), newDecoratableResourceMapping(resourceMapping) };
assertArrayEquals(expectedDRs, actualDRs);
assertDecorationAdded(resourceMapping);
}
use of org.eclipse.egit.core.internal.indexdiff.IndexDiffData in project egit by eclipse.
the class DecoratableWorkingSetTest method testUntrackedContentIsUndecorated.
@Test
public void testUntrackedContentIsUndecorated() throws Exception {
setWorkingSet(project2);
IDecoratableResource[] expectedDRs = new IDecoratableResource[] { newExpectedDecoratableResource(project2), newExpectedDecoratableWorkingSet(WORKING_SET) };
IndexDiffData indexDiffData = waitForIndexDiff(true);
IDecoratableResource[] actualDRs = { newDecoratableResource(indexDiffData, project2), newDecoratableWorkingSet(resourceMapping) };
assertArrayEquals(expectedDRs, actualDRs);
assertUndecorated(resourceMapping);
}
use of org.eclipse.egit.core.internal.indexdiff.IndexDiffData in project egit by eclipse.
the class DecoratableWorkingSetTest method testStagingStateHasNoInfluence_Modified.
@Test
public void testStagingStateHasNoInfluence_Modified() throws Exception {
IFile file = createFile(project1, TEST_FILE, "Something");
gitAdd(git, file);
IDecoratableResource[] expectedDRs = new IDecoratableResource[] { newExpectedDecoratableResource(project1).tracked().modified(), newExpectedDecoratableResource(file).tracked().added(), newExpectedDecoratableResource(project2), newExpectedDecoratableWorkingSet(WORKING_SET).tracked() };
IndexDiffData indexDiffData = waitForIndexDiff(true);
IDecoratableResource[] actualDRs = { newDecoratableResource(indexDiffData, project1), newDecoratableResource(indexDiffData, file), newDecoratableResource(indexDiffData, project2), newDecoratableWorkingSet(resourceMapping) };
assertArrayEquals(expectedDRs, actualDRs);
assertDecorationTracked(resourceMapping);
}
Aggregations