Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2003-05-23 09:16:20 -0400
committerAndre Weinand2003-05-23 09:16:20 -0400
commit284de6d546457399fc6045f4d803b1d448e09f13 (patch)
tree72bbb0dc3a2186e088b521c90fc435d1f72c4826
parentd64bc0dc96aecca7715cf5903f06dde6e849998c (diff)
downloadeclipse.platform.team-284de6d546457399fc6045f4d803b1d448e09f13.tar.gz
eclipse.platform.team-284de6d546457399fc6045f4d803b1d448e09f13.tar.xz
eclipse.platform.team-284de6d546457399fc6045f4d803b1d448e09f13.zip
initial checkin
-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/.project3
-rw-r--r--tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/AllTests.java24
-rw-r--r--tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/DocLineComparatorTest.java72
-rw-r--r--tests/org.eclipse.compare.tests/about.html30
-rw-r--r--tests/org.eclipse.compare.tests/build.properties15
-rw-r--r--tests/org.eclipse.compare.tests/plugin.properties15
-rw-r--r--tests/org.eclipse.compare.tests/plugin.xml20
-rw-r--r--tests/org.eclipse.compare.tests/test.xml48
10 files changed, 233 insertions, 2 deletions
diff --git a/tests/org.eclipse.compare.tests/.classpath b/tests/org.eclipse.compare.tests/.classpath
index 5af765a17..344356ca6 100644
--- a/tests/org.eclipse.compare.tests/.classpath
+++ b/tests/org.eclipse.compare.tests/.classpath
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path=""/>
+ <classpathentry kind="src" path="JUnit Tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path=""/>
+ <classpathentry kind="src" path="/org.junit"/>
+ <classpathentry kind="src" path="/org.eclipse.compare"/>
+ <classpathentry kind="src" path="/org.eclipse.jface.text"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.compare.tests/.cvsignore b/tests/org.eclipse.compare.tests/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/tests/org.eclipse.compare.tests/.project b/tests/org.eclipse.compare.tests/.project
index 65e38a022..3ed5ca356 100644
--- a/tests/org.eclipse.compare.tests/.project
+++ b/tests/org.eclipse.compare.tests/.project
@@ -3,6 +3,9 @@
<name>org.eclipse.compare.tests</name>
<comment></comment>
<projects>
+ <project>org.eclipse.compare</project>
+ <project>org.eclipse.jface.text</project>
+ <project>org.junit</project>
</projects>
<buildSpec>
<buildCommand>
diff --git a/tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/AllTests.java b/tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/AllTests.java
new file mode 100644
index 000000000..59bc66d51
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/AllTests.java
@@ -0,0 +1,24 @@
+/*
+ * Created on May 22, 2003
+ *
+ * To change this generated comment go to
+ * Window>Preferences>Java>Code Generation>Code Template
+ */
+package org.eclipse.compare.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author weinand
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite= new TestSuite("Test for org.eclipse.compare.tests");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(DocLineComparatorTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+}
diff --git a/tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/DocLineComparatorTest.java b/tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/DocLineComparatorTest.java
new file mode 100644
index 000000000..a69c0a2fe
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/JUnit Tests/org/eclipse/compare/tests/DocLineComparatorTest.java
@@ -0,0 +1,72 @@
+/*
+ * Created on May 22, 2003
+ *
+ * To change this generated comment go to
+ * Window>Preferences>Java>Code Generation>Code Template
+ */
+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;
+
+/**
+ * @author weinand
+ */
+public class DocLineComparatorTest extends TestCase {
+
+ public DocLineComparatorTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testRangesEqual() {
+ IDocument doc1= new Document();
+ doc1.set("if (s.strip))");
+
+ IDocument doc2= new Document();
+ doc2.set("if (s.strip)");
+
+ 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))");
+
+ IDocument doc2= new Document();
+ doc2.set("if (s.strip)) ");
+
+ 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("");
+
+ IDocument doc2= new Document();
+ doc2.set(" ");
+
+ 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/about.html b/tests/org.eclipse.compare.tests/about.html
new file mode 100644
index 000000000..9db411aab
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/about.html
@@ -0,0 +1,30 @@
+<!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
new file mode 100644
index 000000000..ac724f16f
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2000, 2003 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,\
+ test.xml,\
+ about.html,\
+ *.jar
+source.comparetests.jar= JUnit Tests/
diff --git a/tests/org.eclipse.compare.tests/plugin.properties b/tests/org.eclipse.compare.tests/plugin.properties
new file mode 100644
index 000000000..f2c6b19b7
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/plugin.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2000, 2003 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
new file mode 100644
index 000000000..dfca1858d
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/plugin.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- File written by PDE 1.0 -->
+<plugin
+ id="org.eclipse.compare.tests"
+ name="%pluginName"
+ provider-name="%providerName"
+ version="2.1.0">
+
+<requires>
+ <import plugin="org.junit"/>
+ <import plugin="org.eclipse.compare"/>
+</requires>
+
+<runtime>
+ <library name="comparetests.jar">
+ <export name="*"/>
+ <packages prefixes="org.eclipse.compare.tests"/>
+ </library>
+ </runtime>
+</plugin>
diff --git a/tests/org.eclipse.compare.tests/test.xml b/tests/org.eclipse.compare.tests/test.xml
new file mode 100644
index 000000000..468802260
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/test.xml
@@ -0,0 +1,48 @@
+<?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>
+
+</project>

Back to the top