Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSzymon Brandys2009-03-04 14:10:19 +0000
committerSzymon Brandys2009-03-04 14:10:19 +0000
commit3e8e9d75895a0532ce6d765b140f68480b38cca4 (patch)
tree044037c0abb3f126a3e6af3dafe8543f61816f14 /tests
parentfab456660486edc71e5408dabe8879d9e1ad76ce (diff)
downloadeclipse.platform.team-3e8e9d75895a0532ce6d765b140f68480b38cca4.tar.gz
eclipse.platform.team-3e8e9d75895a0532ce6d765b140f68480b38cca4.tar.xz
eclipse.platform.team-3e8e9d75895a0532ce6d765b140f68480b38cca4.zip
Bug 265955 - [Apply Patch] FileDiff should be the only class directly implementing IFilePatch2
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
index a69656f33..08e9a317c 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
@@ -16,10 +16,9 @@ import java.util.List;
import junit.framework.TestCase;
-import org.eclipse.compare.internal.core.patch.FileDiff;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.internal.core.patch.LineReader;
-import org.eclipse.compare.internal.patch.FileDiffWrapper;
+import org.eclipse.compare.internal.patch.Utilities;
import org.eclipse.compare.patch.ApplyPatchOperation;
import org.eclipse.compare.patch.IFilePatch;
import org.eclipse.compare.patch.IFilePatch2;
@@ -75,9 +74,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(28, ((Hunk) hunksAfter[3]).getStart(false));
assertEquals(33, ((Hunk) hunksAfter[3]).getStart(true));
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(1, rejects.length);
@@ -126,9 +125,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(46, ((Hunk) hunksAfter[4]).getStart(false));
assertEquals(51, ((Hunk) hunksAfter[4]).getStart(true));
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(0, rejects.length);
@@ -162,9 +161,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(46, ((Hunk) hunksAfter[2]).getStart(false));
assertEquals(43, ((Hunk) hunksAfter[2]).getStart(true));
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(0, rejects.length);
@@ -202,9 +201,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(hunk0, filePatch.getHunks()[0]);
assertEquals(hunk1, filePatch.getHunks()[1]);
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
InputStream actual = result.getPatchedContents();

Back to the top