Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.compare.tests')
-rw-r--r--tests/org.eclipse.compare.tests/.classpath7
-rw-r--r--tests/org.eclipse.compare.tests/.cvsignore1
-rw-r--r--tests/org.eclipse.compare.tests/.project23
-rw-r--r--tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs70
-rw-r--r--tests/org.eclipse.compare.tests/about.html30
-rw-r--r--tests/org.eclipse.compare.tests/build.properties19
-rw-r--r--tests/org.eclipse.compare.tests/plugin.properties15
-rw-r--r--tests/org.eclipse.compare.tests/plugin.xml25
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java32
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareTestPlugin.java31
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java73
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java62
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java152
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/UITest.java24
-rw-r--r--tests/org.eclipse.compare.tests/test.xml51
15 files changed, 0 insertions, 615 deletions
diff --git a/tests/org.eclipse.compare.tests/.classpath b/tests/org.eclipse.compare.tests/.classpath
deleted file mode 100644
index 065ac06e1..000000000
--- a/tests/org.eclipse.compare.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.compare.tests/.cvsignore b/tests/org.eclipse.compare.tests/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/tests/org.eclipse.compare.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.compare.tests/.project b/tests/org.eclipse.compare.tests/.project
deleted file mode 100644
index da302d078..000000000
--- a/tests/org.eclipse.compare.tests/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.compare.tests</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.compare</project>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.jdt.junit</project>
- <project>org.eclipse.jface</project>
- <project>org.eclipse.jface.text</project>
- <project>org.junit</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index cc00a1903..000000000
--- a/tests/org.eclipse.compare.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,70 +0,0 @@
-#Tue Nov 30 15:50:07 CET 2004
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.source=1.3
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-eclipse.preferences.version=1
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.incompleteClasspath=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
diff --git a/tests/org.eclipse.compare.tests/about.html b/tests/org.eclipse.compare.tests/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/tests/org.eclipse.compare.tests/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/build.properties b/tests/org.eclipse.compare.tests/build.properties
deleted file mode 100644
index 91d761ead..000000000
--- a/tests/org.eclipse.compare.tests/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes= plugin.xml,\
- plugin.properties,\
- test.xml,\
- about.html,\
- *.jar
-
-src.includes = about.html
-
-source.comparetests.jar= src/
diff --git a/tests/org.eclipse.compare.tests/plugin.properties b/tests/org.eclipse.compare.tests/plugin.properties
deleted file mode 100644
index dfa2362ec..000000000
--- a/tests/org.eclipse.compare.tests/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-#
-# Resource strings for Compare Tests plugin.xml file
-#
-pluginName= Compare Tests
-providerName= Eclipse.org \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/plugin.xml b/tests/org.eclipse.compare.tests/plugin.xml
deleted file mode 100644
index 1e4dce75c..000000000
--- a/tests/org.eclipse.compare.tests/plugin.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.compare.tests"
- name="%pluginName"
- version="3.1.0"
- provider-name="%providerName"
- class="org.eclipse.compare.tests.CompareTestPlugin">
-
- <runtime>
- <library name="comparetests.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.junit"/>
- <import plugin="org.eclipse.compare"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.jface"/>
- <import plugin="org.eclipse.jdt.junit"/>
- <import plugin="org.eclipse.core.runtime"/>
- </requires>
-
-</plugin>
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java
deleted file mode 100644
index 9f48b4d2d..000000000
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.compare.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * Test some non-UI areas of the compare plugin.
- */
-public class AllTests {
-
- public static Test suite() {
- TestSuite suite= new TestSuite("Test for org.eclipse.compare.tests"); //$NON-NLS-1$
- //$JUnit-BEGIN$
- //suite.addTestSuite(UITest.class);
- suite.addTestSuite(StreamMergerTest.class);
- suite.addTestSuite(DocLineComparatorTest.class);
- suite.addTestSuite(FilterTest.class);
- //$JUnit-END$
- return suite;
- }
-}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareTestPlugin.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareTestPlugin.java
deleted file mode 100644
index e1d92a4c6..000000000
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/CompareTestPlugin.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.compare.tests;
-
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * The main plug-in class to be used in the desktop.
- *
- * @since 3.1
- */
-public class CompareTestPlugin extends Plugin {
-
- private static CompareTestPlugin fgPlugin;
-
- public CompareTestPlugin() {
- fgPlugin= this;
- }
-
- public static CompareTestPlugin getDefault() {
- return fgPlugin;
- }
-}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java
deleted file mode 100644
index 2652df71c..000000000
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/DocLineComparatorTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.compare.tests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.compare.internal.DocLineComparator;
-import org.eclipse.compare.rangedifferencer.IRangeComparator;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-
-public class DocLineComparatorTest extends TestCase {
-
- public DocLineComparatorTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- // empty
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testRangesEqual() {
- IDocument doc1= new Document();
- doc1.set("if (s.strip))"); //$NON-NLS-1$
-
- IDocument doc2= new Document();
- doc2.set("if (s.strip)"); //$NON-NLS-1$
-
- IRangeComparator comp1= new DocLineComparator(doc1, null, true);
- IRangeComparator comp2= new DocLineComparator(doc2, null, true);
-
- Assert.assertFalse(comp1.rangesEqual(0, comp2, 0));
- }
-
- public void testWhitespaceAtEnd() {
- IDocument doc1= new Document();
- doc1.set("if (s.strip))"); //$NON-NLS-1$
-
- IDocument doc2= new Document();
- doc2.set("if (s.strip)) "); //$NON-NLS-1$
-
- IRangeComparator comp1= new DocLineComparator(doc1, null, true);
- IRangeComparator comp2= new DocLineComparator(doc2, null, true);
-
- Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
- }
-
- public void testEmpty() {
- IDocument doc1= new Document();
- doc1.set(""); //$NON-NLS-1$
-
- IDocument doc2= new Document();
- doc2.set(" "); //$NON-NLS-1$
-
- IRangeComparator comp1= new DocLineComparator(doc1, null, true);
- IRangeComparator comp2= new DocLineComparator(doc2, null, true);
-
- Assert.assertTrue(comp1.rangesEqual(0, comp2, 0));
- }
-}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java
deleted file mode 100644
index 20992cf40..000000000
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FilterTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.compare.tests;
-
-import org.eclipse.compare.internal.CompareFilter;
-
-import junit.framework.*;
-import junit.framework.TestCase;
-
-public class FilterTest extends TestCase {
-
- CompareFilter fFilter;
-
- public FilterTest(String name) {
- super(name);
- }
-
- public void testFilterFile() {
- CompareFilter f= new CompareFilter();
- f.setFilters("*.class"); //$NON-NLS-1$
- Assert.assertTrue("file foo.class should be filtered", f.filter("foo.class", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertFalse("file foo.java shouldn't be filtered", f.filter("foo.java", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testFilterDotFile() {
- CompareFilter f= new CompareFilter();
- f.setFilters(".cvsignore"); //$NON-NLS-1$
- Assert.assertTrue("file .cvsignore should be filtered", f.filter(".cvsignore", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertFalse("file foo.cvsignore shouldn't be filtered", f.filter("foo.cvsignore", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testFilterFolder() {
- CompareFilter f= new CompareFilter();
- f.setFilters("bin/"); //$NON-NLS-1$
- Assert.assertTrue("folder bin should be filtered", f.filter("bin", true, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertFalse("file bin shouldn't be filtered", f.filter("bin", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testMultiFilter() {
- CompareFilter f= new CompareFilter();
- f.setFilters("*.class, .cvsignore, bin/"); //$NON-NLS-1$
- Assert.assertTrue("file foo.class should be filtered", f.filter("foo.class", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertFalse("file foo.java shouldn't be filtered", f.filter("foo.java", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertTrue("file .cvsignore should be filtered", f.filter(".cvsignore", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertFalse("file foo.cvsignore shouldn't be filtered", f.filter("foo.cvsignore", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertTrue("folder bin should be filtered", f.filter("bin", true, false)); //$NON-NLS-1$ //$NON-NLS-2$
- Assert.assertFalse("file bin shouldn't be filtered", f.filter("bin", false, false)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public void testVerify() {
- //Assert.assertNull("filters don't verify", Filter.validateResourceFilters("*.class, .cvsignore, bin/"));
- //Assert.assertNotNull("filters shouldn't verify", Filter.validateResourceFilters("bin//"));
- }
-}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java
deleted file mode 100644
index edd4d17d9..000000000
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/StreamMergerTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.compare.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.compare.IStreamMerger;
-import org.eclipse.compare.internal.merge.TextStreamMerger;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-
-public class StreamMergerTest extends TestCase {
-
- String encoding= "UTF-8"; //$NON-NLS-1$
-
- public StreamMergerTest(String name) {
- super(name);
- }
-
- public void testIncomingAddition() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\ndef\nxyz"; //$NON-NLS-1$
- String o= "abc\ndef\n123\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.OK);
- assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), "abc\ndef\n123\nxyz\n"); //$NON-NLS-1$
- }
-
- public void testIncomingDeletion() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\ndef\nxyz"; //$NON-NLS-1$
- String o= "abc\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.OK);
- assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), "abc\nxyz\n"); //$NON-NLS-1$
- }
-
- public void testIncomingReplacement() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\ndef\nxyz"; //$NON-NLS-1$
- String o= "abc\n123\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.OK);
- assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), "abc\n123\nxyz\n"); //$NON-NLS-1$
- }
-
- public void testNonConflictingMerge() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\ndef\nxyz\nfoo"; //$NON-NLS-1$
- String o= "abc\n123\n456\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.OK);
- assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), "abc\n123\n456\nxyz\nfoo\n"); //$NON-NLS-1$
- }
-
- public void testConflictingReplacement() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\nfoo\nxyz"; //$NON-NLS-1$
- String o= "abc\nbar\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.ERROR);
- assertEquals(status.getCode(), IStreamMerger.CONFLICT);
- }
-
- public void testConflictingAddition() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\ndef\n123\nxyz"; //$NON-NLS-1$
- String o= "abc\ndef\n123\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.OK);
- assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), "abc\ndef\n123\nxyz\n"); //$NON-NLS-1$
- }
-
- public void testConflictingDeletion() throws UnsupportedEncodingException {
-
- String a= "abc\ndef\nxyz"; //$NON-NLS-1$
- String t= "abc\nxyz"; //$NON-NLS-1$
- String o= "abc\nxyz"; //$NON-NLS-1$
-
- StringBuffer output= new StringBuffer();
-
- IStatus status= merge(output, a, t, o);
-
- assertEquals(status.getSeverity(), IStatus.OK);
- assertEquals(status.getCode(), IStatus.OK);
- assertEquals(output.toString(), "abc\nxyz\n"); //$NON-NLS-1$
- }
-
- private IStatus merge(StringBuffer output, String a, String m, String y) throws UnsupportedEncodingException {
- InputStream ancestor= new ByteArrayInputStream(a.getBytes(encoding));
- InputStream target= new ByteArrayInputStream(m.getBytes(encoding));
- InputStream other= new ByteArrayInputStream(y.getBytes(encoding));
-
- ByteArrayOutputStream os= new ByteArrayOutputStream();
-
- IStreamMerger merger= new TextStreamMerger();
- IStatus status= merger.merge(os, encoding, ancestor, encoding, target, encoding, other, encoding, (IProgressMonitor)null);
-
- output.append(new String(os.toByteArray(), encoding));
-
- return status;
- }
-}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/UITest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/UITest.java
deleted file mode 100644
index 5128dba03..000000000
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/UITest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.compare.tests;
-
-import junit.framework.TestCase;
-
-public class UITest extends TestCase {
-
- public UITest(String name) {
- super(name);
- }
-
- public void testUI() {
- // intentionally left empty
- }
-}
diff --git a/tests/org.eclipse.compare.tests/test.xml b/tests/org.eclipse.compare.tests/test.xml
deleted file mode 100644
index 972881c98..000000000
--- a/tests/org.eclipse.compare.tests/test.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}/../.."/>
-
- <!-- sets the properties plugin-name, and library-file -->
- <property name="plugin-name" value="org.eclipse.compare.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="compare-folder" value="${eclipse-home}/compare_folder"/>
- <delete dir="${compare-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${compare-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.compare.tests.AllTests"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
- <!-- This target runs the performance test suites. -->
- <target name="performance">
- </target>
-</project>

Back to the top