diff options
author | Dariusz Luksza | 2010-07-24 16:26:58 -0400 |
---|---|---|
committer | Dariusz Luksza | 2010-08-10 13:22:00 -0400 |
commit | c5e296c4ef629c948958b0f03b11e1e97af1bb30 (patch) | |
tree | 74115735eb5118c50bc7b848be572a2c05ca8495 /org.eclipse.egit.core.test | |
parent | 96faaecf12d7e42fb2058b583472b4b733e08594 (diff) | |
download | egit-c5e296c4ef629c948958b0f03b11e1e97af1bb30.tar.gz egit-c5e296c4ef629c948958b0f03b11e1e97af1bb30.tar.xz egit-c5e296c4ef629c948958b0f03b11e1e97af1bb30.zip |
Preliminary support for ChangeSets
Adds proper representation of git changes that occurs between two ref's.
Changes are displayed as Team ChangeSet instance. All commits are listed
as a child's of node that represent repository. Every commit node
contains tree-list of all changed, added or deleted resources.
Bug: 318473
CQ: 4400
Change-Id: I198bb3859463ee7e0e230e22cf06761391436cd8
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Diffstat (limited to 'org.eclipse.egit.core.test')
5 files changed, 20 insertions, 12 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparatorTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparatorTest.java index 4fdcca3a9..904333aa0 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparatorTest.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparatorTest.java @@ -172,15 +172,15 @@ public class GitResourceVariantComparatorTest extends GitTestCase { + "keep"); RevCommit commit = testRepo.addAndCommit(iProject, file, "initial commit"); - String path = Repository.stripWorkDir(repo.getWorkTree(), file); - IPath iPath = new Path(path); + String path = Repository.stripWorkDir(repo.getWorkTree(), file.getParentFile()); + IPath iPath = new Path(File.separator + path); IContainer local = createMock(IContainer.class); - expect(local.exists()).andReturn(true); - expect(local.getFullPath()).andReturn(iPath); + expect(local.exists()).andReturn(true).anyTimes(); + expect(local.getFullPath()).andReturn(iPath).anyTimes(); replay(local); - GitFolderResourceVariant remote = new GitFolderResourceVariant(repo, + GitFolderResourceVariant remote = new GitFolderResourceVariant(repo, commit, path); // then diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest.java index 32ef36424..4c889f552 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest.java @@ -13,6 +13,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; +import java.io.IOException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -177,7 +178,7 @@ public class GitResourceVariantTreeSubscriberTest extends GitTestCase { } private GitResourceVariantTreeSubscriber createGitResourceVariantTreeSubscriber( - String src, String dst) { + String src, String dst) throws IOException { GitSynchronizeData gsd = new GitSynchronizeData(repo, src, dst, false); GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd); new GitResourceVariantTreeSubscriber(gsds); diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest1.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest1.java index dd4cb7db1..7010d675c 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest1.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest1.java @@ -13,6 +13,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; +import java.io.IOException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -93,7 +94,7 @@ public class GitResourceVariantTreeSubscriberTest1 extends GitTestCase { } private GitResourceVariantTreeSubscriber createGitResourceVariantTreeSubscriber( - String src, String dst) { + String src, String dst) throws IOException { GitSynchronizeData gsd = new GitSynchronizeData(repo, src, dst, false); GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd); new GitResourceVariantTreeSubscriber(gsds); diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest2.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest2.java index 4a12d331b..b00c0cb72 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest2.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest2.java @@ -13,6 +13,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; +import java.io.IOException; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -104,7 +105,7 @@ public class GitResourceVariantTreeSubscriberTest2 extends GitTestCase { } private GitResourceVariantTreeSubscriber createGitResourceVariantTreeSubscriber( - String src, String dst) { + String src, String dst) throws IOException { GitSynchronizeData gsd = new GitSynchronizeData(repo, src, dst, false); GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd); new GitResourceVariantTreeSubscriber(gsds); diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java index f18972b66..073117a80 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java @@ -16,6 +16,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.util.Arrays; @@ -70,9 +71,11 @@ public class GitResourceVariantTreeTest extends GitTestCase { * roots() method should return list of projects that are associated with * given repository. In this case there is only one project associated with * this repository therefore only one root should be returned. + * + * @throws IOException */ @Test - public void shouldReturnOneRoot() { + public void shouldReturnOneRoot() throws IOException { // when GitSynchronizeData data = new GitSynchronizeData(repo, "", "", false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); @@ -214,8 +217,10 @@ public class GitResourceVariantTreeTest extends GitTestCase { "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); - testRepo.createAndCheckoutBranch(Constants.R_HEADS + Constants.MASTER, Constants.R_HEADS + "test"); - testRepo.appendContentAndCommit(iProject, file, "// test", "first commit"); + testRepo.createAndCheckoutBranch(Constants.R_HEADS + Constants.MASTER, + Constants.R_HEADS + "test"); + testRepo.appendContentAndCommit(iProject, file, "// test", + "first commit"); GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); @@ -229,7 +234,7 @@ public class GitResourceVariantTreeTest extends GitTestCase { assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) - .getContents(); + .getContents(); byte[] actualByte = getBytesAndCloseStream(actualIn); InputStream expectedIn = mainJava.getContents(); byte[] expectedByte = getBytesAndCloseStream(expectedIn); |