Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Aniszczyk2010-08-11 16:22:41 -0400
committerCode Review2010-08-11 16:22:41 -0400
commit0bfb7bef58c1999f93d6473453ab5b8fc89c93f2 (patch)
treefdc5f56dde3894d5352364761a29c1f97120e13c /org.eclipse.egit.core.test
parent2f7d9e3d804ca0172fe3b3fa30b317c4cb8e322d (diff)
parentc5e296c4ef629c948958b0f03b11e1e97af1bb30 (diff)
downloadegit-0bfb7bef58c1999f93d6473453ab5b8fc89c93f2.tar.gz
egit-0bfb7bef58c1999f93d6473453ab5b8fc89c93f2.tar.xz
egit-0bfb7bef58c1999f93d6473453ab5b8fc89c93f2.zip
Merge "Preliminary support for ChangeSets"
Diffstat (limited to 'org.eclipse.egit.core.test')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantComparatorTest.java10
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest.java3
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest1.java3
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeSubscriberTest2.java3
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java13
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);

Back to the top