This commit was manufactured by cvs2svn to create branch 'dummy'.
Sprout from r1_0 2001-09-19 12:36:00 UTC Andrew Weinand <aweinand> '1GK9GIF: ITPJUI:Linux - Java build path tabs show "&" on the tab name'
Delete:
org.eclipse.jdt.ui.examples.projects/.classpath
org.eclipse.jdt.ui.examples.projects/.cvsignore
org.eclipse.jdt.ui.examples.projects/.vcm_meta
org.eclipse.jdt.ui.examples.projects/archive/junit/junit37src.jar
org.eclipse.jdt.ui.examples.projects/build.properties
org.eclipse.jdt.ui.examples.projects/doc-html/hglegal.htm
org.eclipse.jdt.ui.examples.projects/doc-html/jdt_projects_ex.html
org.eclipse.jdt.ui.examples.projects/doc-html/ngibmcpy.gif
org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationOperation.java
org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationWizard.java
org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.java
org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.properties
org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectsPlugin.java
org.eclipse.jdt.ui.examples.projects/exportplugin.xml
org.eclipse.jdt.ui.examples.projects/icons/basic/ctool16/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/basic/dtool16/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/basic/etool16/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/basic/wizban/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/full/ctool16/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/full/dtool16/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/full/etool16/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/icons/full/wizban/newjprjex_wiz.gif
org.eclipse.jdt.ui.examples.projects/plugin.jars
org.eclipse.jdt.ui.examples.projects/plugin.properties
org.eclipse.jdt.ui.examples.projects/plugin.xml
org.eclipse.jdt.ui.tests/.classpath
org.eclipse.jdt.ui.tests/.cvsignore
org.eclipse.jdt.ui.tests/.vcm_meta
org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ActiveTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ExceptionTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/extensions/RepeatedTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestDecorator.java
org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestSetup.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/Assert.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/AssertionFailedError.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/Protectable.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/Test.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestFailure.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestListener.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestResult.java
org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestSuite.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/AllTests.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/SimpleTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/VectorTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/IMoney.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/Money.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyBag.java
org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/AboutDialog.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/LoadingTestRunner.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ProgressBar.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestRunner.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeFrame.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeModel.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TraceFrame.java
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/error.gif
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/failure.gif
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/logo.gif
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ok.gif
org.eclipse.jdt.ui.tests/JUnit/junit/swingui/smalllogo.gif
org.eclipse.jdt.ui.tests/JUnit/junit/tests/AllTests.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/ClassLoaderTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExceptionTestCaseTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExtensionTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/InheritedTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCaseClass.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCases.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotPublicTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotVoidTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/OneTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/OverrideTestCase.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/SuiteTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestListenerTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTestCaseClassLoader.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/ThreadTest.java
org.eclipse.jdt.ui.tests/JUnit/junit/tests/WasRun.java
org.eclipse.jdt.ui.tests/JUnit/junit/textui/TestRunner.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/AboutDialog.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/LoadingTestRunner.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/Logo.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/ProgressBar.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/TestRunner.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/TraceFrame.java
org.eclipse.jdt.ui.tests/JUnit/junit/ui/logo.gif
org.eclipse.jdt.ui.tests/JUnit/junit/ui/smalllogo.gif
org.eclipse.jdt.ui.tests/JUnit/junit/util/ReloadingTestSuiteLoader.java
org.eclipse.jdt.ui.tests/JUnit/junit/util/StandardTestSuiteLoader.java
org.eclipse.jdt.ui.tests/JUnit/junit/util/StringUtil.java
org.eclipse.jdt.ui.tests/JUnit/junit/util/TestCaseClassLoader.java
org.eclipse.jdt.ui.tests/JUnit/junit/util/TestSuiteLoader.java
org.eclipse.jdt.ui.tests/JUnit/junit/util/Version.java
org.eclipse.jdt.ui.tests/plugin.jars
org.eclipse.jdt.ui.tests/plugin.xml
org.eclipse.jdt.ui.tests/refactoring/MoveCu.txt
org.eclipse.jdt.ui.tests/refactoring/TODO.txt
org.eclipse.jdt.ui.tests/refactoring/experiments/AbstractFieldRefactoring.java
org.eclipse.jdt.ui.tests/refactoring/experiments/MyAction.java
org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterASTAnalyzer.java
org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterMoveFinder.java
org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParametersRefactoring.java
org.eclipse.jdt.ui.tests/refactoring/experiments/TextRegion.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AbstractFieldTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AllRefactoringTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ExtractMethodTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/MoveCUTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/NullRefactoring.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/PathTransformationTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RefactoringTest.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameFieldTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodInInterfaceTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameNonPrivateFieldTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePackageTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameParametersTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateFieldTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateMethodTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameStaticMethodTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameTypeTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameVirtualMethodInClassTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ReorderParametersTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/UndoManagerTests.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/FileDocumentManager.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TestExceptionHandler.java
org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TextBufferChangeCreator.java
org.eclipse.jdt.ui.tests/refactoring/pendingPRs.txt
org.eclipse.jdt.ui.tests/refactoring/regression.txt
org.eclipse.jdt.ui.tests/refactoring/smokeTest.txt
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestPlugin.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestProject.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestSetup.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/NewMain.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/TestPluginLauncher.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/JavaTestCoreApplication.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/TestPluginCoreLauncher.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/HelloWorld.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/JavaTestCase.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/JavaTestUIApplication.java
org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/TestPluginUILauncher.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/MultiElementListSelectorTest.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/StringInputDialogTest.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/TwoPaneElementSelectorTest.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/AddUnimplementedMethodsTest.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeHierarchyTest.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeRefTest.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/CheckBoxExample.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/DialogFieldExample.java
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/TabTest.java
org.eclipse.jdt.ui.vcm/.classpath
org.eclipse.jdt.ui.vcm/.cvsignore
org.eclipse.jdt.ui.vcm/.vcm_meta
org.eclipse.jdt.ui.vcm/build.properties
org.eclipse.jdt.ui.vcm/exportplugin.xml
org.eclipse.jdt.ui.vcm/plugin.jars
org.eclipse.jdt.ui.vcm/plugin.properties
org.eclipse.jdt.ui.vcm/plugin.xml
org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/JavaVCMLabelDecorator.java
org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/TogglePackageViewVersionLabels.javadiff --git a/org.eclipse.jdt.ui.examples.projects/.classpath b/org.eclipse.jdt.ui.examples.projects/.classpath
deleted file mode 100644
index 87a5566..0000000
--- a/org.eclipse.jdt.ui.examples.projects/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="Eclipse Java UI Examples"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.core"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.ui"/>
- <classpathentry kind="lib" path="/org.apache.xerces/xerces.jar"/>
- <classpathentry kind="lib"
- path="/org.eclipse.core.resources/resources.jar" sourcepath="/org.eclipse.core.resources/resourcessrc.zip"/>
- <classpathentry kind="lib"
- path="/org.eclipse.core.runtime/runtime.jar" sourcepath="/org.eclipse.core.runtime/runtimesrc.zip"/>
- <classpathentry kind="lib" path="/org.eclipse.swt/swt.jar" sourcepath="/org.eclipse.swt/swtsrc.zip"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.jdt.ui.examples.projects/.cvsignore b/org.eclipse.jdt.ui.examples.projects/.cvsignore
deleted file mode 100644
index f68b3dd..0000000
--- a/org.eclipse.jdt.ui.examples.projects/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/org.eclipse.jdt.ui.examples.projects/.vcm_meta b/org.eclipse.jdt.ui.examples.projects/.vcm_meta
deleted file mode 100644
index 589d93f..0000000
--- a/org.eclipse.jdt.ui.examples.projects/.vcm_meta
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <comment></comment>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <nature id="org.eclipse.pde.PluginNature"/>
- <reference project-name="org.eclipse.jdt.core"/>
- <reference project-name="org.eclipse.ui"/>
- <reference project-name="org.eclipse.jdt.ui"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
- <builder name="org.eclipse.pde.ManifestBuilder">
- </builder>
- <builder name="org.eclipse.pde.SchemaBuilder">
- </builder>
-</project-description>
diff --git a/org.eclipse.jdt.ui.examples.projects/archive/junit/junit37src.jar b/org.eclipse.jdt.ui.examples.projects/archive/junit/junit37src.jar
deleted file mode 100644
index f62df0c..0000000
--- a/org.eclipse.jdt.ui.examples.projects/archive/junit/junit37src.jar
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/build.properties b/org.eclipse.jdt.ui.examples.projects/build.properties
deleted file mode 100644
index 4a0f5a6..0000000
--- a/org.eclipse.jdt.ui.examples.projects/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-bin.includes = plugin.xml,\
- icons/,\
- plugin.properties,\
- archive/,\
- *.jar
-build.includes = build.properties,\
- build.xml,\
- plugin.jars,\
- plugin.properties,\
- plugin.xml,\
- icons/,\
- archive/,\
- doc-html/
-source.jdtexamples = Eclipse Java UI Examples,
-
-build.vaj.Eclipse\ Java\ UI\ Examples = Eclipse Java UI Examples
-
diff --git a/org.eclipse.jdt.ui.examples.projects/doc-html/hglegal.htm b/org.eclipse.jdt.ui.examples.projects/doc-html/hglegal.htm
deleted file mode 100644
index b071dbd..0000000
--- a/org.eclipse.jdt.ui.examples.projects/doc-html/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.jdt.ui.examples.projects/doc-html/jdt_projects_ex.html b/org.eclipse.jdt.ui.examples.projects/doc-html/jdt_projects_ex.html
deleted file mode 100644
index 329cf79..0000000
--- a/org.eclipse.jdt.ui.examples.projects/doc-html/jdt_projects_ex.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Desktop - Java Editor Example</title>
-</head>
-<body>
-
-<h2>
-<b>Java Example Projects</b></h2>
-
-<h3>
-Introduction</h3>
-The Java examples provide you with sample code for exploring the Eclipse Java
-tools.
-
-<h3>
-Loading the Samples</h3>
-
-<ol>
-<li>
-Open the New wizard.</li>
-
-<li>
-Select the Java Example Projects category.</li>
-
-<li>
-Select the project to be added to your workspace.</li>
-
-<li>
-Enter the new name of the project in your workspace.</li>
-
-</ol>
-
-<p>The wizard creates a new Java project for you and imports the sample code
-into this project.</p>
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/org.eclipse.jdt.ui.examples.projects/doc-html/ngibmcpy.gif b/org.eclipse.jdt.ui.examples.projects/doc-html/ngibmcpy.gif
deleted file mode 100644
index 360f8e9..0000000
--- a/org.eclipse.jdt.ui.examples.projects/doc-html/ngibmcpy.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationOperation.java b/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationOperation.java
deleted file mode 100644
index ae51aa3..0000000
--- a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationOperation.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationWizard.java b/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationWizard.java
deleted file mode 100644
index f45066f..0000000
--- a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectCreationWizard.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.java b/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.java
deleted file mode 100644
index d923ac6..0000000
--- a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.internal.ui.exampleprojects;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ExampleProjectMessages {
-
- private static final String RESOURCE_BUNDLE= ExampleProjectMessages.class.getName();
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private ExampleProjectMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- */
- public static String getFormattedString(String key, Object arg) {
- return MessageFormat.format(getString(key), new Object[] { arg });
- }
-
-
- /**
- * Gets a string from the resource bundle and formats it with arguments
- */
- public static String getFormattedString(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
- }
-
-
-}
diff --git a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.properties b/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.properties
deleted file mode 100644
index bfb7604..0000000
--- a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectMessages.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#########################################
-# (c) Copyright IBM Corp. 2000, 2001.
-# All Rights Reserved.
-#########################################
-
-ExampleProjectCreationWizard.title=New
-ExampleProjectCreationWizard.op_error.title=Project Creation Failed
-ExampleProjectCreationWizard.op_error.message=Project could not be created.
-
-ExampleProjectCreationOperation.op_desc=Creating example project...
-ExampleProjectCreationOperation.overwritequery.title=Overwrite
-ExampleProjectCreationOperation.overwritequery.message=Do you want to overwrite {0}?
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectsPlugin.java b/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectsPlugin.java
deleted file mode 100644
index d13ef51..0000000
--- a/org.eclipse.jdt.ui.examples.projects/examples/org/eclipse/jdt/internal/ui/exampleprojects/ExampleProjectsPlugin.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/exportplugin.xml b/org.eclipse.jdt.ui.examples.projects/exportplugin.xml
deleted file mode 100644
index f7bdbb6..0000000
--- a/org.eclipse.jdt.ui.examples.projects/exportplugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<project name="org.eclipse.search" default="export" basedir=".">
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../../plugin-export" />
- <property name="plugin" value="org.eclipse.jdt.ui.examples.projects" />
- <property name="dest" value="${destdir}/${plugin}" />
- </target>
-
- <target name="build" depends="init">
- <incremental project="${plugin}" kind="incr"/>
- </target>
-
- <target name="export" depends="build">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/jdtexamples.jar"
- basedir="bin"
- />
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy file="plugin.jars" todir="${dest}"/>
- <copy todir="${dest}/icons">
- <fileset dir="icons" />
- </copy>
- <copy todir="${dest}/archive">
- <fileset dir="archive" />
- </copy>
- <copy todir="${dest}/doc-html">
- <fileset dir="doc-html" />
- </copy>
-
- </target>
-</project>
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/basic/ctool16/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/basic/ctool16/newjprjex_wiz.gif
deleted file mode 100644
index 67f7075..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/basic/ctool16/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/basic/dtool16/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/basic/dtool16/newjprjex_wiz.gif
deleted file mode 100644
index 320eaeb..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/basic/dtool16/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/basic/etool16/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/basic/etool16/newjprjex_wiz.gif
deleted file mode 100644
index 25f6b9c..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/basic/etool16/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/basic/wizban/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/basic/wizban/newjprjex_wiz.gif
deleted file mode 100644
index 0980a48..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/basic/wizban/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/full/ctool16/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/full/ctool16/newjprjex_wiz.gif
deleted file mode 100644
index cc7a59e..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/full/ctool16/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/full/dtool16/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/full/dtool16/newjprjex_wiz.gif
deleted file mode 100644
index e319b2d..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/full/dtool16/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/full/etool16/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/full/etool16/newjprjex_wiz.gif
deleted file mode 100644
index cf96d0a..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/full/etool16/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/icons/full/wizban/newjprjex_wiz.gif b/org.eclipse.jdt.ui.examples.projects/icons/full/wizban/newjprjex_wiz.gif
deleted file mode 100644
index 151fdd4..0000000
--- a/org.eclipse.jdt.ui.examples.projects/icons/full/wizban/newjprjex_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.examples.projects/plugin.jars b/org.eclipse.jdt.ui.examples.projects/plugin.jars
deleted file mode 100644
index 588bf2c..0000000
--- a/org.eclipse.jdt.ui.examples.projects/plugin.jars
+++ /dev/null
@@ -1 +0,0 @@
-jdtexamples.jar=Eclipse Java UI Examples
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.examples.projects/plugin.properties b/org.eclipse.jdt.ui.examples.projects/plugin.properties
deleted file mode 100644
index 459d288..0000000
--- a/org.eclipse.jdt.ui.examples.projects/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-#########################################
-# (c) Copyright IBM Corp. 2000, 2001.
-# All Rights Reserved.
-#########################################
-
-# --- string from plugin.xml ----
-
-pluginName=Java Development Tools Example Projects
-
-JUnitProjectExampleCreationWizard.title=JUnit Example Project
-JUnitProjectExampleCreationWizard.description=Create a new JUnit project
-JUnitProjectExampleCreationWizard.pagetitle=JUnit
-JUnitProjectExampleCreationWizard.pagedescription=Create a Java project containing the JUnit source
diff --git a/org.eclipse.jdt.ui.examples.projects/plugin.xml b/org.eclipse.jdt.ui.examples.projects/plugin.xml
deleted file mode 100644
index 9880dbf..0000000
--- a/org.eclipse.jdt.ui.examples.projects/plugin.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- name="%pluginName"
- id = "org.eclipse.jdt.ui.examples.projects"
- version = "1.0"
- provider-name = "Object Technology International, Inc."
- class="org.eclipse.jdt.internal.ui.exampleprojects.ExampleProjectsPlugin">
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.ui"/>
- </requires>
-
- <runtime>
- <library name="jdtexamples.jar"/>
- </runtime>
-
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- id = "org.eclipse.jdt.examples.projects"
- parentCategory="org.eclipse.ui.Examples"
- name="Java">
- </category>
- <wizard
- id="org.eclipse.jdt.examples.projects.JUnitProjectExampleCreationWizard"
- name="%JUnitProjectExampleCreationWizard.title"
- class="org.eclipse.jdt.internal.ui.exampleprojects.ExampleProjectCreationWizard"
- category="org.eclipse.ui.Examples/org.eclipse.jdt.examples.projects"
- project="true"
- finalPerspective="org.eclipse.jdt.ui.JavaPerspective"
- icon="icons/full/ctool16/newjprjex_wiz.gif">
- <description>%JUnitProjectExampleCreationWizard.description</description>
- <pagetitle>%JUnitProjectExampleCreationWizard.pagetitle</pagetitle>
- <pagedescription>%JUnitProjectExampleCreationWizard.pagedescription</pagedescription>
- <projectsetup output="" jre="true">
- <src path="" import="archive/junit/junit37src.jar"/>
- </projectsetup>
- </wizard>
-</extension>
-</plugin>
diff --git a/org.eclipse.jdt.ui.tests/.classpath b/org.eclipse.jdt.ui.tests/.classpath
deleted file mode 100644
index 19f8903..0000000
--- a/org.eclipse.jdt.ui.tests/.classpath
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="JUnit"/>
- <classpathentry kind="src" path="Java UI Tests"/>
- <classpathentry kind="src" path="Test Plugin"/>
- <classpathentry kind="src" path="Refactoring Tests"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.ui"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.core"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="lib" path="/org.eclipse.help/help.jar"/>
- <classpathentry kind="lib" path="/org.eclipse.core.resources/resources.jar"/>
- <classpathentry kind="lib" path="/org.eclipse.core.runtime/runtime.jar"/>
- <classpathentry kind="lib" path="/org.eclipse.core.boot/boot.jar"/>
- <classpathentry kind="lib" path="/Eclipse Core Launcher/startup.jar"/>
- <classpathentry kind="lib" path="/org.eclipse.swt/swt.jar" sourcepath="/org.eclipse.swt/swtsrc.zip"/>
- <classpathentry kind="lib" path="/org.apache.xerces/xerces.jar"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="src" sourcepath="JRE_SRC"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.jdt.ui.tests/.cvsignore b/org.eclipse.jdt.ui.tests/.cvsignore
deleted file mode 100644
index c5e82d7..0000000
--- a/org.eclipse.jdt.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/.vcm_meta b/org.eclipse.jdt.ui.tests/.vcm_meta
deleted file mode 100644
index 7c63429..0000000
--- a/org.eclipse.jdt.ui.tests/.vcm_meta
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <reference project-name="org.eclipse.jdt.core"/>
- <reference project-name="org.eclipse.jdt.ui"/>
- <reference project-name="org.eclipse.ui"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
-</project-description>
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ActiveTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ActiveTest.java
deleted file mode 100644
index ca4ce17..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ActiveTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package junit.extensions;
-
-import junit.framework.*;
-
-/**
- * A Decorator that runs a test in a separate thread.
- *
- */
-public class ActiveTest extends TestDecorator {
-
- public ActiveTest(Test test) {
- super(test);
- }
- public void run(TestResult result) {
- final TestResult finalResult= result;
- Thread t= new Thread() {
- public void run() {
- fTest.run(finalResult);
- }
- };
- t.start();
- }
- public String toString() {
- return super.toString()+"(active)";
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ExceptionTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ExceptionTestCase.java
deleted file mode 100644
index 8c3417c..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/ExceptionTestCase.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package junit.extensions;
-
-import junit.framework.*;
-
-/**
- * A TestCase that expects an Exception of class fExpected to be thrown.
- * The other way to check that an expected exception is thrown is:
- * <pre>
- * try {
- * shouldThrow();
- * }
- * catch (SpecialException e) {
- * return;
- * }
- * fail("Expected SpecialException");
- * </pre>
- *
- * To use ExceptionTestCase, create a TestCase like:
- * <pre>
- * new ExceptionTestCase("testShouldThrow", SpecialException.class);
- * </pre>
- */
-public class ExceptionTestCase extends TestCase {
- Class fExpected;
-/**
- * @param name java.lang.String
- * @param exception java.lang.Class
- */
-public ExceptionTestCase(String name, Class exception) {
- super(name);
- fExpected= exception;
-}
- /**
- * Execute the test method expecting that an Exception of
- * class fExpected or one of its subclasses will be thrown
- */
- protected void runTest() throws Throwable {
- try {
- super.runTest();
- }
- catch (Exception e) {
- if (fExpected.isAssignableFrom(e.getClass()))
- return;
- else
- throw e;
- }
- fail("Expected exception " + fExpected);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/RepeatedTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/RepeatedTest.java
deleted file mode 100644
index f3ef22e..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/RepeatedTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package junit.extensions;
-
-import junit.framework.*;
-
-/**
- * A Decorator that runs a test repeatedly.
- *
- */
-public class RepeatedTest extends TestDecorator {
- private int fTimesRepeat;
-
- public RepeatedTest(Test test, int repeat) {
- super(test);
- fTimesRepeat= repeat;
- }
- public int countTestCases() {
- return super.countTestCases()*fTimesRepeat;
- }
- public void run(TestResult result) {
- for (int i= 0; i < fTimesRepeat; i++) {
- if (result.shouldStop())
- break;
- super.run(result);
- }
- }
- public String toString() {
- return super.toString()+"(repeated)";
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestDecorator.java b/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestDecorator.java
deleted file mode 100644
index 324383e..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestDecorator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package junit.extensions;
-
-import junit.framework.*;
-
-/**
- * A Decorator for Tests. Use TestDecorator as the base class
- * for defining new test decorators. Test decorator subclasses
- * can be introduced to add behaviour before or after a test
- * is run.
- *
- */
-public class TestDecorator implements Test {
- protected Test fTest;
-
- public TestDecorator(Test test) {
- fTest= test;
- }
- /**
- * The basic run behaviour.
- */
- public void basicRun(TestResult result) {
- fTest.run(result);
- }
- public int countTestCases() {
- return fTest.countTestCases();
- }
- public void run(TestResult result) {
- basicRun(result);
- }
- public String toString() {
- return fTest.toString();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestSetup.java b/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestSetup.java
deleted file mode 100644
index a4e9e3a..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/extensions/TestSetup.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package junit.extensions;
-
-import junit.framework.*;
-
-/**
- * A Decorator to set up and tear down additional fixture state.
- * Subclass TestSetup and insert it into your tests when you want
- * to set up additional state once before the tests are run.
- */
-public class TestSetup extends TestDecorator {
-
- public TestSetup(Test test) {
- super(test);
- }
- public void run(final TestResult result) {
- Protectable p= new Protectable() {
- public void protect() throws Exception {
- setUp();
- basicRun(result);
- tearDown();
- }
- };
- result.runProtected(this, p);
- }
- /**
- * Sets up the fixture. Override to set up additional fixture
- * state.
- */
- protected void setUp() throws Exception {
- }
- /**
- * Tears down the fixture. Override to tear down the additional
- * fixture state.
- */
- protected void tearDown() throws Exception {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Assert.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Assert.java
deleted file mode 100644
index 6066a6c..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Assert.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package junit.framework;
-
-/**
- * A set of assert methods.
- */
-
-public class Assert {
- /**
- * Protect constructor since it is a static only class
- */
- protected Assert() {
- }
- /**
- * Asserts that a condition is true. If it isn't it throws
- * an AssertionFailedError with the given message.
- */
- static public void assert(String message, boolean condition) {
- if (!condition)
- fail(message);
- }
- /**
- * Asserts that a condition is true. If it isn't it throws
- * an AssertionFailedError.
- */
- static public void assert(boolean condition) {
- assert(null, condition);
- }
- /**
- * Asserts that two doubles are equal.
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- * @param delta tolerated delta
- */
- static public void assertEquals(double expected, double actual, double delta) {
- assertEquals(null, expected, actual, delta);
- }
- /**
- * Asserts that two longs are equal.
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- */
- static public void assertEquals(long expected, long actual) {
- assertEquals(null, expected, actual);
- }
- /**
- * Asserts that two objects are equal. If they are not
- * an AssertionFailedError is thrown.
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- */
- static public void assertEquals(Object expected, Object actual) {
- assertEquals(null, expected, actual);
- }
- /**
- * Asserts that two doubles are equal.
- * @param message the detail message for this assertion
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- * @param delta tolerated delta
- */
- static public void assertEquals(String message, double expected, double actual, double delta) {
- if (Math.abs(expected-actual) > delta)
- failNotEquals(message, new Double(expected), new Double(actual));
- }
- /**
- * Asserts that two longs are equal.
- * @param message the detail message for this assertion
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- */
- static public void assertEquals(String message, long expected, long actual) {
- assertEquals(message, new Long(expected), new Long(actual));
- }
- /**
- * Asserts that two objects are equal. If they are not
- * an AssertionFailedError is thrown.
- * @param message the detail message for this assertion
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- */
- static public void assertEquals(String message, Object expected, Object actual) {
- if (expected == null && actual == null)
- return;
- if (expected != null && expected.equals(actual))
- return;
- failNotEquals(message, expected, actual);
- }
- /**
- * Asserts that an object isn't null.
- */
- static public void assertNotNull(Object object) {
- assertNotNull(null, object);
- }
- /**
- * Asserts that an object isn't null.
- */
- static public void assertNotNull(String message, Object object) {
- assert(message, object != null);
- }
- /**
- * Asserts that an object is null.
- */
- static public void assertNull(Object object) {
- assertNull(null, object);
- }
- /**
- * Asserts that an object is null.
- */
- static public void assertNull(String message, Object object) {
- assert(message, object == null);
- }
- /**
- * Asserts that two objects refer to the same object. If they are not
- * the same an AssertionFailedError is thrown.
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- */
- static public void assertSame(Object expected, Object actual) {
- assertSame(null, expected, actual);
- }
- /**
- * Asserts that two objects refer to the same object. If they are not
- * an AssertionFailedError is thrown.
- * @param message the detail message for this assertion
- * @param expected the expected value of an object
- * @param actual the actual value of an object
- */
- static public void assertSame(String message, Object expected, Object actual) {
- if (expected == actual)
- return;
- failNotSame(message, expected, actual);
- }
- /**
- * Fails a test with no message.
- */
- static public void fail() {
- fail(null);
- }
- /**
- * Fails a test with the given message.
- */
- static public void fail(String message) {
- throw new AssertionFailedError(message);
- }
- static private void failNotEquals(String message, Object expected, Object actual) {
- String formatted= "";
- if (message != null)
- formatted= message+" ";
- fail(formatted+"expected:<"+expected+"> but was:<"+actual+">");
- }
- static private void failNotSame(String message, Object expected, Object actual) {
- String formatted= "";
- if (message != null)
- formatted= message+" ";
- fail(formatted+"expected same");
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/AssertionFailedError.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/AssertionFailedError.java
deleted file mode 100644
index d09cd10..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/AssertionFailedError.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package junit.framework;
-
-/**
- * Thrown when an assertion failed.
- */
-public class AssertionFailedError extends Error {
-
- public AssertionFailedError () {
- }
- public AssertionFailedError (String message) {
- super (message);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Protectable.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Protectable.java
deleted file mode 100644
index 509ddc2..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Protectable.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package junit.framework;
-
-/**
- * A <em>Protectable</em> can be run and can throw a Throwable.
- *
- * @see TestResult
- */
-public interface Protectable {
-
- /**
- * Run the the following method protected.
- */
- public abstract void protect() throws Throwable;
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Test.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Test.java
deleted file mode 100644
index 4bb25b7..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/Test.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package junit.framework;
-
-/**
- * A <em>Test</em> can be run and collect its results.
- *
- * @see TestResult
- */
-public interface Test {
- /**
- * Counts the number of test cases that will be run by this test.
- */
- public abstract int countTestCases();
- /**
- * Runs a test and collects its result in a TestResult instance.
- */
- public abstract void run(TestResult result);
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestCase.java
deleted file mode 100644
index e59bb7e..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestCase.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package junit.framework;
-
-import java.lang.reflect.*;
-
-/**
- * A test case defines the fixture to run multiple tests. To define a test case<br>
- * 1) implement a subclass of TestCase<br>
- * 2) define instance variables that store the state of the fixture<br>
- * 3) initialize the fixture state by overriding <code>setUp</code><br>
- * 4) clean-up after a test by overriding <code>tearDown</code>.<br>
- * Each test runs in its own fixture so there
- * can be no side effects among test runs.
- * Here is an example:
- * <pre>
- * public class MathTest extends TestCase {
- * protected double fValue1;
- * protected double fValue2;
- *
- * public MathTest(String name) {
- * super(name);
- * }
- *
- * protected void setUp() {
- * fValue1= 2.0;
- * fValue2= 3.0;
- * }
- * }
- * </pre>
- *
- * For each test implement a method which interacts
- * with the fixture. Verify the expected results with assertions specified
- * by calling <code>assert</code> with a boolean.
- * <pre>
- * protected void testAdd() {
- * double result= fValue1 + fValue2;
- * assert(result == 5.0);
- * }
- * </pre>
- * Once the methods are defined you can run them. The framework supports
- * both a static type safe and more dynamic way to run a test.
- * In the static way you override the runTest method and define the method to
- * be invoked. A convenient way to do so is with an anonymous inner class.
- * <pre>
- * Test test= new MathTest("add") {
- * public void runTest() {
- * testAdd();
- * }
- * };
- * test.run();
- * </pre>
- * The dynamic way uses reflection to implement <code>runTest</code>. It dynamically finds
- * and invokes a method.
- * In this case the name of the test case has to correspond to the test method
- * to be run.
- * <pre>
- * Test= new MathTest("testAdd");
- * test.run();
- * </pre>
- * The tests to be run can be collected into a TestSuite. JUnit provides
- * different <i>test runners</i> which can run a test suite and collect the results.
- * A test runner either expects a static method <code>suite</code> as the entry
- * point to get a test to run or it will extract the suite automatically.
- * <pre>
- * public static Test suite() {
- * suite.addTest(new MathTest("testAdd"));
- * suite.addTest(new MathTest("testDivideByZero"));
- * return suite;
- * }
- * </pre>
- * @see TestResult
- * @see TestSuite
- */
-
-public abstract class TestCase extends Assert implements Test {
- /**
- * the name of the test case
- */
- private final String fName;
- /**
- * Constructs a test case with the given name.
- */
- public TestCase(String name) {
- fName= name;
- }
- /**
- * Counts the number of test cases executed by run(TestResult result).
- */
- public int countTestCases() {
- return 1;
- }
- /**
- * Creates a default TestResult object
- *
- * @see TestResult
- */
- protected TestResult createResult() {
- return new TestResult();
- }
- /**
- * Gets the name of the test case.
- */
- public String name() {
- return fName;
- }
- /**
- * A convenience method to run this test, collecting the results with a
- * default TestResult object.
- *
- * @see TestResult
- */
- public TestResult run() {
- TestResult result= createResult();
- run(result);
- return result;
- }
- /**
- * Runs the test case and collects the results in TestResult.
- */
- public void run(TestResult result) {
- result.run(this);
- }
- /**
- * Runs the bare test sequence.
- * @exception Throwable if any exception is thrown
- */
- public void runBare() throws Throwable {
- setUp();
- try {
- runTest();
- }
- finally {
- tearDown();
- }
- }
- /**
- * Override to run the test and assert its state.
- * @exception Throwable if any exception is thrown
- */
- protected void runTest() throws Throwable {
- Method runMethod= null;
- try {
- // use getMethod to get all public inherited
- // methods. getDeclaredMethods returns all
- // methods of this class but excludes the
- // inherited ones.
- runMethod= getClass().getMethod(fName, new Class[0]);
- } catch (NoSuchMethodException e) {
- fail("Method \""+fName+"\" not found");
- }
- if (runMethod != null && !Modifier.isPublic(runMethod.getModifiers())) {
- fail("Method \""+fName+"\" should be public");
- }
-
- try {
- runMethod.invoke(this, new Class[0]);
- }
- catch (InvocationTargetException e) {
- e.fillInStackTrace();
- throw e.getTargetException();
- }
- catch (IllegalAccessException e) {
- e.fillInStackTrace();
- throw e;
- }
- }
- /**
- * Sets up the fixture, for example, open a network connection.
- * This method is called before a test is executed.
- */
- protected void setUp() throws Exception {
- }
- /**
- * Tears down the fixture, for example, close a network connection.
- * This method is called after a test is executed.
- */
- protected void tearDown() throws Exception {
- }
- /**
- * Returns a string representation of the test case
- */
- public String toString() {
- return name()+"("+getClass().getName()+")";
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestFailure.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestFailure.java
deleted file mode 100644
index 6e39830..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestFailure.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package junit.framework;
-
-/**
- * A <code>TestFailure</code> collects a failed test together with
- * the caught exception.
- * @see TestResult
- */
-public class TestFailure extends Object {
- protected Test fFailedTest;
- protected Throwable fThrownException;
-
- /**
- * Constructs a TestFailure with the given test and exception.
- */
- public TestFailure(Test failedTest, Throwable thrownException) {
- fFailedTest= failedTest;
- fThrownException= thrownException;
- }
- /**
- * Gets the failed test.
- */
- public Test failedTest() {
- return fFailedTest;
- }
- /**
- * Gets the thrown exception.
- */
- public Throwable thrownException() {
- return fThrownException;
- }
- /**
- * Returns a short description of the failure.
- */
- public String toString() {
- StringBuffer buffer= new StringBuffer();
- buffer.append(fFailedTest+": "+fThrownException.getMessage());
- return buffer.toString();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestListener.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestListener.java
deleted file mode 100644
index de9704a..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package junit.framework;
-
-/**
- * A Listener for test progress
- */
-public interface TestListener {
- /**
- * An error occurred.
- */
- public void addError(Test test, Throwable t);
- /**
- * A failure occurred.
- */
- public void addFailure(Test test, Throwable t);
- /**
- * A test ended.
- */
- public void endTest(Test test);
- /**
- * A test started.
- */
- public void startTest(Test test);
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestResult.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestResult.java
deleted file mode 100644
index e8edcac..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestResult.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package junit.framework;
-
-import java.util.Vector;
-import java.util.Enumeration;
-
-/**
- * A <code>TestResult</code> collects the results of executing
- * a test case. It is an instance of the Collecting Parameter pattern.
- * The test framework distinguishes between <i>failures</i> and <i>errors</i>.
- * A failure is anticipated and checked for with assertions. Errors are
- * unanticipated problems like an <code>ArrayIndexOutOfBoundsException</code>.
- *
- * @see Test
- */
-public class TestResult extends Object {
- protected Vector fFailures;
- protected Vector fErrors;
- protected Vector fListeners;
- protected int fRunTests;
- private boolean fStop;
-
- public TestResult() {
- fFailures= new Vector();
- fErrors= new Vector();
- fListeners= new Vector();
- fRunTests= 0;
- fStop= false;
- }
- /**
- * Adds an error to the list of errors. The passed in exception
- * caused the error.
- */
- public void addError(Test test, Throwable t) {
- fErrors.addElement(new TestFailure(test, t));
- for (Enumeration e= cloneListeners().elements(); e.hasMoreElements(); ) {
- ((TestListener)e.nextElement()).addError(test, t);
- }
- }
- /**
- * Adds a failure to the list of failures. The passed in exception
- * caused the failure.
- */
- public synchronized void addFailure(Test test, AssertionFailedError t) {
- fFailures.addElement(new TestFailure(test, t));
- for (Enumeration e= cloneListeners().elements(); e.hasMoreElements(); ) {
- ((TestListener)e.nextElement()).addFailure(test, t);
- }
- }
- /**
- * Registers a TestListener
- */
- public synchronized void addListener(TestListener listener) {
- fListeners.addElement(listener);
- }
- /**
- * Returns a copy of the listeners.
- */
- private synchronized Vector cloneListeners() {
- return (Vector)fListeners.clone();
- }
- /**
- * Informs the result that a test was completed.
- */
- public void endTest(Test test) {
- for (Enumeration e= cloneListeners().elements(); e.hasMoreElements(); ) {
- ((TestListener)e.nextElement()).endTest(test);
- }
- }
- /**
- * Gets the number of detected errors.
- */
- public synchronized int errorCount() {
- return fErrors.size();
- }
- /**
- * Returns an Enumeration for the errors
- */
- public synchronized Enumeration errors() {
- return fErrors.elements();
- }
- /**
- * Gets the number of detected failures.
- */
- public synchronized int failureCount() {
- return fFailures.size();
- }
- /**
- * Returns an Enumeration for the failures
- */
- public synchronized Enumeration failures() {
- return fFailures.elements();
- }
- /**
- * Runs a TestCase.
- */
- protected void run(final TestCase test) {
- startTest(test);
- Protectable p= new Protectable() {
- public void protect() throws Throwable {
- test.runBare();
- }
- };
- runProtected(test, p);
- endTest(test);
- }
- /**
- * Gets the number of run tests.
- */
- public synchronized int runCount() {
- return fRunTests;
- }
- /**
- * Runs a TestCase.
- */
- public void runProtected(final Test test, Protectable p) {
- try {
- p.protect();
- }
- catch (AssertionFailedError e) {
- addFailure(test, e);
- }
- catch (Throwable e) {
- addError(test, e);
- }
- }
- /**
- * Gets the number of run tests.
- * @deprecated use <code>runCount</code> instead
- */
- public synchronized int runTests() {
- return runCount();
- }
- /**
- * Checks whether the test run should stop
- */
- public synchronized boolean shouldStop() {
- return fStop;
- }
- /**
- * Informs the result that a test will be started.
- */
- public void startTest(Test test) {
- synchronized(this) {
- fRunTests++;
- }
- for (Enumeration e= cloneListeners().elements(); e.hasMoreElements(); ) {
- ((TestListener)e.nextElement()).startTest(test);
- }
- }
- /**
- * Marks that the test run should stop.
- */
- public synchronized void stop() {
- fStop= true;
- }
- /**
- * Gets the number of detected errors.
- * @deprecated use <code>errorCount</code> instead
- */
- public synchronized int testErrors() {
- return errorCount();
- }
- /**
- * Gets the number of detected failures.
- * @deprecated use <code>failureCount</code> instead
- */
- public synchronized int testFailures() {
- return failureCount();
- }
- /**
- * Returns whether the entire test was successful or not.
- */
- public synchronized boolean wasSuccessful() {
- return testFailures() == 0 && testErrors() == 0;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestSuite.java b/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestSuite.java
deleted file mode 100644
index 47161a2..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/framework/TestSuite.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package junit.framework;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.lang.reflect.*;
-
-/**
- * A <code>TestSuite</code> is a <code>Composite</code> of Tests.
- * It runs a collection of test cases. Here is an example using
- * the dynamic test definition.
- * <pre>
- * TestSuite suite= new TestSuite();
- * suite.addTest(new MathTest("testAdd"));
- * suite.addTest(new MathTest("testDivideByZero"));
- * </pre>
- * Alternatively, a TestSuite can extract the tests to be run automatically.
- * To do so you pass the class of your TestCase class to the
- * TestSuite constructor.
- * <pre>
- * TestSuite suite= new TestSuite(MathTest.class);
- * </pre>
- * This constructor creates a suite with all the methods
- * starting with "test" that take no arguments.
- *
- * @see Test
- */
-public class TestSuite implements Test {
-
- private Vector fTests= new Vector(10);
- private String fName;
-
- /**
- * Constructs an empty TestSuite.
- */
- public TestSuite() {
- }
- /**
- * Constructs a TestSuite from the given class. Adds all the methods
- * starting with "test" as test cases to the suite.
- * Parts of this method was written at 2337 meters in the Hüffihütte,
- * Kanton Uri
- */
-
- public TestSuite(final Class theClass) {
- fName= theClass.getName();
- Constructor constructor= getConstructor(theClass);
- if (!Modifier.isPublic(theClass.getModifiers())) {
- addTest(warning("Class "+theClass.getName()+" is not public"));
- return;
-
- }
- if (constructor == null) {
- addTest(warning("Class "+theClass.getName()+" has no public constructor TestCase(String name)"));
- return;
- }
-
- Class superClass= theClass;
- Vector names= new Vector();
- while (Test.class.isAssignableFrom(superClass)) {
- Method[] methods= superClass.getDeclaredMethods();
- for (int i= 0; i < methods.length; i++) {
- addTestMethod(methods[i], names, constructor);
- }
- superClass= superClass.getSuperclass();
- }
- if (fTests.size() == 0)
- addTest(warning("No tests found in "+theClass.getName()));
- }
- /**
- * Constructs an empty TestSuite.
- */
- public TestSuite(String name) {
- fName= name;
- }
- /**
- * Adds a test to the suite.
- */
- public void addTest(Test test) {
- fTests.addElement(test);
- }
- private void addTestMethod(Method m, Vector names, Constructor constructor) {
- String name= m.getName();
- if (names.contains(name))
- return;
- if (isPublicTestMethod(m)) {
- names.addElement(name);
-
- Object[] args= new Object[]{name};
- try {
- addTest((Test)constructor.newInstance(args));
- } catch (Exception t) {
- addTest(warning("Cannot instantiate test case: "+name));
- }
- } else { // almost a test method
- if (isTestMethod(m))
- addTest(warning("Test method isn't public: "+m.getName()));
- }
- }
- /**
- * Counts the number of test cases that will be run by this test.
- */
- public int countTestCases() {
- int count= 0;
- for (Enumeration e= tests(); e.hasMoreElements(); ) {
- Test test= (Test)e.nextElement();
- count= count + test.countTestCases();
- }
- return count;
- }
- /**
- * Gets a constructor which takes a single String as
- * its argument.
- */
- private Constructor getConstructor(Class theClass) {
- Class[] args= { String.class };
- Constructor c= null;
- try {
- c= theClass.getConstructor(args);
- } catch(Exception e) {
- }
- return c;
- }
- /**
- */
- private boolean isPublicTestMethod(Method m) {
- return isTestMethod(m) && Modifier.isPublic(m.getModifiers());
- }
- /**
- */
- private boolean isTestMethod(Method m) {
- String name= m.getName();
- Class[] parameters= m.getParameterTypes();
- Class returnType= m.getReturnType();
- return parameters.length == 0 && name.startsWith("test") && returnType.equals(Void.TYPE);
- }
- /**
- * Runs the tests and collects their result in a TestResult.
- */
- public void run(TestResult result) {
- for (Enumeration e= tests(); e.hasMoreElements(); ) {
- if (result.shouldStop() )
- break;
- Test test= (Test)e.nextElement();
- test.run(result);
- }
- }
- /**
- * Returns the test at the given index
- */
- public Test testAt(int index) {
- return (Test)fTests.elementAt(index);
- }
- /**
- * Returns the number of tests in this suite
- */
- public int testCount() {
- return fTests.size();
- }
- /**
- * Returns the tests as an enumeration
- */
- public Enumeration tests() {
- return fTests.elements();
- }
- /**
- */
- public String toString() {
- if (fName != null)
- return fName;
- return super.toString();
- }
- /**
- * Returns a test which will fail and log a warning message.
- */
- private Test warning(final String message) {
- return new TestCase("warning") {
- protected void runTest() {
- fail(message);
- }
- };
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/AllTests.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/AllTests.java
deleted file mode 100644
index 0f54d2c..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/AllTests.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package junit.samples;
-
-import junit.framework.*;
-
-/**
- * TestSuite that runs all the sample tests
- *
- */
-public class AllTests {
-
- public static void main (String[] args) {
- junit.textui.TestRunner.run (suite());
- }
- public static Test suite ( ) {
- TestSuite suite= new TestSuite("All JUnit Tests");
- suite.addTest(VectorTest.suite());
- suite.addTest(new TestSuite(junit.samples.money.MoneyTest.class));
- suite.addTest(junit.tests.AllTests.suite());
- return suite;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/SimpleTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/SimpleTest.java
deleted file mode 100644
index 09e4128..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/SimpleTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package junit.samples;
-
-import junit.framework.*;
-
-/**
- * Some simple tests.
- *
- */
-public class SimpleTest extends TestCase {
- protected int fValue1;
- protected int fValue2;
- public SimpleTest(String name) {
- super(name);
- }
- protected void setUp() {
- fValue1= 2;
- fValue2= 3;
- }
- public static Test suite() {
-
- /*
- * the type safe way
- *
- TestSuite suite= new TestSuite();
- suite.addTest(
- new SimpleTest("add") {
- protected void runTest() { testAdd(); }
- }
- );
-
- suite.addTest(
- new SimpleTest("testDivideByZero") {
- protected void runTest() { testDivideByZero(); }
- }
- );
- return suite;
- */
-
- /*
- * the dynamic way
- */
- return new TestSuite(SimpleTest.class);
- }
- public void testAdd() {
- double result= fValue1 + fValue2;
- // forced failure result == 5
- assert(result == 6);
- }
- public void testDivideByZero() {
- int zero= 0;
- int result= 8/zero;
- }
- public void testEquals() {
- assertEquals(12, 12);
- assertEquals(12L, 12L);
- assertEquals(new Long(12), new Long(12));
-
- assertEquals("Size", 12, 13);
- assertEquals("Capacity", 12.0, 11.99, 0.0);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/VectorTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/VectorTest.java
deleted file mode 100644
index 6083c06..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/VectorTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package junit.samples;
-
-import junit.framework.*;
-import java.util.Vector;
-
-/**
- * A sample test case, testing <code>java.util.Vector</code>.
- *
- */
-public class VectorTest extends TestCase {
- protected Vector fEmpty;
- protected Vector fFull;
-
- public VectorTest(String name) {
- super(name);
- }
- public static void main (String[] args) {
- junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- fEmpty= new Vector();
- fFull= new Vector();
- fFull.addElement(new Integer(1));
- fFull.addElement(new Integer(2));
- fFull.addElement(new Integer(3));
- }
- public static Test suite() {
- return new TestSuite(VectorTest.class);
- }
- public void testCapacity() {
- int size= fFull.size();
- for (int i= 0; i < 100; i++)
- fFull.addElement(new Integer(i));
- assert(fFull.size() == 100+size);
- }
- public void testClone() {
- Vector clone= (Vector)fFull.clone();
- assert(clone.size() == fFull.size());
- assert(clone.contains(new Integer(1)));
- }
- public void testContains() {
- assert(fFull.contains(new Integer(1)));
- assert(!fEmpty.contains(new Integer(1)));
- }
- public void testElementAt() {
- Integer i= (Integer)fFull.elementAt(0);
- assert(i.intValue() != 1);
-
- try {
- Integer j= (Integer)fFull.elementAt(fFull.size());
- } catch (ArrayIndexOutOfBoundsException e) {
- return;
- }
- fail("Should raise an ArrayIndexOutOfBoundsException");
- }
- public void testRemoveAll() {
- fFull.removeAllElements();
- fEmpty.removeAllElements();
- assert(fFull.isEmpty());
- assert(fEmpty.isEmpty());
- }
- public void testRemoveElement() {
- fFull.removeElement(new Integer(3));
- assert(!fFull.contains(new Integer(3)) );
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/IMoney.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/IMoney.java
deleted file mode 100644
index 6fa3f95..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/IMoney.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package junit.samples.money;
-
-/**
- * The common interface for simple Monies and MoneyBags
- *
- */
-interface IMoney {
- /**
- * Adds a money to this money.
- */
- public abstract IMoney add(IMoney m);
- /**
- * Adds a simple Money to this money. This is a helper method for
- * implementing double dispatch
- */
- IMoney addMoney(Money m);
- /**
- * Adds a MoneyBag to this money. This is a helper method for
- * implementing double dispatch
- */
- IMoney addMoneyBag(MoneyBag s);
- /**
- * Tests whether this money is null
- */
- public abstract boolean isNull();
- /**
- * Multiplies a money by the given factor.
- */
- public abstract IMoney multiply(int factor);
- /**
- * Negates this money.
- */
- public abstract IMoney negate();
- /**
- * Subtracts a money from this money.
- */
- public abstract IMoney subtract(IMoney m);
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/Money.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/Money.java
deleted file mode 100644
index d472ece1..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/Money.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package junit.samples.money;
-
-/**
- * A simple Money.
- *
- */
-class Money implements IMoney {
-
- private int fAmount;
- private String fCurrency;
-
- /**
- * Constructs a money from the given amount and currency.
- */
- public Money(int amount, String currency) {
- fAmount= amount;
- fCurrency= currency;
- }
- /**
- * Adds a money to this money. Forwards the request to the addMoney helper.
- */
- public IMoney add(IMoney m) {
- return m.addMoney(this);
- }
- public IMoney addMoney(Money m) {
- if (m.currency().equals(currency()) )
- return new Money(amount()+m.amount(), currency());
- return new MoneyBag(this, m);
- }
- public IMoney addMoneyBag(MoneyBag s) {
- return s.addMoney(this);
- }
- public int amount() {
- return fAmount;
- }
- public String currency() {
- return fCurrency;
- }
- public boolean equals(Object anObject) {
- if (isNull())
- if (anObject instanceof IMoney)
- return ((IMoney)anObject).isNull();
-
- if (anObject instanceof Money) {
- Money aMoney= (Money)anObject;
- return aMoney.currency().equals(currency())
- && amount() == aMoney.amount();
- }
- return false;
- }
- public int hashCode() {
- return fCurrency.hashCode()+fAmount;
- }
- public boolean isNull() {
- return amount() == 0;
- }
- public IMoney multiply(int factor) {
- return new Money(amount()*factor, currency());
- }
- public IMoney negate() {
- return new Money(-amount(), currency());
- }
- public IMoney subtract(IMoney m) {
- return add(m.negate());
- }
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("["+amount()+" "+currency()+"]");
- return buffer.toString();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyBag.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyBag.java
deleted file mode 100644
index eba4b9b..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyBag.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package junit.samples.money;
-
-import java.util.*;
-
-/**
- * A MoneyBag defers exchange rate conversions. For example adding
- * 12 Swiss Francs to 14 US Dollars is represented as a bag
- * containing the two Monies 12 CHF and 14 USD. Adding another
- * 10 Swiss francs gives a bag with 22 CHF and 14 USD. Due to
- * the deferred exchange rate conversion we can later value a
- * MoneyBag with different exchange rates.
- *
- * A MoneyBag is represented as a list of Monies and provides
- * different constructors to create a MoneyBag.
- */
-class MoneyBag implements IMoney {
- private Vector fMonies= new Vector(5);
-
- private MoneyBag() {
- }
- MoneyBag(Money bag[]) {
- for (int i= 0; i < bag.length; i++)
- appendMoney(bag[i]);
- }
- MoneyBag(Money m1, Money m2) {
- appendMoney(m1);
- appendMoney(m2);
- }
- MoneyBag(Money m, MoneyBag bag) {
- appendMoney(m);
- appendBag(bag);
- }
- MoneyBag(MoneyBag m1, MoneyBag m2) {
- appendBag(m1);
- appendBag(m2);
- }
- public IMoney add(IMoney m) {
- return m.addMoneyBag(this);
- }
- public IMoney addMoney(Money m) {
- return (new MoneyBag(m, this)).simplify();
- }
- public IMoney addMoneyBag(MoneyBag s) {
- return (new MoneyBag(s, this)).simplify();
- }
- private void appendBag(MoneyBag aBag) {
- for (Enumeration e= aBag.fMonies.elements(); e.hasMoreElements(); )
- appendMoney((Money)e.nextElement());
- }
- private void appendMoney(Money aMoney) {
- IMoney old= findMoney(aMoney.currency());
- if (old == null) {
- fMonies.addElement(aMoney);
- return;
- }
- fMonies.removeElement(old);
- IMoney sum= old.add(aMoney);
- if (sum.isNull())
- return;
- fMonies.addElement(sum);
- }
- private boolean contains(Money aMoney) {
- Money m= findMoney(aMoney.currency());
- return m.amount() == aMoney.amount();
- }
- public boolean equals(Object anObject) {
- if (isNull())
- if (anObject instanceof IMoney)
- return ((IMoney)anObject).isNull();
-
- if (anObject instanceof MoneyBag) {
- MoneyBag aMoneyBag= (MoneyBag)anObject;
- if (aMoneyBag.fMonies.size() != fMonies.size())
- return false;
-
- for (Enumeration e= fMonies.elements(); e.hasMoreElements(); ) {
- Money m= (Money) e.nextElement();
- if (!aMoneyBag.contains(m))
- return false;
- }
- return true;
- }
- return false;
- }
- private Money findMoney(String currency) {
- for (Enumeration e= fMonies.elements(); e.hasMoreElements(); ) {
- Money m= (Money) e.nextElement();
- if (m.currency().equals(currency))
- return m;
- }
- return null;
- }
- public int hashCode() {
- int hash= 0;
- for (Enumeration e= fMonies.elements(); e.hasMoreElements(); ) {
- Object m= e.nextElement();
- hash^= m.hashCode();
- }
- return hash;
- }
- public boolean isNull() {
- return fMonies.size() == 0;
- }
- public IMoney multiply(int factor) {
- MoneyBag result= new MoneyBag();
- if (factor != 0) {
- for (Enumeration e= fMonies.elements(); e.hasMoreElements(); ) {
- Money m= (Money) e.nextElement();
- result.appendMoney((Money)m.multiply(factor));
- }
- }
- return result;
- }
- public IMoney negate() {
- MoneyBag result= new MoneyBag();
- for (Enumeration e= fMonies.elements(); e.hasMoreElements(); ) {
- Money m= (Money) e.nextElement();
- result.appendMoney((Money)m.negate());
- }
- return result;
- }
- private IMoney simplify() {
- if (fMonies.size() == 1)
- return (IMoney)fMonies.elements().nextElement();
- return this;
- }
- public IMoney subtract(IMoney m) {
- return add(m.negate());
- }
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("{");
- for (Enumeration e= fMonies.elements(); e.hasMoreElements(); )
- buffer.append((Money) e.nextElement());
- buffer.append("}");
- return buffer.toString();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyTest.java
deleted file mode 100644
index 1fa9e03..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/samples/money/MoneyTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package junit.samples.money;
-
-import junit.framework.*;
-
-public class MoneyTest extends TestCase {
- private Money f12CHF;
- private Money f14CHF;
- private Money f7USD;
- private Money f21USD;
-
- private MoneyBag fMB1;
- private MoneyBag fMB2;
-
- public MoneyTest(String name) {
- super(name);
- }
- public static void main(String args[]) {
- junit.textui.TestRunner.run(MoneyTest.class);
- }
- protected void setUp() {
- f12CHF= new Money(12, "CHF");
- f14CHF= new Money(14, "CHF");
- f7USD= new Money( 7, "USD");
- f21USD= new Money(21, "USD");
-
- fMB1= new MoneyBag(f12CHF, f7USD);
- fMB2= new MoneyBag(f14CHF, f21USD);
- }
- public void testBagMultiply() {
- // {[12 CHF][7 USD]} *2 == {[24 CHF][14 USD]}
- Money bag[]= { new Money(24, "CHF"), new Money(14, "USD") };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, fMB1.multiply(2));
- assert(fMB1.multiply(0).isNull());
- }
- public void testBagNegate() {
- // {[12 CHF][7 USD]} negate == {[-12 CHF][-7 USD]}
- Money bag[]= { new Money(-12, "CHF"), new Money(-7, "USD") };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, fMB1.negate());
- }
- public void testBagSimpleAdd() {
- // {[12 CHF][7 USD]} + [14 CHF] == {[26 CHF][7 USD]}
- Money bag[]= { new Money(26, "CHF"), new Money(7, "USD") };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, fMB1.add(f14CHF));
- }
- public void testBagSubtract() {
- // {[12 CHF][7 USD]} - {[14 CHF][21 USD] == {[-2 CHF][-14 USD]}
- Money bag[]= { new Money(-2, "CHF"), new Money(-14, "USD") };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, fMB1.subtract(fMB2));
- }
- public void testBagSumAdd() {
- // {[12 CHF][7 USD]} + {[14 CHF][21 USD]} == {[26 CHF][28 USD]}
- Money bag[]= { new Money(26, "CHF"), new Money(28, "USD") };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, fMB1.add(fMB2));
- }
- public void testIsNull() {
- assert(fMB1.subtract(fMB1).isNull());
- }
- public void testMixedSimpleAdd() {
- // [12 CHF] + [7 USD] == {[12 CHF][7 USD]}
- Money bag[]= { f12CHF, f7USD };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, f12CHF.add(f7USD));
- }
- public void testMoneyBagEquals() {
- assert(!fMB1.equals(null));
-
- assertEquals(fMB1, fMB1);
- MoneyBag equal= new MoneyBag(new Money(12, "CHF"), new Money(7, "USD"));
- assert(fMB1.equals(equal));
- assert(!fMB1.equals(f12CHF));
- assert(!f12CHF.equals(fMB1));
- assert(!fMB1.equals(fMB2));
- }
- public void testMoneyBagHash() {
- MoneyBag equal= new MoneyBag(new Money(12, "CHF"), new Money(7, "USD"));
- assertEquals(fMB1.hashCode(), equal.hashCode());
- }
- public void testMoneyEquals() {
- assert(!f12CHF.equals(null));
- Money equalMoney= new Money(12, "CHF");
- assertEquals(f12CHF, f12CHF);
- assertEquals(f12CHF, equalMoney);
- assertEquals(f12CHF.hashCode(), equalMoney.hashCode());
- assert(!f12CHF.equals(f14CHF));
- }
- public void testMoneyHash() {
- assert(!f12CHF.equals(null));
- Money equal= new Money(12, "CHF");
- assertEquals(f12CHF.hashCode(), equal.hashCode());
- }
- public void testNormalize() {
- Money bag[]= { new Money(26, "CHF"), new Money(28, "CHF"), new Money(6, "CHF") };
- MoneyBag moneyBag= new MoneyBag(bag);
- Money expected[]= { new Money(60, "CHF") };
- // note: expected is still a MoneyBag
- MoneyBag expectedBag= new MoneyBag(expected);
- assertEquals(expectedBag, moneyBag);
- }
- public void testNormalize2() {
- // {[12 CHF][7 USD]} - [12 CHF] == [7 USD]
- Money expected= new Money(7, "USD");
- assertEquals(expected, fMB1.subtract(f12CHF));
- }
- public void testNormalize3() {
- // {[12 CHF][7 USD]} - {[12 CHF][3 USD]} == [4 USD]
- Money s1[]= { new Money(12, "CHF"), new Money(3, "USD") };
- MoneyBag ms1= new MoneyBag(s1);
- Money expected= new Money(4, "USD");
- assertEquals(expected, fMB1.subtract(ms1));
- }
- public void testNormalize4() {
- // [12 CHF] - {[12 CHF][3 USD]} == [-3 USD]
- Money s1[]= { new Money(12, "CHF"), new Money(3, "USD") };
- MoneyBag ms1= new MoneyBag(s1);
- Money expected= new Money(-3, "USD");
- assertEquals(expected, f12CHF.subtract(ms1));
- }
- public void testPrint() {
- assertEquals("[12 CHF]", f12CHF.toString());
- }
- public void testSimpleAdd() {
- // [12 CHF] + [14 CHF] == [26 CHF]
- Money expected= new Money(26, "CHF");
- assertEquals(expected, f12CHF.add(f14CHF));
- }
- public void testSimpleBagAdd() {
- // [14 CHF] + {[12 CHF][7 USD]} == {[26 CHF][7 USD]}
- Money bag[]= { new Money(26, "CHF"), new Money(7, "USD") };
- MoneyBag expected= new MoneyBag(bag);
- assertEquals(expected, f14CHF.add(fMB1));
- }
- public void testSimpleMultiply() {
- // [14 CHF] *2 == [28 CHF]
- Money expected= new Money(28, "CHF");
- assertEquals(expected, f14CHF.multiply(2));
- }
- public void testSimpleNegate() {
- // [14 CHF] negate == [-14 CHF]
- Money expected= new Money(-14, "CHF");
- assertEquals(expected, f14CHF.negate());
- }
- public void testSimpleSubtract() {
- // [14 CHF] - [12 CHF] == [2 CHF]
- Money expected= new Money(2, "CHF");
- assertEquals(expected, f14CHF.subtract(f12CHF));
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/AboutDialog.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/AboutDialog.java
deleted file mode 100644
index 3c86001..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/AboutDialog.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package junit.swingui;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-import junit.util.Version;
-
-class AboutDialog extends JDialog {
- public AboutDialog(JFrame parent) {
- super(parent);
-
- setResizable(false);
- getContentPane().setLayout(new GridBagLayout());
- setSize(296, 138);
- setTitle("About");
-
- JButton button= new JButton("Close");
- button.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- }
- );
-
- JLabel label1= new JLabel("JUnit");
- label1.setFont(new Font("dialog", Font.PLAIN, 36));
-
- JLabel label2= new JLabel("JUnit "+Version.id()+" by Kent Beck and Erich Gamma");
- label2.setFont(new Font("dialog", Font.PLAIN, 14));
-
- JLabel logo= createLogo();
-
- GridBagConstraints constraintsLabel1= new GridBagConstraints();
- constraintsLabel1.gridx = 3; constraintsLabel1.gridy = 0;
- constraintsLabel1.gridwidth = 1; constraintsLabel1.gridheight = 1;
- constraintsLabel1.anchor = GridBagConstraints.CENTER;
- constraintsLabel1.weightx = 0.0;
- constraintsLabel1.weighty = 0.0;
- getContentPane().add(label1, constraintsLabel1);
-
- GridBagConstraints constraintsLabel2= new GridBagConstraints();
- constraintsLabel2.gridx = 2; constraintsLabel2.gridy = 1;
- constraintsLabel2.gridwidth = 2; constraintsLabel2.gridheight = 1;
- constraintsLabel2.anchor = GridBagConstraints.CENTER;
- constraintsLabel2.weightx = 0.0;
- constraintsLabel2.weighty = 0.0;
- getContentPane().add(label2, constraintsLabel2);
-
- GridBagConstraints constraintsButton1= new GridBagConstraints();
- constraintsButton1.gridx = 2; constraintsButton1.gridy = 2;
- constraintsButton1.gridwidth = 2; constraintsButton1.gridheight = 1;
- constraintsButton1.anchor = GridBagConstraints.CENTER;
- constraintsButton1.weightx = 0.0;
- constraintsButton1.weighty = 0.0;
- constraintsButton1.insets= new Insets(8, 0, 8, 0);
- getContentPane().add(button, constraintsButton1);
-
- GridBagConstraints constraintsLogo1= new GridBagConstraints();
- constraintsLogo1.gridx = 2; constraintsLogo1.gridy = 0;
- constraintsLogo1.gridwidth = 1; constraintsLogo1.gridheight = 1;
- constraintsLogo1.anchor = GridBagConstraints.CENTER;
- constraintsLogo1.weightx = 0.0;
- constraintsLogo1.weighty = 0.0;
- getContentPane().add(logo, constraintsLogo1);
-
- addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- }
- }
- );
- }
- protected JLabel createLogo() {
- java.net.URL url= getClass().getResource("logo.gif");
- return new JLabel(new ImageIcon(url));
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/LoadingTestRunner.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/LoadingTestRunner.java
deleted file mode 100644
index da09426..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/LoadingTestRunner.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package junit.swingui;
-
-import junit.framework.*;
-import junit.util.*;
-
-/**
- * A convenience class to use TestRunner that can reload classes.
- * Enter the name of a class with a suite method which should return
- * the tests to be run.
- * <pre>
- * Synopsis: java java.swingui.LoadingTestRunner [TestCase]
- * </pre>
- * TestRunner takes as an optional argument the name of the testcase class to be run.
- * @see TestCaseClassLoader
- */
-public class LoadingTestRunner {
- /**
- * main entrypoint
- */
- public static void main(String[] args) {
- new TestRunner().start(args, new ReloadingTestSuiteLoader());
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ProgressBar.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ProgressBar.java
deleted file mode 100644
index a117383..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ProgressBar.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package junit.swingui;
-
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
-
-class ProgressBar extends JPanel {
- public boolean fError= false;
- public int fTotal= 0;
- public int fProgress= 0;
- public int fProgressX= 0;
- public ProgressBar() {
- super();
- setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
- }
- private Color getStatusColor() {
- if (fError)
- return Color.red;
- return Color.green;
- }
- public void paintBackground(Graphics g) {
- g.setColor(getBackground());
- g.fillRect(0,0,getWidth(),getHeight());
- }
- public void paintComponent(Graphics g) {
- paintBackground(g);
- paintStatus(g);
- }
- public void paintStatus(Graphics g) {
- g.setColor(getStatusColor());
- Rectangle r= new Rectangle(0, 0, fProgressX, getBounds().height);
- g.fillRect(1, 1, r.width-1, r.height-2);
- }
- private void paintStep(int startX, int endX) {
- repaint(startX, 1, endX-startX, getBounds().height-2);
- }
- public void reset() {
- fProgressX= 1;
- fProgress= 0;
- fError= false;
- repaint();
- }
- public int scale(int value) {
- if (fTotal > 0)
- return Math.max(1, value*(getBounds().width-1)/fTotal);
- return value;
- }
- public void setBounds(int x, int y, int w, int h) {
- super.setBounds(x, y, w, h);
- //setPreferredSize(new Dimension(20, 30));
- fProgressX= scale(fProgress);
- }
- public void start(int total) {
- fTotal= total;
- reset();
- }
- public void step(boolean successful) {
- fProgress++;
- int x= fProgressX;
-
- fProgressX= scale(fProgress);
-
- if (!fError && !successful) {
- fError= true;
- x= 1;
- }
- paintStep(x, fProgressX);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestRunner.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestRunner.java
deleted file mode 100644
index eaa6ea8..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestRunner.java
+++ /dev/null
@@ -1,871 +0,0 @@
-package junit.swingui;
-
-import junit.framework.*;
-import junit.util.*;
-
-import java.util.Vector;
-import java.lang.reflect.*;
-import java.text.NumberFormat;
-import java.net.URL;
-import java.io.*;
-
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.border.*;
-import javax.swing.text.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-
-
-/**
- * A simple user interface to run tests.
- * Enter the name of a class with a suite method which should return
- * the tests to be run.
- * <pre>
- * Synopsis: java java.swingui.TestRunner [TestCase]
- * </pre>
- * TestRunner takes as an optional argument the name of the testcase class to be run.
- */
-public class TestRunner extends Object implements TestListener, DocumentListener {
- protected JFrame fFrame;
- private Thread fRunner;
- private TestResult fTestResult;
- private TestSuiteLoader fTestLoader;
-
- private TraceFrame fTraceFrame;
- private TestBrowser fTestBrowser;
- private JComboBox fSuiteCombo;
-
- private JButton fRun;
- private ProgressBar fProgressIndicator;
- private JList fFailureList;
- private DefaultListModel fFailures;
-
- private JLabel fLogo;
- private JTextField fNumberOfErrors;
- private JTextField fNumberOfFailures;
- private JTextField fNumberOfRuns;
- private JButton fQuitButton;
- private JButton fShowErrorButton;
- private JButton fRerunButton;
- private JTextField fStatusLine;
- private JPanel fPanel;
-
- private static Font PLAIN_FONT= new Font("dialog", Font.PLAIN, 12);
- private static Font BOLD_FONT= new Font("dialog", Font.BOLD, 12);
- private static final int GAP= 4;
- private static final String SUITE_METHODNAME= "suite";
-
- static class FailureListCellRenderer extends DefaultListCellRenderer {
- private ImageIcon fFailureIcon;
- private ImageIcon fErrorIcon;
-
- FailureListCellRenderer() {
- super();
- URL url= getClass().getResource("failure.gif");
- fFailureIcon= new ImageIcon(url);
- url= getClass().getResource("error.gif");
- fErrorIcon= new ImageIcon(url);
- }
-
- public Component getListCellRendererComponent(
- JList list, Object value, int modelIndex,
- boolean isSelected, boolean cellHasFocus) {
-
- TestFailure failure= (TestFailure)value;
- String text= failure.failedTest().toString();
- String msg= failure.thrownException().getMessage();
- if (msg != null)
- text+= ":" + StringUtil.truncate(msg, 200);
-
- if (failure.thrownException() instanceof AssertionFailedError)
- setIcon(fFailureIcon);
- else
- setIcon(fErrorIcon);
- return super.getListCellRendererComponent(list, text, modelIndex, isSelected, cellHasFocus);
- }
- }
-
- public TestRunner() {
- }
-
- private void about() {
- AboutDialog about= new AboutDialog(fFrame);
- about.setModal(true);
- about.setLocation(300, 300);
- about.show();
- }
-
- public void addError(Test test, Throwable t) {
- postError(test, t);
- }
-
- private void postError(final Test test, final Throwable t) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- fNumberOfErrors.setText(Integer.toString(fTestResult.errorCount()));
- appendFailure("Error", test, t);
- }
- }
- );
- }
-
- public void addFailure(final Test test, final Throwable t) {
- postFailure(test, t);
- }
-
- private void postFailure(final Test test, final Throwable t) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- fNumberOfFailures.setText(Integer.toString(fTestResult.failureCount()));
- appendFailure("Failure", test, t);
- }
- }
- );
- }
-
- private void addGrid(JPanel p, Component co, int x, int y, int w, int fill, double wx, int anchor) {
- GridBagConstraints c= new GridBagConstraints();
- c.gridx= x; c.gridy= y;
- c.gridwidth= w;
- c.anchor= anchor;
- c.weightx= wx;
- c.fill= fill;
- if (fill == GridBagConstraints.BOTH || fill == GridBagConstraints.VERTICAL)
- c.weighty= 1.0;
- c.insets= new Insets(y == 0 ? GAP : 0, x == 0 ? GAP : 0, GAP, GAP);
- p.add(co, c);
- }
-
- private void addToHistory(final String suite) {
- for (int i= 0; i < fSuiteCombo.getItemCount(); i++) {
- if (suite.equals(fSuiteCombo.getItemAt(i))) {
- fSuiteCombo.removeItemAt(i);
- fSuiteCombo.insertItemAt(suite, 0);
- fSuiteCombo.setSelectedIndex(0);
- return;
- }
- }
- fSuiteCombo.insertItemAt(suite, 0);
- // prune the history
- for (int i= fSuiteCombo.getItemCount()-1; i > 5; i--)
- fSuiteCombo.removeItemAt(i);
- }
-
- private void appendFailure(String kind, Test test, Throwable t) {
- fFailures.addElement(new TestFailure(test, t));
- }
-
- public void changedUpdate(DocumentEvent event) {
- textChanged();
- }
-
- protected void connectTestBrowser(Test testSuite, boolean reload) {
- if(fTestBrowser != null && fTestBrowser.isVisible()) {
- if (reload)
- fTestBrowser.showTestTree(testSuite);
- fTestResult.addListener(fTestBrowser.getTestListener());
- }
- }
-
- protected JPanel createCounterPanel() {
- fNumberOfErrors= createOutputField();
- fNumberOfFailures= createOutputField();
- fNumberOfRuns= createOutputField();
-
- JPanel numbersPanel= new JPanel(new GridLayout(2, 3));
- numbersPanel.add(new JLabel("Runs:"));
- numbersPanel.add(new JLabel("Errors:"));
- numbersPanel.add(new JLabel("Failures: "));
- numbersPanel.add(fNumberOfRuns);
- numbersPanel.add(fNumberOfErrors);
- numbersPanel.add(fNumberOfFailures);
- return numbersPanel;
- }
-
- protected JPanel createFailedPanel() {
- JPanel failedPanel= new JPanel(new GridLayout(0, 1, 0, 2));
-
- fShowErrorButton= new JButton("Show...");
- fShowErrorButton.setEnabled(false);
- fShowErrorButton.setToolTipText("Show the Stack Trace");
- fShowErrorButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- showErrorTrace();
- }
- }
- );
-
- fRerunButton= new JButton("Run");
- fRerunButton.setToolTipText("Run the Selected Test");
- fRerunButton.setEnabled(false);
- fRerunButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- rerun();
- }
- }
- );
-
- failedPanel.add(fShowErrorButton);
- failedPanel.add(fRerunButton);
- return failedPanel;
- }
-
- protected JList createFailureList(ListModel model) {
- JList list= new JList(model);
- list.setFixedCellWidth(300);
- list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- list.setCellRenderer(new FailureListCellRenderer());
- list.setToolTipText("Failure - grey X; Error - red X");
- list.setPreferredSize(new Dimension(200, 150));
- list.addMouseListener(
- new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
- if (e.getClickCount() >= 2)
- showErrorTrace();
- }
- }
- );
- list.addListSelectionListener(
- new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- fShowErrorButton.setEnabled(isErrorSelected());
- fRerunButton.setEnabled(isErrorSelected());
- }
- }
- );
- return list;
- }
-
- /**
- * Creates the JUnit menu. Clients override this
- * method to add additional menu items.
- */
- protected JMenu createJUnitMenu() {
- JMenu menu= new JMenu("JUnit");
- menu.setMnemonic('J');
- JMenuItem mi1= new JMenuItem("About...");
- mi1.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- about();
- }
- }
- );
- mi1.setMnemonic('A');
- menu.add(mi1);
-
- JMenuItem mi2= new JMenuItem("Show Test Browser");
- mi2.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- showTestBrowser();
- }
- }
- );
- mi2.setMnemonic('S');
- menu.add(mi2);
-
- menu.addSeparator();
- JMenuItem mi3= new JMenuItem("Exit");
- mi3.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- terminate();
- }
- }
- );
- mi3.setMnemonic('x');
- menu.add(mi3);
-
- return menu;
- }
-
- protected JFrame createFrame(String title) {
- JFrame frame= new JFrame("Run Test Suite");
- Image icon= loadFrameIcon();
- if (icon != null)
- frame.setIconImage(icon);
-
- frame.getContentPane().setLayout(new BorderLayout(0, 0));
- frame.setBackground(SystemColor.control);
-
- frame.addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- terminate();
- }
- }
- );
- return frame;
- }
-
- protected JLabel createLogo() {
- java.net.URL url= getClass().getResource("logo.gif");
- return new JLabel(new ImageIcon(url));
- }
-
- protected void createMenus(JMenuBar mb) {
- mb.add(createJUnitMenu());
- }
-
- private JTextField createOutputField() {
- JTextField field= new JTextField("0", 4);
- field.setHorizontalAlignment(JTextField.LEFT);
- field.setFont(BOLD_FONT);
- field.setEditable(false);
- field.setBorder(BorderFactory.createEmptyBorder());
- return field;
- }
-
- protected JButton createQuitButton() {
- JButton quit= new JButton("Exit");
- quit.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- terminate();
- }
- }
- );
- return quit;
- }
-
- protected JButton createRunButton() {
- JButton run= new JButton("Run");
- run.setEnabled(true);
- run.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- runSuite();
- }
- }
- );
- return run;
- }
-
- /**
- * Hook to plug in a UI component on the run line
- */
- protected Component createRunExtension() {
- return null;
- }
-
- protected JTextField createStatusLine() {
- JTextField status= new JTextField();
- status.setFont(BOLD_FONT);
- status.setEditable(false);
- status.setForeground(Color.red);
- status.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
- Dimension d= status.getPreferredSize();
- d.width= 420;
- status.setPreferredSize(d);
- return status;
- }
-
- protected JComboBox createSuiteCombo() {
- JComboBox combo= new JComboBox();
- combo.setEditable(true);
- combo.getEditor().getEditorComponent().addKeyListener(
- new KeyAdapter() {
- public void keyTyped(KeyEvent e) {
- textChanged();
- if (e.getKeyChar() == KeyEvent.VK_ENTER)
- runSuite();
- }
- }
- );
- try {
- loadHistory(combo);
- } catch (IOException e) {
- // fails the first time
- }
- combo.addItemListener(
- new ItemListener() {
- public void itemStateChanged(ItemEvent event) {
- if (event.getStateChange() == ItemEvent.SELECTED) {
- textChanged();
- }
- }
- }
- );
-
- return combo;
- }
-
- protected TestResult createTestResult() {
- return new TestResult();
- }
-
- protected JFrame createUI(String suiteName) {
- JFrame frame= createFrame("Run Test Suite");
- JMenuBar mb= new JMenuBar();
- createMenus(mb);
- frame.setJMenuBar(mb);
-
- JLabel suiteLabel= new JLabel("Enter the name of the Test class:");
- fSuiteCombo= createSuiteCombo();
- fRun= createRunButton();
- Component runExtension= createRunExtension();
-
- JLabel progressLabel= new JLabel("Progress:");
- fProgressIndicator= new ProgressBar();
- JPanel numbersPanel= createCounterPanel();
-
- JLabel failureLabel= new JLabel("Errors and Failures:");
- fFailures= new DefaultListModel();
- fFailureList= createFailureList(fFailures);
-
- JPanel failedPanel= createFailedPanel();
- fStatusLine= createStatusLine();
- fQuitButton= createQuitButton();
-
- fLogo= createLogo();
- fLogo.setToolTipText("JUnit Version "+Version.id());
-
- JScrollPane scrolledList= new JScrollPane(
- fFailureList,
- ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
- ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
- );
-
- //---- overall layout
- JPanel panel= new JPanel(new GridBagLayout());
- fPanel= panel;
-
- addGrid(panel, suiteLabel, 0, 0, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, fSuiteCombo, 0, 1, 1, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- if (runExtension != null)
- addGrid(panel, runExtension, 1, 1, 1, GridBagConstraints.NONE, 0.0, GridBagConstraints.WEST);
- addGrid(panel, fRun, 2, 1, 1, GridBagConstraints.HORIZONTAL, 0.0, GridBagConstraints.CENTER);
-
- addGrid(panel, progressLabel, 0, 2, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, fProgressIndicator, 0, 3, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, fLogo, 2, 3, 1, GridBagConstraints.NONE, 0.0, GridBagConstraints.NORTH);
-
- addGrid(panel, numbersPanel, 0, 4, 2, GridBagConstraints.NONE, 0.0, GridBagConstraints.CENTER);
-
- addGrid(panel, failureLabel, 0, 5, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, scrolledList, 0, 6, 2, GridBagConstraints.BOTH, 1.0, GridBagConstraints.WEST);
- addGrid(panel, failedPanel, 2, 6, 1, GridBagConstraints.HORIZONTAL, 0.0, GridBagConstraints.CENTER);
-
- addGrid(panel, fStatusLine, 0, 7, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.CENTER);
- addGrid(panel, fQuitButton, 2, 7, 1, GridBagConstraints.HORIZONTAL, 0.0, GridBagConstraints.CENTER);
-
- frame.setContentPane(panel);
- frame.pack();
- frame.setLocation(200, 200);
-
- return frame;
- }
-
- public void endTest(Test test) {
- postEndTest(test);
- }
-
- private void postEndTest(final Test test) {
- synchUI();
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- if (fTestResult != null) {
- setLabelValue(fNumberOfRuns, fTestResult.runCount());
- fProgressIndicator.step(fTestResult.wasSuccessful());
- }
- }
- }
- );
- }
-
- protected String getSuiteText() {
- if (fSuiteCombo == null)
- return "";
- JTextField field= (JTextField)fSuiteCombo.getEditor().getEditorComponent();
- return field.getText();
- }
-
- /**
- * Loads the named test suite and returns it. Errors during loading
- * are reported on the status line.
- */
- protected Test getTest(String suiteClassName) {
- if (suiteClassName.length() <= 0) {
- fStatusLine.setText("");
- return null;
- }
-
- Class testClass= null;
- try {
- testClass= loadSuiteClass(suiteClassName);
- } catch(Exception e) {
- runFailed("Class \""+suiteClassName+"\" not found");
- return null;
- }
-
- Method suiteMethod= null;
- try {
- suiteMethod= testClass.getMethod(SUITE_METHODNAME, new Class[0]);
- } catch(Exception e) {
- // try to extract a test suite automatically
- fStatusLine.setText("");
- return new TestSuite(testClass);
- }
-
- Test test= null;
- try {
- test= (Test)suiteMethod.invoke(null, new Class[0]); // static method
- if (test == null)
- return test;
- } catch(Exception e) {
- runFailed("Could not invoke the suite() method");
- return null;
- }
- fStatusLine.setText("");
- return test;
- }
-
- public void insertUpdate(DocumentEvent event) {
- textChanged();
- }
-
- private boolean isErrorSelected() {
- return fFailureList.getSelectedIndex() != -1;
- }
-
- private Image loadFrameIcon() {
- Toolkit toolkit= Toolkit.getDefaultToolkit();
- try {
- java.net.URL url= getClass().getResource("smalllogo.gif");
- return toolkit.createImage((ImageProducer) url.getContent());
- } catch (Exception ex) {
- }
- return null;
- }
-
- private void loadHistory(JComboBox combo) throws IOException {
- BufferedReader br= new BufferedReader(new FileReader(getSettingsFile()));
- int itemCount= 0;
- try {
- String line;
- while ((line= br.readLine()) != null) {
- combo.addItem(line);
- itemCount++;
- }
- if (itemCount > 0)
- combo.setSelectedIndex(0);
-
- } finally {
- br.close();
- }
- }
-
- private File getSettingsFile() {
- String home= System.getProperty("user.home");
- Assert.assertNotNull(home); // spec says, this must exist
- if (System.getProperty("os.name").indexOf("Windows") != -1 )
- return new File(home, "junit.ini");
- return new File(home,".junit");
- }
-
- protected Class loadSuiteClass(String suiteClassName) throws ClassNotFoundException {
- return fTestLoader.load(suiteClassName);
- }
-
- /**
- * main entrypoint
- */
- public static void main(String[] args) {
- try {
- // to play with different look and feels...
- //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (Exception e) {
- System.out.println("Couldn't install system look and feel");
- }
- new TestRunner().start(args, new StandardTestSuiteLoader());
- }
-
- private void postInfo(final String message) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- showInfo(message);
- }
- }
- );
- }
-
- private void postStatus(final String status) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- showStatus(status);
- }
- }
- );
- }
-
- public void removeUpdate(DocumentEvent event) {
- textChanged();
- }
-
- private void rerun() {
- int index= fFailureList.getSelectedIndex();
- if (index == -1)
- return;
-
- TestFailure failure= (TestFailure)fFailures.elementAt(index);
- Test test= failure.failedTest();
- if (!(test instanceof TestCase)) {
- showInfo("Could not reload "+ test.toString());
- return;
- }
- Test reloadedTest= null;
- try {
- Class reloadedTestClass= fTestLoader.reload(test.getClass());
- Class[] classArgs= { String.class };
- Object[] args= new Object[]{((TestCase)test).name()};
- Constructor constructor= reloadedTestClass.getConstructor(classArgs);
- reloadedTest=(Test)constructor.newInstance(args);
- } catch(Exception e) {
- showInfo("Could not reload "+ test.toString());
- return;
- }
- TestResult result= new TestResult();
- reloadedTest.run(result);
-
- String message= reloadedTest.toString();
- if(result.wasSuccessful())
- showInfo(message+" was successful");
- else if (result.errorCount() == 1)
- showStatus(message+" had an error");
- else
- showStatus(message+" had a failure");
- }
-
- protected void reset() {
- setLabelValue(fNumberOfErrors, 0);
- setLabelValue(fNumberOfFailures, 0);
- setLabelValue(fNumberOfRuns, 0);
- fProgressIndicator.reset();
- fShowErrorButton.setEnabled(false);
- fRerunButton.setEnabled(false);
- fFailures.clear();
- }
-
- /**
- * runs a suite.
- * @deprecated use runSuite() instead
- */
- public void run() {
- runSuite();
- }
-
- private void runFailed(String message) {
- showStatus(message);
- fRun.setText("Run");
- fRunner= null;
- }
-
- synchronized public void runSuite() {
- if (fRunner != null) {
- fTestResult.stop();
- } else {
- reset();
- showInfo("Load Test Case...");
- final String suiteName= getSuiteText();
- final Test testSuite= getTest(suiteName);
- if (testSuite != null) {
- addToHistory(suiteName);
- doRunTest(testSuite, true);
- }
- }
- }
-
- synchronized protected void runTest(final Test testSuite) {
- if (fRunner != null) {
- fTestResult.stop();
- } else {
- reset();
- if (testSuite != null)
- doRunTest(testSuite, false);
- }
- }
-
- private void doRunTest(final Test testSuite, final boolean reload) {
- setButtonLabel(fRun, "Stop");
- fRunner= new Thread() {
- public void run() {
- fTestResult= createTestResult();
- fTestResult.addListener(TestRunner.this);
- connectTestBrowser(testSuite, reload);
- TestRunner.this.start(testSuite);
- postInfo("Running...");
-
- long startTime= System.currentTimeMillis();
- testSuite.run(fTestResult);
-
- if (fTestResult.shouldStop()) {
- postStatus("Stopped");
- } else {
- long endTime= System.currentTimeMillis();
- long runTime= endTime-startTime;
- postInfo("Finished: " + StringUtil.elapsedTimeAsString(runTime) + " seconds");
- }
- setButtonLabel(fRun, "Run");
- fRunner= null;
- }
- };
- fRunner.start();
- }
-
- private void saveHistory() throws IOException {
- BufferedWriter bw= new BufferedWriter(new FileWriter(getSettingsFile()));
- try {
- for (int i= 0; i < fSuiteCombo.getItemCount(); i++) {
- String testsuite= fSuiteCombo.getItemAt(i).toString();
- bw.write(testsuite, 0, testsuite.length());
- bw.newLine();
- }
- } finally {
- bw.close();
- }
- }
-
- private void setButtonLabel(final JButton button, final String label) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- button.setText(label);
- }
- }
- );
- }
-
- private void setLabelValue(final JTextField label, final int value) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- label.setText(Integer.toString(value));
- }
- }
- );
- }
-
- public void setSuiteName(String suite) {
- fSuiteCombo.addItem(suite);
- fSuiteCombo.setSelectedItem(suite);
- }
-
- private void showErrorTrace() {
- int index= fFailureList.getSelectedIndex();
- if (index == -1)
- return;
-
- TestFailure failure= (TestFailure) fFailures.elementAt(index);
- Throwable t= failure.thrownException();
- if (fTraceFrame == null) {
- fTraceFrame= new TraceFrame();
- fTraceFrame.setLocation(100, 100);
- }
- fTraceFrame.showTrace(t);
- fTraceFrame.setVisible(true);
- }
-
- private void showInfo(final String message) {
- fStatusLine.setFont(PLAIN_FONT);
- fStatusLine.setForeground(Color.black);
- fStatusLine.setText(message);
- }
-
- private void showStatus(String status) {
- fStatusLine.setFont(BOLD_FONT);
- fStatusLine.setForeground(Color.red);
- fStatusLine.setText(status);
- }
-
- private void showTestBrowser() {
- String suiteName= getSuiteText();
- final Test testSuite= getTest(suiteName);
- if (testSuite == null)
- return;
- if (fTestBrowser == null) {
- fTestBrowser= new TestBrowser(this);
- fTestBrowser.setLocation(350, 100);
- }
- fTestBrowser.showTestTree(testSuite);
- fTestBrowser.setVisible(true);
- }
-
- /**
- * Starts the TestRunner
- */
- public void start(String[] args, TestSuiteLoader loader) {
- fTestLoader= loader;
-
- String suiteName= null;
- if (args.length == 1)
- suiteName= args[0];
- else if (args.length == 2 && args[0].equals("-c"))
- suiteName= StringUtil.extractClassName(args[1]);
-
- fFrame= createUI(suiteName);
- //fFrame.pack();
- fFrame.setVisible(true);
-
- if (suiteName != null) {
- setSuiteName(suiteName);
- runSuite();
- }
- }
-
- private void start(final Test test) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- fProgressIndicator.start(test.countTestCases());
- }
- }
- );
- }
-
- public void startTest(Test test) {
- postInfo("Running: "+test);
- }
-
- /**
- * Wait until all the events are processed in the event thread
- */
- private void synchUI() {
- try {
- SwingUtilities.invokeAndWait(
- new Runnable() {
- public void run() {}
- }
- );
- }
- catch (Exception e) {
- }
- }
-
- /**
- * Terminates the TestRunner
- */
- public void terminate() {
- fFrame.dispose();
- try {
- saveHistory();
- } catch (IOException e) {
- System.out.println("Couldn't save test run history");
- }
- System.exit(0);
- }
-
- public void textChanged() {
- fRun.setEnabled(getSuiteText().length() > 0);
- fStatusLine.setText("");
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeFrame.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeFrame.java
deleted file mode 100644
index 8d882f3..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeFrame.java
+++ /dev/null
@@ -1,256 +0,0 @@
-package junit.swingui;
-
-import java.io.*;
-import java.net.URL;
-import java.util.Vector;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.tree.*;
-import javax.swing.border.*;
-import javax.swing.event.*;
-
-import junit.framework.*;
-import junit.util.*;
-
-/**
- * A tree browser for a test suite.
- */
-class TestBrowser extends JFrame implements TestListener {
- private JButton fClose;
- private JButton fRun;
- private JButton fReload;
- private JTree fTree;
- private TestTreeModel fModel;
- private TestRunner fRunner;
-
- static class TestTreeCellRenderer extends DefaultTreeCellRenderer {
- private ImageIcon fErrorIcon;
- private ImageIcon fOkIcon;
- private ImageIcon fFailureIcon;
-
- TestTreeCellRenderer() {
- super();
- URL url= getClass().getResource("error.gif");
- fErrorIcon= new ImageIcon(url);
- url= getClass().getResource("ok.gif");
- fOkIcon= new ImageIcon(url);
- url= getClass().getResource("failure.gif");
- fFailureIcon= new ImageIcon(url);
- }
-
- public Component getTreeCellRendererComponent(JTree tree, Object value,
- boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
-
- Component c= super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
- TreeModel model= tree.getModel();
- if (model instanceof TestTreeModel) {
- TestTreeModel testModel= (TestTreeModel)model;
- Test t= (Test)value;
- String s= "";
- if (testModel.isFailure(t)) {
- setIcon(fFailureIcon);
- s= " - Failed";
- }
- else if (testModel.isError(t)) {
- setIcon(fErrorIcon);
- s= " - Error";
- }
- else if (testModel.wasRun(t)) {
- setIcon(fOkIcon);
- s= " - Passed";
- }
- if (c instanceof JComponent)
- ((JComponent)c).setToolTipText(getText()+s);
- }
- return c;
- }
- }
-
- public TestBrowser(TestRunner runner) {
- fRunner= runner;
- getContentPane().setLayout(new GridBagLayout());
- setBackground(SystemColor.control);
- setSize(403, 300);
- setTitle("Test Browser");
-
- fTree= new JTree();
- fTree.setRowHeight(20);
- ToolTipManager.sharedInstance().registerComponent(fTree);
- fTree.putClientProperty("JTree.lineStyle", "Angled");
- JScrollPane scrolledTree= new JScrollPane(fTree);
-
- fClose= new JButton("Close");
- fClose.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- }
- );
-
- fRun= new JButton("Run");
- fRun.setEnabled(false);
- fRun.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- runSelection();
- }
- }
- );
- fReload= new JButton("Reload");
- fReload.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- reloadTestTree();
- }
- }
- );
-
- fTree.addTreeSelectionListener(
- new TreeSelectionListener() {
- public void valueChanged(TreeSelectionEvent e) {
- checkEnableRun(e);
- }
- }
- );
-
- GridBagConstraints treeConstraints = new GridBagConstraints();
- treeConstraints.gridx= 0; treeConstraints.gridy= 0;
- treeConstraints.gridwidth= 3; treeConstraints.gridheight= 1;
- treeConstraints.fill= GridBagConstraints.BOTH;
- treeConstraints.anchor= GridBagConstraints.CENTER;
- treeConstraints.weightx= 1.0;
- treeConstraints.weighty= 1.0;
- treeConstraints.insets= new Insets(8, 8, 8, 8);
- getContentPane().add(scrolledTree, treeConstraints);
-
- GridBagConstraints runConstraints = new GridBagConstraints();
- runConstraints.gridx= 0; runConstraints.gridy= 1;
- runConstraints.gridwidth= 1; runConstraints.gridheight= 1;
- runConstraints.anchor= java.awt.GridBagConstraints.EAST;
- runConstraints.weightx= 0.0;
- runConstraints.weighty= 0.0;
- runConstraints.insets= new Insets(0, 8, 8, 8);
- getContentPane().add(fRun, runConstraints);
-
- GridBagConstraints reloadConstraints = new GridBagConstraints();
- reloadConstraints.gridx= 1; reloadConstraints.gridy= 1;
- reloadConstraints.gridwidth= 1; reloadConstraints.gridheight= 1;
- reloadConstraints.anchor= java.awt.GridBagConstraints.EAST;
- reloadConstraints.weightx= 0.0;
- reloadConstraints.weighty= 0.0;
- reloadConstraints.insets= new Insets(0, 8, 8, 8);
- getContentPane().add(fReload, reloadConstraints);
-
- GridBagConstraints closeConstraints= new GridBagConstraints();
- closeConstraints.gridx= 2; closeConstraints.gridy= 1;
- closeConstraints.gridwidth= 1; closeConstraints.gridheight= 1;
- closeConstraints.anchor= java.awt.GridBagConstraints.EAST;
- closeConstraints.weightx= 0.0;
- closeConstraints.weighty= 0.0;
- closeConstraints.insets= new Insets(0, 8, 8, 8);
- getContentPane().add(fClose, closeConstraints);
-
- addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- }
- }
- );
- }
-
- public void addError(final Test test, final Throwable t) {
- fModel.addError(test);
- fireTestChanged(test, true);
- }
-
- public void addFailure(final Test test, final Throwable t) {
- fModel.addFailure(test);
- fireTestChanged(test, true);
- }
-
- /**
- * A test ended.
- */
- public void endTest(Test test) {
- fModel.addRunTest(test);
- fireTestChanged(test, false);
- }
-
- /**
- * A test started.
- */
- public void startTest(Test test) {
- }
-
- /**
- * Checks whether the run button should be enabled
- */
- public void checkEnableRun(TreeSelectionEvent e) {
- // TODO should support a multiple selection
- fRun.setEnabled(fTree.getSelectionCount() == 1);
- }
-
- /**
- * Returns the TestListener for the TestTreeFrame
- */
- public TestListener getTestListener() {
- return this;
- }
-
- /**
- * Runs the selected test
- */
- public void runSelection() {
- fModel.resetResults();
- TreePath[] paths= fTree.getSelectionPaths();
- for (int i= 0; i < paths.length; i++) {
- TreePath path= paths[i];
- fRunner.runTest((Test)path.getLastPathComponent());
- }
- }
-
- /**
- * Reloads test tree
- */
- public void reloadTestTree() {
- Test t= fRunner.getTest(fRunner.getSuiteText());
- showTestTree(t);
- }
-
- /**
- * Shows the test hierarchy starting at the given test
- */
- public void showTestTree(Test root) {
- fModel= new TestTreeModel(root);
- fTree.setModel(fModel);
- fTree.setCellRenderer(new TestTreeCellRenderer());
- }
-
- private void fireTestChanged(final Test test, final boolean expand) {
- SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- Vector vpath= new Vector();
- int index= fModel.findTest(test, (Test)fModel.getRoot(), vpath);
- if (index >= 0) {
- Object[] path= new Object[vpath.size()];
- vpath.copyInto(path);
- TreePath treePath= new TreePath(path);
- fModel.fireNodeChanged(treePath, index);
- if (expand) {
- Object child= fModel.getChild(treePath.getLastPathComponent(), index);
- Object[] fullPath= new Object[vpath.size()+1];
- vpath.copyInto(fullPath);
- fullPath[vpath.size()]= child;
- TreePath fullTreePath= new TreePath(fullPath);
- fTree.scrollPathToVisible(fullTreePath);
- }
- }
- }
- }
- );
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeModel.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeModel.java
deleted file mode 100644
index 1e1c2b7..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TestTreeModel.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package junit.swingui;
-
-import java.util.*;
-import javax.swing.event.*;
-import javax.swing.tree.*;
-import junit.framework.*;
-
-/**
- * A tree model for a Test.
- */
-class TestTreeModel implements TreeModel {
- Test fRoot;
- Vector fModelListeners= new Vector();
- Hashtable fFailures= new Hashtable();
- Hashtable fErrors= new Hashtable();
- Hashtable fRunTests= new Hashtable();
-
-/**
- * Constructs a tree model with the given test as its root.
- */
-public TestTreeModel(Test root) {
- super();
- fRoot= root;
-}
-
-/**
- * adds a TreeModelListener
- */
-public void addTreeModelListener(TreeModelListener l) {
- if (!fModelListeners.contains(l))
- fModelListeners.addElement(l);
-}
-/**
- * Removes a TestModelListener
- */
-public void removeTreeModelListener(TreeModelListener l) {
- fModelListeners.removeElement(l);
-}
-/**
- * Finds the path to a test. Returns the index of the test in its
- * parent test suite.
- */
-public int findTest(Test target, Test node, Vector path) {
- if (target.equals(node))
- return 0;
-
- TestSuite suite= isTestSuite(node);
- for (int i= 0; i < getChildCount(node); i++) {
- Test t= suite.testAt(i);
- int index= findTest(target, t, path);
- if (index >= 0) {
- path.insertElementAt(node, 0);
- if (path.size() == 1)
- return i;
- return index;
- }
- }
- return -1;
-}
-/**
- * Fires a node changed event
- */
-public void fireNodeChanged(TreePath path, int index) {
- int[] indices= {index};
- Object[] changedChildren= {getChild(path.getLastPathComponent(), index)};
- TreeModelEvent event= new TreeModelEvent(this, path, indices, changedChildren);
-
- Enumeration e= fModelListeners.elements();
- while (e.hasMoreElements()) {
- TreeModelListener l= (TreeModelListener) e.nextElement();
- l.treeNodesChanged(event);
- }
-}
-/**
- * Gets the test at the given index
- */
-public Object getChild(Object parent, int index) {
- TestSuite suite= isTestSuite(parent);
- if (suite != null)
- return suite.testAt(index);
- return null;
-}
-/**
- * Gets the number of tests.
- */
-public int getChildCount(Object parent) {
- TestSuite suite= isTestSuite(parent);
- if (suite != null)
- return suite.testCount();
- return 0;
-}
-/**
- * Gets the index of a test in a test suite
- */
-public int getIndexOfChild(Object parent, Object child) {
- TestSuite suite= isTestSuite(parent);
- if (suite != null) {
- int i= 0;
- for (Enumeration e= suite.tests(); e.hasMoreElements(); i++) {
- if (child.equals((Test)e.nextElement()))
- return i;
- }
- }
- return -1;
-}
-/**
- * Returns the root of the tree
- */
-public Object getRoot() {
- return fRoot;
-}
-/**
- * Tests if the test is a leaf.
- */
-public boolean isLeaf(Object node) {
- return isTestSuite(node) == null;
-}
-/**
- * Tests if the node is a TestSuite.
- */
-protected TestSuite isTestSuite(Object node) {
- if (node instanceof TestSuite)
- return (TestSuite)node;
- return null;
-}
-/**
- * Called when the value of the model object was changed in the view
- */
-public void valueForPathChanged(TreePath path, Object newValue) {
- // we don't support direct editing of the model
- System.out.println("TreeModel.valueForPathChanged: not implemented");
-}
-/**
- * Remembers a test failure
- */
-void addFailure(Test t) {
- fFailures.put(t, t);
-}
-/**
- * Remembers a test error
- */
-void addError(Test t) {
- fErrors.put(t, t);
-}
-/**
- * Remembers that a test was run
- */
-void addRunTest(Test t) {
- fRunTests.put(t, t);
-}
-/**
- * Returns whether a test was run
- */
-boolean wasRun(Test t) {
- return fRunTests.get(t) != null;
-}
-/**
- * Tests whether a test was an error
- */
-boolean isError(Test t) {
- return (fErrors != null) && fErrors.get(t) != null;
-}
-/**
- * Tests whether a test was a failure
- */
-boolean isFailure(Test t) {
- return (fFailures != null) && fFailures.get(t) != null;
-}
-/**
- * Resets the test results
- */
-void resetResults() {
- fFailures= new Hashtable();
- fRunTests= new Hashtable();
- fErrors= new Hashtable();
-}
-
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TraceFrame.java b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TraceFrame.java
deleted file mode 100644
index 27bdf3d..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/TraceFrame.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package junit.swingui;
-
-import java.io.*;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.border.*;
-
-import junit.framework.*;
-import junit.util.*;
-
-class TraceFrame extends JFrame {
- private JButton fButton= null;
- private JTextArea fTextArea= null;
-
- public TraceFrame() {
- getContentPane().setLayout(new GridBagLayout());
- setBackground(SystemColor.control);
- setSize(500, 250);
- setTitle("Stack Trace");
-
- fTextArea= new JTextArea();
- fTextArea.setRows(10);
- fTextArea.setColumns(60);
- fTextArea.setEditable(false);
-
- JScrollPane scrolledText= new JScrollPane(fTextArea);
-
- fButton= new JButton("Close");
- fButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- }
- );
-
- GridBagConstraints constraintsStackTextArea = new GridBagConstraints();
- constraintsStackTextArea.gridx = 0; constraintsStackTextArea.gridy = 0;
- constraintsStackTextArea.gridwidth = 1; constraintsStackTextArea.gridheight = 1;
- constraintsStackTextArea.fill = GridBagConstraints.BOTH;
- constraintsStackTextArea.anchor = GridBagConstraints.CENTER;
- constraintsStackTextArea.weightx = 1.0;
- constraintsStackTextArea.weighty = 1.0;
- constraintsStackTextArea.insets = new Insets(8, 8, 8, 8);
- getContentPane().add(scrolledText, constraintsStackTextArea);
-
- GridBagConstraints constraintsCloseButton = new GridBagConstraints();
- constraintsCloseButton.gridx = 0; constraintsCloseButton.gridy = 1;
- constraintsCloseButton.gridwidth = 1; constraintsCloseButton.gridheight = 1;
- constraintsCloseButton.anchor = java.awt.GridBagConstraints.EAST;
- constraintsCloseButton.weightx = 0.0;
- constraintsCloseButton.weighty = 0.0;
- constraintsCloseButton.insets = new Insets(0, 8, 8, 8);
- getContentPane().add(fButton, constraintsCloseButton);
-
- addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- }
- }
- );
- }
- /**
- * Shows the stack trace of the passed in throwable
- */
- public void showTrace(Throwable t) {
- StringWriter stringWriter= new StringWriter();
- PrintWriter writer= new PrintWriter(stringWriter);
- t.printStackTrace(writer);
- StringBuffer buffer= stringWriter.getBuffer();
- fTextArea.setText(StringUtil.truncate(buffer.toString(), 5000));
- fTextArea.select(0, 0);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/error.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/error.gif
deleted file mode 100644
index fe13a6a..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/error.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/failure.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/failure.gif
deleted file mode 100644
index 156ecd6..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/failure.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/logo.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/logo.gif
deleted file mode 100644
index d0e1547..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/logo.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ok.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ok.gif
deleted file mode 100644
index 034825b..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/ok.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/smalllogo.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/smalllogo.gif
deleted file mode 100644
index 7b25eaf..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/swingui/smalllogo.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/AllTests.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/AllTests.java
deleted file mode 100644
index aeccf1c..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/AllTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package junit.tests;
-
-import junit.framework.*;
-
-/**
- * TestSuite that runs all the sample tests
- *
- */
-public class AllTests {
-
- private static boolean inVAJava() {
- try {
- Class.forName("com.ibm.uvm.tools.DebugSupport");
- }
- catch (Exception e) {
- return false;
- }
- return true;
- }
- public static void main (String[] args) {
- junit.textui.TestRunner.run(suite());
- }
- public static Test suite ( ) {
- TestSuite suite= new TestSuite("Framework Tests");
- suite.addTest(new TestSuite(ExtensionTest.class));
- suite.addTest(new TestSuite(TestTest.class));
- suite.addTest(SuiteTest.suite()); // Tests suite building, so can't use it
- if (!inVAJava())
- suite.addTest(new TestSuite(TestTestCaseClassLoader.class));
- return suite;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ClassLoaderTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ClassLoaderTestCase.java
deleted file mode 100644
index 9076a56..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ClassLoaderTestCase.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in TestTestCaseClassLoader
- */
-import junit.framework.*;
-import junit.util.*;
-
-public class ClassLoaderTestCase extends Object {
- public ClassLoaderTestCase() {
- }
- public Boolean assertClassLoaders() {
- return new Boolean(loadedByTestCaseClassLoader() && systemClassNotLoadedByTestCaseClassLoader());
- }
- private boolean isTestCaseClassLoader(ClassLoader cl) {
- return (cl != null && cl.getClass().equals(junit.util.TestCaseClassLoader.class));
- }
- public boolean loadedByTestCaseClassLoader() {
- ClassLoader cl= getClass().getClassLoader();
- return isTestCaseClassLoader(cl);
- }
- public boolean systemClassNotLoadedByTestCaseClassLoader() {
- ClassLoader cl= Object.class.getClassLoader();
- ClassLoader cl2= TestCase.class.getClassLoader();
- return (!isTestCaseClassLoader(cl) && !isTestCaseClassLoader(cl2));
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExceptionTestCaseTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExceptionTestCaseTest.java
deleted file mode 100644
index e39eca1..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExceptionTestCaseTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package junit.tests;
-
-import junit.framework.*;
-import junit.extensions.*;
-
-public class ExceptionTestCaseTest extends junit.framework.TestCase {
-/**
- * ExceptionTestCaseTest constructor comment.
- * @param name java.lang.String
- */
-public ExceptionTestCaseTest(String name) {
- super(name);
-}
-public void testExceptionSubclass() {
- ExceptionTestCase test= new ExceptionTestCase("test", Exception.class) {
- public void test() {
- throw new IndexOutOfBoundsException();
- }
- };
- TestResult result= test.run();
- assertEquals(1, result.runCount());
- assert(result.wasSuccessful());
-}
-public void testExceptionTest() {
- ExceptionTestCase test= new ExceptionTestCase("test", IndexOutOfBoundsException.class) {
- public void test() {
- throw new IndexOutOfBoundsException();
- }
- };
- TestResult result= test.run();
- assertEquals(1, result.runCount());
- assert(result.wasSuccessful());
-}
-public void testFailure() {
- ExceptionTestCase test= new ExceptionTestCase("test", IndexOutOfBoundsException.class) {
- public void test() {
- throw new RuntimeException();
- }
- };
- TestResult result= test.run();
- assertEquals(1, result.runCount());
- assertEquals(1, result.errorCount());
-}
-public void testNoException() {
- ExceptionTestCase test= new ExceptionTestCase("test", Exception.class) {
- public void test() {
- }
- };
- TestResult result= test.run();
- assertEquals(1, result.runCount());
- assertEquals(1, result.failureCount());
-}
-public void testWrongException() {
- ExceptionTestCase test= new ExceptionTestCase("test", IndexOutOfBoundsException.class) {
- public void test() {
- throw new RuntimeException();
- }
- };
- TestResult result= test.run();
- assertEquals(1, result.runCount());
- assertEquals(1, result.errorCount());
-}
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExtensionTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExtensionTest.java
deleted file mode 100644
index d377d89..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ExtensionTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package junit.tests;
-
-import junit.framework.*;
-import junit.extensions.*;
-
-/**
- * A test case testing the extensions to the testing framework.
- *
- */
-public class ExtensionTest extends TestCase {
- static class TornDown extends TestSetup {
- boolean fTornDown= false;
-
- TornDown(Test test) {
- super(test);
- }
- protected void tearDown() {
- fTornDown= true;
- }
- }
- public ExtensionTest(String name) {
- super(name);
- }
- public void testRunningErrorInTestSetup() {
- TestCase test= new TestCase("failure") {
- public void runTest() {
- fail();
- }
- };
-
- TestSetup wrapper= new TestSetup(test);
-
- TestResult result= new TestResult();
- wrapper.run(result);
- assert(!result.wasSuccessful());
- }
- public void testRunningErrorsInTestSetup() {
- TestCase failure= new TestCase("failure") {
- public void runTest() {
- fail();
- }
- };
-
- TestCase error= new TestCase("error") {
- public void runTest() {
- throw new Error();
- }
- };
-
- TestSuite suite= new TestSuite();
- suite.addTest(failure);
- suite.addTest(error);
-
- TestSetup wrapper= new TestSetup(suite);
-
- TestResult result= new TestResult();
- wrapper.run(result);
-
- assertEquals(1, result.failureCount());
- assertEquals(1, result.errorCount());
- }
- public void testSetupErrorDontTearDown() {
- WasRun test= new WasRun("");
-
- TornDown wrapper= new TornDown(test) {
- public void setUp() {
- fail();
- }
- };
-
- TestResult result= new TestResult();
- wrapper.run(result);
-
- assert(!wrapper.fTornDown);
- }
- public void testSetupErrorInTestSetup() {
- WasRun test= new WasRun("");
-
- TestSetup wrapper= new TestSetup(test) {
- public void setUp() {
- fail();
- }
- };
-
- TestResult result= new TestResult();
- wrapper.run(result);
-
- assert(!test.fWasRun);
- assert(!result.wasSuccessful());
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/InheritedTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/InheritedTestCase.java
deleted file mode 100644
index 2e7c9ed..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/InheritedTestCase.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-public class InheritedTestCase extends OneTestCase {
- public InheritedTestCase(String name) {
- super(name);
- }
- public void test2() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCaseClass.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCaseClass.java
deleted file mode 100644
index 5e61228..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCaseClass.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-import junit.framework.TestCase;
-
-public class NoTestCaseClass extends Object {
- public NoTestCaseClass(String name) {
- }
- public void testSuccess() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCases.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCases.java
deleted file mode 100644
index 7b351f7..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NoTestCases.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-import junit.framework.TestCase;
-
-public class NoTestCases extends TestCase {
- public NoTestCases(String name) {
- super(name);
- }
- public void noTestCase() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotPublicTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotPublicTestCase.java
deleted file mode 100644
index d28adc3..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotPublicTestCase.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-import junit.framework.TestCase;
-
-public class NotPublicTestCase extends TestCase {
- public NotPublicTestCase(String name) {
- super(name);
- }
- protected void testNotPublic() {
- }
- public void testPublic() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotVoidTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotVoidTestCase.java
deleted file mode 100644
index e43e105..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/NotVoidTestCase.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-import junit.framework.TestCase;
-
-public class NotVoidTestCase extends TestCase {
- public NotVoidTestCase(String name) {
- super(name);
- }
- public int testNotVoid() {
- return 1;
- }
- public void testVoid() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/OneTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/OneTestCase.java
deleted file mode 100644
index 53a2efc..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/OneTestCase.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-import junit.framework.TestCase;
-
-public class OneTestCase extends TestCase {
- public OneTestCase(String name) {
- super(name);
- }
- public void noTestCase() {
- }
- public void testCase() {
- }
- public void testCase(int arg) {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/OverrideTestCase.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/OverrideTestCase.java
deleted file mode 100644
index 5307e1f..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/OverrideTestCase.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-public class OverrideTestCase extends OneTestCase {
- public OverrideTestCase(String name) {
- super(name);
- }
- public void testCase() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/SuiteTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/SuiteTest.java
deleted file mode 100644
index 700a5bc..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/SuiteTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package junit.tests;
-
-import java.util.Vector;
-import junit.framework.*;
-
-/**
- * A fixture for testing the "auto" test suite feature.
- *
- */
-public class SuiteTest extends TestCase {
- protected TestResult fResult;
- public SuiteTest(String name) {
- super(name);
- }
- protected void setUp() {
- fResult= new TestResult();
- }
- public static Test suite() {
- TestSuite suite= new TestSuite("Suite Tests");
- // build the suite manually
- suite.addTest(new SuiteTest("testNoTestCaseClass"));
- suite.addTest(new SuiteTest("testNoTestCases"));
- suite.addTest(new SuiteTest("testOneTestCase"));
- suite.addTest(new SuiteTest("testNotPublicTestCase"));
- suite.addTest(new SuiteTest("testNotVoidTestCase"));
- suite.addTest(new SuiteTest("testNotExistingTestCase"));
- suite.addTest(new SuiteTest("testInheritedTests"));
- suite.addTest(new SuiteTest("testShadowedTests"));
-
- return suite;
- }
- public void testInheritedTests() {
- TestSuite suite= new TestSuite(InheritedTestCase.class);
- suite.run(fResult);
- assert(fResult.wasSuccessful());
- assertEquals(2, fResult.runCount());
- }
- public void testNoTestCaseClass() {
- Test t= new TestSuite(NoTestCaseClass.class);
- t.run(fResult);
- assertEquals(1, fResult.runCount()); // warning test
- assert(! fResult.wasSuccessful());
- }
- public void testNoTestCases() {
- Test t= new TestSuite(NoTestCases.class);
- t.run(fResult);
- assert(fResult.runCount() == 1); // warning test
- assert(fResult.failureCount() == 1);
- assert(! fResult.wasSuccessful());
- }
- public void testNotExistingTestCase() {
- Test t= new SuiteTest("notExistingMethod");
- t.run(fResult);
- assert(fResult.runCount() == 1);
- assert(fResult.failureCount() == 1);
- assert(fResult.errorCount() == 0);
- }
- public void testNotPublicTestCase() {
- TestSuite suite= new TestSuite(NotPublicTestCase.class);
- // 1 public test case + 1 warning for the non-public test case
- assertEquals(2, suite.countTestCases());
- }
- public void testNotVoidTestCase() {
- TestSuite suite= new TestSuite(NotVoidTestCase.class);
- assert(suite.countTestCases() == 1);
- }
- public void testOneTestCase() {
- Test t= new TestSuite(OneTestCase.class);
- t.run(fResult);
- assert(fResult.runCount() == 1);
- assert(fResult.failureCount() == 0);
- assert(fResult.errorCount() == 0);
- assert(fResult.wasSuccessful());
- }
- public void testShadowedTests() {
- TestSuite suite= new TestSuite(OverrideTestCase.class);
- suite.run(fResult);
- assertEquals(1, fResult.runCount());
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestListenerTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestListenerTest.java
deleted file mode 100644
index 8c688b4..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestListenerTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package junit.tests;
-
-/**
- * Test class used in SuiteTest
- */
-import junit.framework.*;
-
-public class TestListenerTest extends TestCase implements TestListener {
- private TestResult fResult;
- private int fStartCount;
- private int fEndCount;
- private int fFailureCount;
- private int fErrorCount;
- public TestListenerTest(String name) {
- super(name);
- }
- public void addError(Test test, Throwable t) {
- fErrorCount++;
- }
- public void addFailure(Test test, Throwable t) {
- fFailureCount++;
- }
- public void endTest(Test test) {
- fEndCount++;
- }
-protected void setUp() {
- fResult= new TestResult();
- fResult.addListener(this);
-
- fStartCount= 0;
- fEndCount= 0;
- fFailureCount= 0;
-}
- public void startTest(Test test) {
- fStartCount++;
- }
-public void testError() {
- TestCase test= new TestCase("noop") {
- public void runTest() {
- throw new Error();
- }
- };
- test.run(fResult);
- assertEquals(1, fErrorCount);
- assertEquals(1, fEndCount);
-}
-public void testFailure() {
- TestCase test= new TestCase("noop") {
- public void runTest() {
- fail();
- }
- };
- test.run(fResult);
- assertEquals(1, fFailureCount);
- assertEquals(1, fEndCount);
-}
-public void testStartStop() {
- TestCase test= new TestCase("noop") {
- public void runTest() {
- }
- };
- test.run(fResult);
- assertEquals(1, fStartCount);
- assertEquals(1, fEndCount);
-}
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTest.java
deleted file mode 100644
index e95f41f..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTest.java
+++ /dev/null
@@ -1,223 +0,0 @@
-package junit.tests;
-
-import java.util.Vector;
-import junit.framework.*;
-import junit.util.StringUtil;
-
-/**
- * A test case testing the testing framework.
- *
- */
-public class TestTest extends TestCase {
-
- static class TornDown extends TestCase {
- boolean fTornDown= false;
-
- TornDown(String name) {
- super(name);
- }
- protected void tearDown() {
- fTornDown= true;
- }
- protected void runTest() {
- throw new Error();
- }
- }
-
- public TestTest(String name) {
- super(name);
- }
- public void testAssertEquals() {
- Object o= new Object();
- assertEquals(o, o);
- }
- public void testAssertEqualsNull() {
- assertEquals(null, null);
- }
- public void testAssertNull() {
- TestCase succeeds= new TestCase("isnull") {
- protected void runTest() {
- assertNull(null);
- }
- };
- verifySuccess(succeeds);
- }
- public void testAssertNullNotEqualsNull() {
- TestCase fails= new TestCase("fails") {
- protected void runTest() {
- assertEquals(null, new Object());
- }
- };
- verifyFailure(fails);
- }
- public void testAssertSame() {
- Object o= new Object();
- assertSame(o, o);
- }
- public void testAssertSameFails() {
- TestCase assertSame= new TestCase("assertSame") {
- protected void runTest() {
- assertSame(new Integer(1), new Integer(1));
- }
- };
- verifyFailure(assertSame);
- }
- public void testCaseToString() {
- // This test wins the award for twisted snake tail eating while
- // writing self tests. And you thought those weird anonymous
- // inner classes were bad...
-
- assertEquals("testCaseToString(junit.tests.TestTest)", toString());
- }
- public void testError() {
- TestCase error= new TestCase("error") {
- protected void runTest() {
- throw new Error();
- }
- };
- verifyError(error);
- }
- public void testFail() {
- TestCase failure= new TestCase("fail") {
- protected void runTest() {
- fail();
- }
- };
- verifyFailure(failure);
- }
- public void testFailAssertNotNull() {
- TestCase failure= new TestCase("fails") {
- protected void runTest() {
- assertNotNull(null);
- }
- };
- verifyFailure(failure);
- }
- public void testFailure() {
- TestCase failure= new TestCase("failure") {
- protected void runTest() {
- assert(false);
- }
- };
- verifyFailure(failure);
- }
- public void testFailureException() {
- try {
- fail();
- }
- catch (AssertionFailedError e) {
- return;
- }
- fail();
-
- }
- public void testRunAndTearDownFails() {
- TornDown fails= new TornDown("fails") {
- protected void tearDown() {
- super.tearDown();
- throw new Error();
- }
- protected void runTest() {
- throw new Error();
- }
- };
- verifyError(fails);
- assert(fails.fTornDown);
- }
- public void testRunnerPrinting() {
- assertEquals("1.05", StringUtil.elapsedTimeAsString(1050));
- }
- public void testSetupFails() {
- TestCase fails= new TestCase("success") {
- protected void setUp() {
- throw new Error();
- }
- protected void runTest() {
- }
- };
- verifyError(fails);
- }
- public void testSucceedAssertNotNull() {
- assertNotNull(new Object());
- }
- public void testSuccess() {
- TestCase success= new TestCase("success") {
- protected void runTest() {
- assert(true);
- }
- };
- verifySuccess(success);
- }
- public void testTearDownAfterError() {
-
- TornDown fails= new TornDown("fails");
- verifyError(fails);
- assert(fails.fTornDown);
- }
- public void testTearDownFails() {
- TestCase fails= new TestCase("success") {
- protected void tearDown() {
- throw new Error();
- }
- protected void runTest() {
- }
- };
- verifyError(fails);
- }
- public void testTearDownSetupFails() {
- TornDown fails= new TornDown("fails") {
- protected void setUp() {
- throw new Error();
- }
- };
- verifyError(fails);
- assert(!fails.fTornDown);
- }
- public void testWasNotSuccessful() {
- TestCase failure= new TestCase("fail") {
- protected void runTest() {
- fail();
- }
- };
- TestResult result= failure.run();
- assert(result.runCount() == 1);
- assert(result.failureCount() == 1);
- assert(result.errorCount() == 0);
- assert(! result.wasSuccessful());
- }
- public void testWasRun() {
- WasRun test= new WasRun("");
- test.run();
- assert(test.fWasRun);
- }
- public void testWasSuccessful() {
- TestCase success= new TestCase("success") {
- protected void runTest() {
- assert(true);
- }
- };
- TestResult result= success.run();
- assert(result.runCount() == 1);
- assert(result.failureCount() == 0);
- assert(result.errorCount() == 0);
- assert(result.wasSuccessful());
- }
- private void verifyError(TestCase test) {
- TestResult result= test.run();
- assert(result.runCount() == 1);
- assert(result.failureCount() == 0);
- assert(result.errorCount() == 1);
- }
- private void verifyFailure(TestCase test) {
- TestResult result= test.run();
- assert(result.runCount() == 1);
- assert(result.failureCount() == 1);
- assert(result.errorCount() == 0);
- }
- private void verifySuccess(TestCase test) {
- TestResult result= test.run();
- assert(result.runCount() == 1);
- assert(result.failureCount() == 0);
- assert(result.errorCount() == 0);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTestCaseClassLoader.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTestCaseClassLoader.java
deleted file mode 100644
index f2e49dc..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/TestTestCaseClassLoader.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package junit.tests;
-
-import java.lang.reflect.*;
-import junit.framework.*;
-import junit.util.*;
-
-
-/**
- * A TestCase for testing the TestCaseClassLoader
- *
- */
-public class TestTestCaseClassLoader extends TestCase {
-
- public TestTestCaseClassLoader(String name) {
- super(name);
- }
- public void testClassLoading() {
- TestCaseClassLoader loader= new TestCaseClassLoader();
- Class loadedClass= null;
- try {
- loadedClass= loader.loadClass("junit.tests.ClassLoaderTestCase", true);
- }
- catch (Exception e) {
- fail("Exception during class loading");
- }
- assert(loadedClass != null);
- Object o= null;
- try {
- o= loadedClass.newInstance();
- }
- catch (Exception e) {
- fail("Can't instantiate loaded class");
- }
- assertNotNull(o);
- //
- // Invoke the assertClassLoaders method via reflection.
- // We use reflection since the class is loaded by
- // another class loader and we can't do a downcast to
- // ClassLoaderTestCase.
- //
- String methodName= "assertClassLoaders";
- Method method= null;
- Boolean result= null;
- try {
- method= loadedClass.getDeclaredMethod(methodName, new Class[0]);
- } catch (NoSuchMethodException e) {
- fail("Method \""+methodName+"\" not found");
- }
- try {
- result= (Boolean)method.invoke(o, new Class[0]);
- }
- catch (InvocationTargetException e) {
- fail("InvocationTargetException");
- }
- catch (IllegalAccessException e) {
- fail("IllegalAccessException");
- }
- assert(result.booleanValue());
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ThreadTest.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ThreadTest.java
deleted file mode 100644
index 463304d..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/ThreadTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package junit.tests;
-
-import java.util.Vector;
-import junit.framework.*;
-
-/**
- * A test case testing the running of tests across multiple threads.
- * Demonstrates that running a test case across different threads
- * doesn't work yet.
- */
-public class ThreadTest extends TestCase {
-
- public ThreadTest(String name) {
- super(name);
- }
- public static Test suite() {
- return new TestSuite(ThreadTest.class);
- }
- public void testRemote() {
-
- Thread t= new Thread() {
- public void run() {
- verifyResults();
- }
- };
- t.start();
- try {
- t.join();
- }
- catch(InterruptedException e) {
- fail("interrupted test");
- }
- }
- public void testRunInThread() {
- final Thread t= new Thread() {
- public void run() {
- verifyResults();
- }
- };
- TestCase runInThread= new TestCase("runInThread") {
- protected void runTest() {
- final Thread t= new Thread() {
- public void run() {
- Assert.fail();
- }
- };
- t.start();
- try {
- t.join();
- }
- catch(InterruptedException e) {
- fail("interrupted test");
- }
- }
- };
- TestResult result= runInThread.run();
- assert(result.runCount() == 1);
- assert(result.failureCount() == 1);
- assert(result.errorCount() == 0);
- }
- public void verifyResults() {
- fail("verify failed");
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/WasRun.java b/org.eclipse.jdt.ui.tests/JUnit/junit/tests/WasRun.java
deleted file mode 100644
index ae14ea3..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/tests/WasRun.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package junit.tests;
-
-import junit.framework.*;
-
-/**
- * A helper test case for testing whether the testing method
- * is run.
- */
-class WasRun extends TestCase {
- boolean fWasRun= false;
- WasRun(String name) {
- super(name);
- }
- protected void runTest() {
- fWasRun= true;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/textui/TestRunner.java b/org.eclipse.jdt.ui.tests/JUnit/junit/textui/TestRunner.java
deleted file mode 100644
index f7209d0..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/textui/TestRunner.java
+++ /dev/null
@@ -1,260 +0,0 @@
-package junit.textui;
-
-
-import java.lang.reflect.*;
-import java.text.NumberFormat;
-import java.util.*;
-import java.io.PrintStream;
-
-import junit.framework.*;
-import junit.util.*;
-
-/**
- * A command line based tool to run tests.
- * <pre>
- * java test.textui.TestRunner [-wait] TestCaseClass
- * </pre>
- * TestRunner expects the name of a TestCase class as argument.
- * If this class defines a static <code>suite</code> method it
- * will be invoked and the returned test is run. Otherwise all
- * the methods starting with "test" having no arguments are run.
- * <p>
- * When the wait command line argument is given TestRunner
- * waits until the users types RETURN.
- * <p>
- * TestRunner prints a trace as the tests are executed followed by a
- * summary at the end.
- */
-public class TestRunner implements TestListener {
- PrintStream fWriter;
-/**
- * This method was created in VisualAge.
- * @param writer java.io.PrintStream
- */
-public TestRunner() {
-}
-/**
- * This method was created in VisualAge.
- * @param writer java.io.PrintStream
- */
-public TestRunner(PrintStream writer) {
- this();
- fWriter= writer;
-}
- public synchronized void addError(Test test, Throwable t) {
- writer().print("E");
- }
- public synchronized void addFailure(Test test, Throwable t) {
- writer().print("F");
- }
- /**
- * Creates the TestResult to be used for the test run.
- */
- protected TestResult createTestResult() {
- return new TestResult();
- }
-
- protected void doRun(Test suite, boolean wait) {
- TestResult result= createTestResult();
- result.addListener(this);
- long startTime= System.currentTimeMillis();
- suite.run(result);
- long endTime= System.currentTimeMillis();
- long runTime= endTime-startTime;
- writer().println();
- writer().println("Time: "+StringUtil.elapsedTimeAsString(runTime));
- print(result);
-
- writer().println();
-
- if (wait) {
- writer().println("<RETURN> to continue");
- try {
- System.in.read();
- }
- catch(Exception e) {
- }
- }
- if (!result.wasSuccessful())
- System.exit(-1);
- System.exit(0);
- }
- public void endTest(Test test) {
- }
- private String extractClassName(String className) {
- if(className.startsWith("Default package for"))
- return className.substring(className.lastIndexOf(".")+1);
- return className;
- }
- /**
- * main entry point.
- */
- public static void main(String args[]) {
- TestRunner aTestRunner= new TestRunner();
- aTestRunner.start(args);
- }
- /**
- * Prints failures to the standard output
- */
- public synchronized void print(TestResult result) {
- printHeader(result);
- printErrors(result);
- printFailures(result);
- }
- /**
- * Prints the errors to the standard output
- */
- public void printErrors(TestResult result) {
- if (result.errorCount() != 0) {
- if (result.errorCount() == 1)
- writer().println("There was "+result.errorCount()+" error:");
- else
- writer().println("There were "+result.errorCount()+" errors:");
-
- int i= 1;
- for (Enumeration e= result.errors(); e.hasMoreElements(); i++) {
- TestFailure failure= (TestFailure)e.nextElement();
- writer().println(i+") "+failure.failedTest());
- failure.thrownException().printStackTrace();
- }
- }
- }
- /**
- * Prints failures to the standard output
- */
- public void printFailures(TestResult result) {
- if (result.failureCount() != 0) {
- if (result.failureCount() == 1)
- writer().println("There was " + result.failureCount() + " failure:");
- else
- writer().println("There were " + result.failureCount() + " failures:");
- int i = 1;
- for (Enumeration e= result.failures(); e.hasMoreElements(); i++) {
- TestFailure failure= (TestFailure) e.nextElement();
- writer().print(i + ") " + failure.failedTest());
- Throwable t= failure.thrownException();
- if (t.getMessage() != null)
- writer().println(" \""
- //+ StringUtil.truncate(t.getMessage(), 80)
- + t.getMessage()
- + "\"");
- else {
- writer().println();
- failure.thrownException().printStackTrace();
- }
- }
- }
- }
- /**
- * Prints the header of the report
- */
- public void printHeader(TestResult result) {
- if (result.wasSuccessful()) {
- writer().println();
- writer().print("OK");
- writer().println (" (" + result.runCount() + " tests)");
-
- } else {
- writer().println();
- writer().println("FAILURES!!!");
- writer().println("Test Results:");
- writer().println("Run: "+result.runCount()+
- " Failures: "+result.failureCount()+
- " Errors: "+result.errorCount());
- }
- }
- /**
- * Runs a suite extracted from a TestCase subclass.
- */
- static public void run(Class testClass) {
- run(new TestSuite(testClass));
- }
- /**
- * Runs a single test and collects its results.
- * This method can be used to start a test run
- * from your program.
- * <pre>
- * public static void main (String[] args) {
- * test.textui.TestRunner.run(suite());
- * }
- * </pre>
- */
- static public void run(Test suite) {
- TestRunner aTestRunner= new TestRunner();
- aTestRunner.doRun(suite, false);
- }
- /**
- * Runs a single test and waits until the users
- * types RETURN.
- */
- static public void runAndWait(Test suite) {
- TestRunner aTestRunner= new TestRunner();
- aTestRunner.doRun(suite, true);
- }
- /**
- * Starts a test run. Analyzes the command line arguments
- * and runs the given test suite.
- */
- protected void start(String args[]) {
- String testCase= "";
- boolean wait= false;
-
- for (int i= 0; i < args.length; i++) {
- if (args[i].equals("-wait"))
- wait= true;
- else if (args[i].equals("-c"))
- testCase= StringUtil.extractClassName(args[++i]);
- else if (args[i].equals("-v"))
- System.out.println("JUnit "+Version.id()+" by Kent Beck and Erich Gamma");
- else
- testCase= args[i];
- }
-
- if (testCase.equals("")) {
- System.out.println("Usage: TestRunner [-wait] testCaseName, where name is the name of the TestCase class");
- System.exit(-1);
- }
-
- try {
- Class testClass= null;
- Method suiteMethod= null;
- Test suite= null;
-
- try {
- testClass= Class.forName(testCase);
- } catch(Exception e) {
- System.out.println("Suite class \""+testCase+"\" not found");
- System.exit(-1);
- }
-
- try {
- suiteMethod= testClass.getMethod("suite", new Class[0]);
- } catch(Exception e) {
- // try to extract a test suite automatically
- suite= new TestSuite(testClass);
- }
-
- if (suite == null) {
- try {
- suite= (Test)suiteMethod.invoke(null, new Class[0]); // static method
- } catch(Exception e) {
- System.out.println("Could not invoke the suite() method");
- System.exit(-1);
- }
- }
- doRun(suite, wait);
- }
- catch(Exception e) {
- System.out.println("Could not create and run test suite");
- System.exit(-1);
- }
- }
- public synchronized void startTest(Test test) {
- System.out.print(".");
- }
- private PrintStream writer() {
- if (fWriter == null)
- return System.out;
- return fWriter;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/AboutDialog.java b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/AboutDialog.java
deleted file mode 100644
index af47b5f..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/AboutDialog.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package junit.ui;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import junit.util.Version;
-
-class AboutDialog extends Dialog {
- public AboutDialog(Frame parent) {
- super(parent);
-
- setResizable(false);
- setLayout(new GridBagLayout());
- setSize(296, 138);
- setTitle("About");
-
- Button button= new Button("Close");
- button.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- }
- );
-
- Label label1= new Label("JUnit");
- label1.setFont(new Font("dialog", Font.PLAIN, 36));
-
- Label label2= new Label("JUnit "+Version.id()+ " by Kent Beck and Erich Gamma");
- label2.setFont(new Font("dialog", Font.PLAIN, 14));
-
- Logo logo= new Logo();
-
- GridBagConstraints constraintsLabel1= new GridBagConstraints();
- constraintsLabel1.gridx = 3; constraintsLabel1.gridy = 0;
- constraintsLabel1.gridwidth = 1; constraintsLabel1.gridheight = 1;
- constraintsLabel1.anchor = GridBagConstraints.CENTER;
- constraintsLabel1.weightx = 0.0;
- constraintsLabel1.weighty = 0.0;
- add(label1, constraintsLabel1);
-
- GridBagConstraints constraintsLabel2= new GridBagConstraints();
- constraintsLabel2.gridx = 2; constraintsLabel2.gridy = 1;
- constraintsLabel2.gridwidth = 2; constraintsLabel2.gridheight = 1;
- constraintsLabel2.anchor = GridBagConstraints.CENTER;
- constraintsLabel2.weightx = 0.0;
- constraintsLabel2.weighty = 0.0;
- add(label2, constraintsLabel2);
-
- GridBagConstraints constraintsButton1= new GridBagConstraints();
- constraintsButton1.gridx = 2; constraintsButton1.gridy = 2;
- constraintsButton1.gridwidth = 2; constraintsButton1.gridheight = 1;
- constraintsButton1.anchor = GridBagConstraints.CENTER;
- constraintsButton1.weightx = 0.0;
- constraintsButton1.weighty = 0.0;
- constraintsButton1.insets= new Insets(8, 0, 8, 0);
- add(button, constraintsButton1);
-
- GridBagConstraints constraintsLogo1= new GridBagConstraints();
- constraintsLogo1.gridx = 2; constraintsLogo1.gridy = 0;
- constraintsLogo1.gridwidth = 1; constraintsLogo1.gridheight = 1;
- constraintsLogo1.anchor = GridBagConstraints.CENTER;
- constraintsLogo1.weightx = 0.0;
- constraintsLogo1.weighty = 0.0;
- add(logo, constraintsLogo1);
-
- addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- }
- }
- );
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/LoadingTestRunner.java b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/LoadingTestRunner.java
deleted file mode 100644
index c13374b..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/LoadingTestRunner.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package junit.ui;
-
-import junit.framework.*;
-import junit.util.*;
-import java.util.Vector;
-import java.lang.reflect.*;
-import java.awt.*;
-import java.awt.event.*;
-
-/**
- * A TestRunner that dynamically reloads classes.
- * Enter the name of a class with a suite method which should return
- * the tests to be run.
- * <pre>
- * Synopsis: java java.ui.LoadingTestRunner [TestCase]
- * </pre>
- * TestRunner takes as an optional argument the name of the testcase class to be run.
- * @see TestCaseClassLoader
- */
-public class LoadingTestRunner {
- /**
- * main entrypoint
- */
- public static void main(String[] args) {
- new TestRunner().start(args, new ReloadingTestSuiteLoader());
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/Logo.java b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/Logo.java
deleted file mode 100644
index 136fdb4..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/Logo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package junit.ui;
-
-import java.awt.*;
-import java.awt.image.*;
-
-class Logo extends Canvas {
- private Image fImage;
- private int fWidth;
- private int fHeight;
- public Logo() {
- fImage= loadImage("logo.gif");
- MediaTracker tracker= new MediaTracker(this);
- tracker.addImage(fImage, 0);
- try {
- tracker.waitForAll();
- } catch (Exception e) {
- }
-
- if (fImage != null) {
- fWidth= fImage.getWidth(this);
- fHeight= fImage.getHeight(this);
- } else {
- fWidth= 20;
- fHeight= 20;
- }
- setSize(fWidth, fHeight);
- }
- public Image loadImage(String name) {
- Toolkit toolkit= Toolkit.getDefaultToolkit();
- try {
- java.net.URL url= getClass().getResource(name);
- return toolkit.createImage((ImageProducer) url.getContent());
- } catch (Exception ex) {
- }
- return null;
- }
- public void paint(Graphics g) {
- paintBackground(g);
- if (fImage != null)
- g.drawImage(fImage, 0, 0, fWidth, fHeight, this);
- }
- public void paintBackground( java.awt.Graphics g) {
- g.setColor(SystemColor.control);
- g.fillRect(0, 0, getBounds().width, getBounds().height);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/ProgressBar.java b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/ProgressBar.java
deleted file mode 100644
index a5d9ea1..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/ProgressBar.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package junit.ui;
-
-import java.awt.*;
-
-class ProgressBar extends Canvas {
- public boolean fError= false;
- public int fTotal= 0;
- public int fProgress= 0;
- public int fProgressX= 0;
- public ProgressBar() {
- super();
- setSize(20, 30);
- }
- private Color getStatusColor() {
- if (fError)
- return Color.red;
- return Color.green;
- }
- public void paint(Graphics g) {
- paintBackground(g);
- paintStatus(g);
- }
- public void paintBackground(Graphics g) {
- g.setColor(SystemColor.control);
- g.fillRect(0, 0, getBounds().width, getBounds().height);
- g.setColor(Color.darkGray);
- g.drawLine(0, 0, getBounds().width-1, 0);
- g.drawLine(0, 0, 0, getBounds().height-1);
- g.setColor(Color.white);
- g.drawLine(getBounds().width-1, 0, getBounds().width-1, getBounds().height-1);
- g.drawLine(0, getBounds().height-1, getBounds().width-1, getBounds().height-1);
- }
- public void paintStatus(Graphics g) {
- g.setColor(getStatusColor());
- Rectangle r= new Rectangle(0, 0, fProgressX, getBounds().height);
- g.fillRect(1, 1, r.width-1, r.height-2);
- }
- private void paintStep(int startX, int endX) {
- repaint(startX, 1, endX-startX, getBounds().height-2);
- }
- public void reset() {
- fProgressX= 1;
- fProgress= 0;
- fError= false;
- paint(getGraphics());
- }
- public int scale(int value) {
- if (fTotal > 0)
- return Math.max(1, value*(getBounds().width-1)/fTotal);
- return value;
- }
- public void setBounds(int x, int y, int w, int h) {
- super.setBounds(x, y, w, h);
- fProgressX= scale(fProgress);
- }
- public void start(int total) {
- fTotal= total;
- reset();
- }
- public void step(boolean successful) {
- fProgress++;
- int x= fProgressX;
-
- fProgressX= scale(fProgress);
-
- if (!fError && !successful) {
- fError= true;
- x= 1;
- }
- paintStep(x, fProgressX);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/TestRunner.java b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/TestRunner.java
deleted file mode 100644
index 2d667b4..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/TestRunner.java
+++ /dev/null
@@ -1,499 +0,0 @@
-package junit.ui;
-
-import junit.framework.*;
-import junit.util.*;
-
-import java.util.Vector;
-import java.lang.reflect.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-
-/**
- * A simple user interface to run tests.
- * Enter the name of a class with a suite method which should return
- * the tests to be run.
- * <pre>
- * Synopsis: java java.ui.TestRunner [TestCase]
- * </pre>
- * TestRunner takes as an optional argument the name of the testcase class to be run.
- */
-public class TestRunner extends Object implements TestListener {
- private Frame fFrame;
- private Vector fExceptions;
- private Vector fFailedTests;
- private Thread fRunner;
- private TestResult fTestResult;
- private TestSuiteLoader fTestLoader;
-
- private TraceFrame fTraceFrame;
-
- private TextField fSuiteField;
- private Button fRun;
- private ProgressBar fProgressIndicator;
- private List fFailureList;
- private Logo fLogo;
- private Label fNumberOfErrors;
- private Label fNumberOfFailures;
- private Label fNumberOfRuns;
- private Button fQuitButton;
- private Button fShowErrorButton;
- private Button fRerunButton;
- private TextField fStatusLine;
- private Panel fPanel;
-
- private static Font PLAIN_FONT= new Font("dialog", Font.PLAIN, 12);
- private static final int GAP= 4;
- private static final String SUITE_METHODNAME= "suite";
- public TestRunner() {
- }
- private void about() {
- AboutDialog about= new AboutDialog(fFrame);
- about.setModal(true);
- about.setLocation(300, 300);
- about.setVisible(true);
- }
- public void addError(Test test, Throwable t) {
- fNumberOfErrors.setText(Integer.toString(fTestResult.errorCount()));
- appendFailure("Error", test, t);
- }
- public void addFailure(Test test, Throwable t) {
- fNumberOfFailures.setText(Integer.toString(fTestResult.failureCount()));
- appendFailure("Failure", test, t);
- }
- private void addGrid(Panel p, Component co, int x, int y, int w, int fill, double wx, int anchor) {
- GridBagConstraints c= new GridBagConstraints();
- c.gridx= x; c.gridy= y;
- c.gridwidth= w;
- c.anchor= anchor;
- c.weightx= wx;
- c.fill= fill;
- if (fill == GridBagConstraints.BOTH || fill == GridBagConstraints.VERTICAL)
- c.weighty= 1.0;
- c.insets= new Insets(y == 0 ? GAP : 0, x == 0 ? GAP : 0, GAP, GAP);
- p.add(co, c);
- }
- private void appendFailure(String kind, Test test, Throwable t) {
- kind+= ": " + test;
- String msg= t.getMessage();
- if (msg != null) {
- kind+= ":" + StringUtil.truncate(msg, 100);
- }
- fFailureList.add(kind);
- fExceptions.addElement(t);
- fFailedTests.addElement(test);
- }
- /**
- * Creates the JUnit menu. Clients override this
- * method to add additional menu items.
- */
- protected Menu createJUnitMenu() {
- Menu menu = new Menu("JUnit");
- MenuItem mi = new MenuItem("About...");
- mi.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- about();
- }
- }
- );
- menu.add(mi);
-
- menu.addSeparator();
- mi = new MenuItem("Exit");
- mi.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- System.exit(0);
- }
- }
- );
- menu.add(mi);
-
- return menu;
- }
- protected void createMenus(MenuBar mb) {
- mb.add(createJUnitMenu());
- }
- protected TestResult createTestResult() {
- return new TestResult();
- }
- protected Frame createUI(String suiteName) {
- Frame frame= new Frame("Run Test Suite");
- Image icon= loadFrameIcon();
- if (icon != null)
- frame.setIconImage(icon);
-
- frame.setLayout(new BorderLayout(0, 0));
- frame.setBackground(SystemColor.control);
- final Frame finalFrame= frame;
-
- frame.addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- finalFrame.dispose();
- System.exit(0);
- }
- }
- );
-
- MenuBar mb = new MenuBar();
- createMenus(mb);
- frame.setMenuBar(mb);
-
- //---- first section
- Label suiteLabel= new Label("Enter the name of the TestCase class:");
-
- fSuiteField= new TextField(suiteName != null ? suiteName : "");
- fSuiteField.selectAll();
- fSuiteField.requestFocus();
- fSuiteField.setFont(PLAIN_FONT);
- fSuiteField.setColumns(40);
- fSuiteField.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- runSuite();
- }
- }
- );
- fSuiteField.addTextListener(
- new TextListener() {
- public void textValueChanged(TextEvent e) {
- fRun.setEnabled(fSuiteField.getText().length() > 0);
- fStatusLine.setText("");
- }
- }
- );
-
- Label suiteLabel2= new Label(".suite()");
-
- fRun= new Button("Run");
- fRun.setEnabled(false);
- fRun.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- runSuite();
- }
- }
- );
-
-
- //---- second section
- Label progressLabel= new Label("Progress:");
- fProgressIndicator= new ProgressBar();
-
- //---- third section
- fNumberOfErrors= new Label("0000", Label.RIGHT);
- fNumberOfErrors.setText("0");
- fNumberOfErrors.setFont(PLAIN_FONT);
-
- fNumberOfFailures= new Label("0000", Label.RIGHT);
- fNumberOfFailures.setText("0");
- fNumberOfFailures.setFont(PLAIN_FONT);
-
- fNumberOfRuns= new Label("0000", Label.RIGHT);
- fNumberOfRuns.setText("0");
- fNumberOfRuns.setFont(PLAIN_FONT);
-
- Panel numbersPanel= new Panel(new FlowLayout());
- numbersPanel.add(new Label("Runs:")); numbersPanel.add(fNumberOfRuns);
- numbersPanel.add(new Label(" Errors:")); numbersPanel.add(fNumberOfErrors);
- numbersPanel.add(new Label(" Failures:")); numbersPanel.add(fNumberOfFailures);
-
-
- //---- fourth section
- Label failureLabel= new Label("Errors and Failures:");
-
- fFailureList= new List(6);
- fFailureList.addMouseListener(
- new MouseAdapter() {
- public void mouseClicked(MouseEvent e) {
- if (e.getClickCount() >= 2)
- showErrorTrace();
- }
- }
- );
- fFailureList.addItemListener(
- new ItemListener() {
- public void itemStateChanged(ItemEvent e) {
- fShowErrorButton.setEnabled(isErrorSelected());
- fRerunButton.setEnabled(isErrorSelected());
- }
- }
- );
-
- fShowErrorButton= new Button("Show...");
- fShowErrorButton.setEnabled(false);
- fShowErrorButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- showErrorTrace();
- }
- }
- );
-
- fRerunButton= new Button("Run");
- fRerunButton.setEnabled(false);
- fRerunButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- rerun();
- }
- }
- );
-
- Panel failedPanel= new Panel(new GridLayout(0, 1, 0, 2));
- failedPanel.add(fShowErrorButton);
- failedPanel.add(fRerunButton);
-
- //---- fifth section
- fStatusLine= new TextField();
- fStatusLine.setFont(PLAIN_FONT);
- fStatusLine.setEditable(false);
- fStatusLine.setForeground(Color.red);
-
- fQuitButton= new Button("Exit");
- fQuitButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- System.exit(0);
- }
- }
- );
-
- // ---------
- fLogo= new Logo();
-
- //---- overall layout
- Panel panel= new Panel(new GridBagLayout());
- fPanel= panel;
-
- addGrid(panel, suiteLabel, 0, 0, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
-
- addGrid(panel, fSuiteField, 0, 1, 1, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, suiteLabel2, 1, 1, 1, GridBagConstraints.NONE, 0.0, GridBagConstraints.WEST);
- addGrid(panel, fRun, 2, 1, 1, GridBagConstraints.HORIZONTAL, 0.0, GridBagConstraints.CENTER);
-
- addGrid(panel, progressLabel, 0, 2, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, fProgressIndicator, 0, 3, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, fLogo, 2, 3, 1, GridBagConstraints.NONE, 0.0, GridBagConstraints.NORTH);
-
- addGrid(panel, numbersPanel, 0, 4, 2, GridBagConstraints.NONE, 0.0, GridBagConstraints.CENTER);
-
- addGrid(panel, failureLabel, 0, 5, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.WEST);
- addGrid(panel, fFailureList, 0, 6, 2, GridBagConstraints.BOTH, 1.0, GridBagConstraints.WEST);
- addGrid(panel, failedPanel, 2, 6, 1, GridBagConstraints.HORIZONTAL, 0.0, GridBagConstraints.CENTER);
-
- addGrid(panel, fStatusLine, 0, 7, 2, GridBagConstraints.HORIZONTAL, 1.0, GridBagConstraints.CENTER);
- addGrid(panel, fQuitButton, 2, 7, 1, GridBagConstraints.HORIZONTAL, 0.0, GridBagConstraints.CENTER);
-
- frame.add(panel);
-
- frame.pack();
- return frame;
- }
- public void endTest(Test test) {
- setLabelValue(fNumberOfRuns, fTestResult.runCount());
- fProgressIndicator.step(fTestResult.wasSuccessful());
- }
- private Test getTest(String suiteClassName) {
- if (suiteClassName.length() <= 0) {
- fStatusLine.setText("");
- return null;
- }
-
- Class testClass= null;
- try {
- testClass= loadSuiteClass(suiteClassName);
- } catch(Exception e) {
- runFailed("Class \""+suiteClassName+"\" not found");
- return null;
- }
-
- Method suiteMethod= null;
- try {
- suiteMethod= testClass.getMethod(SUITE_METHODNAME, new Class[0]);
- } catch(Exception e) {
- // try to extract a test suite automatically
- fStatusLine.setText("");
- return new TestSuite(testClass);
- }
-
- Test test= null;
- try {
- test= (Test)suiteMethod.invoke(null, new Class[0]); // static method
- if (test == null)
- return test;
- } catch(Exception e) {
- runFailed("Could not invoke the suite() method");
- return null;
- }
- fStatusLine.setText("");
- return test;
- }
- private boolean isErrorSelected() {
- return fFailureList.getSelectedIndex() != -1;
- }
- private Image loadFrameIcon() {
- Toolkit toolkit= Toolkit.getDefaultToolkit();
- try {
- java.net.URL url= getClass().getResource("smalllogo.gif");
- return toolkit.createImage((ImageProducer) url.getContent());
- } catch (Exception ex) {
- }
- return null;
- }
- protected Class loadSuiteClass(String suiteClassName) throws ClassNotFoundException {
- return fTestLoader.load(suiteClassName);
- }
- /**
- * main entrypoint
- */
- public static void main(String[] args) {
- new TestRunner().start(args, new StandardTestSuiteLoader());
- }
- private void rerun() {
- int index= fFailureList.getSelectedIndex();
- if (index == -1)
- return;
-
- Test test= (Test)fFailedTests.elementAt(index);
- if (!(test instanceof TestCase)) {
- showInfo("Could not reload "+ test.toString());
- return;
- }
- Test reloadedTest= null;
- try {
- Class reloadedTestClass= fTestLoader.reload(test.getClass());
- Class[] classArgs= { String.class };
- Constructor constructor= reloadedTestClass.getConstructor(classArgs);
- Object[] args= new Object[]{((TestCase)test).name()};
- reloadedTest=(Test)constructor.newInstance(args);
- } catch(Exception e) {
- showInfo("Could not reload "+ test.toString());
- return;
- }
- TestResult result= new TestResult();
- reloadedTest.run(result);
-
- String message= reloadedTest.toString();
- if(result.wasSuccessful())
- showInfo(message+" was successful");
- else if (result.errorCount() == 1)
- showStatus(message+" had an error");
- else
- showStatus(message+" had a failure");
- }
- protected void reset() {
- setLabelValue(fNumberOfErrors, 0);
- setLabelValue(fNumberOfFailures, 0);
- setLabelValue(fNumberOfRuns, 0);
- fProgressIndicator.reset();
- fShowErrorButton.setEnabled(false);
- fRerunButton.setEnabled(false);
- fFailureList.removeAll();
- fExceptions= new Vector(10);
- fFailedTests= new Vector(10);
- }
- /**
- * runs a suite.
- * @deprecated use runSuite() instead
- */
- public void run() {
- runSuite();
- }
- private void runFailed(String message) {
- showStatus(message);
- fRun.setLabel("Run");
- fRunner= null;
- }
- synchronized public void runSuite() {
- if (fRunner != null) {
- fTestResult.stop();
- } else {
- fRun.setLabel("Stop");
- showInfo("Initializing...");
- reset();
-
- showInfo("Load Test Case...");
- final Test testSuite= getTest(fSuiteField.getText());
- if (testSuite != null) {
- fRunner= new Thread() {
- public void run() {
- fTestResult= createTestResult();
- fTestResult.addListener(TestRunner.this);
- fProgressIndicator.start(testSuite.countTestCases());
- showInfo("Running...");
-
- long startTime= System.currentTimeMillis();
- testSuite.run(fTestResult);
-
- if (fTestResult.shouldStop()) {
- showStatus("Stopped");
- } else {
- long endTime= System.currentTimeMillis();
- long runTime= endTime-startTime;
- showInfo("Finished: " + StringUtil.elapsedTimeAsString(runTime) + " seconds");
- }
- fTestResult= null;
- fRun.setLabel("Run");
- fRunner= null;
- }
- };
- fRunner.start();
- }
- }
- }
- private void setLabelValue(Label label, int value) {
- label.setText(Integer.toString(value));
- }
- public void setSuiteName(String suite) {
- fSuiteField.setText(suite);
- }
- private void showErrorTrace() {
- int index= fFailureList.getSelectedIndex();
- if (index == -1)
- return;
-
- Throwable t= (Throwable) fExceptions.elementAt(index);
- if (fTraceFrame == null) {
- fTraceFrame= new TraceFrame();
- fTraceFrame.setLocation(100, 100);
- }
- fTraceFrame.showTrace(t);
- fTraceFrame.setVisible(true);
- }
- private void showInfo(String message) {
- fStatusLine.setFont(PLAIN_FONT);
- fStatusLine.setForeground(Color.black);
- fStatusLine.setText(message);
- }
- private void showStatus(String status) {
- fStatusLine.setFont(PLAIN_FONT);
- fStatusLine.setForeground(Color.red);
- fStatusLine.setText(status);
- }
- /**
- * Starts the TestRunner
- */
- public void start(String[] args, TestSuiteLoader loader) {
- fTestLoader= loader;
- String suiteName= null;
- if (args.length == 1)
- suiteName= args[0];
- else if (args.length == 2 && args[0].equals("-c"))
- suiteName= StringUtil.extractClassName(args[1]);
-
- fFrame= createUI(suiteName);
- fFrame.setLocation(200, 200);
- fFrame.setVisible(true);
-
- if (suiteName != null) {
- setSuiteName(suiteName);
- runSuite();
- }
- }
- public void startTest(Test test) {
- showInfo("Running: "+test);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/TraceFrame.java b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/TraceFrame.java
deleted file mode 100644
index cc53e65..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/TraceFrame.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package junit.ui;
-
-import java.io.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import junit.framework.*;
-import junit.util.*;
-
-class TraceFrame extends Frame {
- private Button fButton= null;
- private TextArea fTextArea= null;
- public TraceFrame() {
- setLayout(new GridBagLayout());
- setBackground(SystemColor.control);
- setSize(403, 236);
- setTitle("Stack Trace");
-
- fTextArea= new TextArea();
- fTextArea.setRows(10);
- fTextArea.setColumns(60);
-
- fButton= new Button("Close");
- fButton.addActionListener(
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- dispose();
- }
- }
- );
-
- GridBagConstraints constraintsStackTextArea = new GridBagConstraints();
- constraintsStackTextArea.gridx = 0; constraintsStackTextArea.gridy = 0;
- constraintsStackTextArea.gridwidth = 1; constraintsStackTextArea.gridheight = 1;
- constraintsStackTextArea.fill = GridBagConstraints.BOTH;
- constraintsStackTextArea.anchor = GridBagConstraints.CENTER;
- constraintsStackTextArea.weightx = 1.0;
- constraintsStackTextArea.weighty = 1.0;
- constraintsStackTextArea.insets = new Insets(8, 8, 8, 8);
- add(fTextArea, constraintsStackTextArea);
-
- GridBagConstraints constraintsCloseButton = new GridBagConstraints();
- constraintsCloseButton.gridx = 0; constraintsCloseButton.gridy = 1;
- constraintsCloseButton.gridwidth = 1; constraintsCloseButton.gridheight = 1;
- constraintsCloseButton.anchor = java.awt.GridBagConstraints.EAST;
- constraintsCloseButton.weightx = 0.0;
- constraintsCloseButton.weighty = 0.0;
- constraintsCloseButton.insets = new Insets(0, 8, 8, 8);
- add(fButton, constraintsCloseButton);
-
- addWindowListener(
- new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- dispose();
- }
- }
- );
-
- //{{INIT_CONTROLS
- setLayout(new BorderLayout(0,0));
- setBackground(java.awt.Color.orange);
- setSize(0,0);
- setVisible(false);
- //}}
- }
- /**
- * Shows the stack trace of the passed in throwable
- */
- public void showTrace(Throwable t) {
- StringWriter stringWriter= new StringWriter();
- PrintWriter writer= new PrintWriter(stringWriter);
- t.printStackTrace(writer);
- StringBuffer buffer= stringWriter.getBuffer();
- fTextArea.setText(StringUtil.truncate(buffer.toString(), 5000));
- }
- //{{DECLARE_CONTROLS
- //}}
- //{{DECLARE_MENUS
- //}}
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/logo.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/logo.gif
deleted file mode 100644
index d0e1547..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/logo.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/smalllogo.gif b/org.eclipse.jdt.ui.tests/JUnit/junit/ui/smalllogo.gif
deleted file mode 100644
index 7b25eaf..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/ui/smalllogo.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/util/ReloadingTestSuiteLoader.java b/org.eclipse.jdt.ui.tests/JUnit/junit/util/ReloadingTestSuiteLoader.java
deleted file mode 100644
index 5e51327..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/util/ReloadingTestSuiteLoader.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package junit.util;
-
-/**
- * A TestSuite loader that can reload classes.
- */
-public class ReloadingTestSuiteLoader implements TestSuiteLoader {
- public Class load(String suiteClassName) throws ClassNotFoundException {
- TestCaseClassLoader loader= new TestCaseClassLoader();
- return loader.loadClass(suiteClassName, true);
- }
- public Class reload(Class aClass) throws ClassNotFoundException {
- TestCaseClassLoader loader= new TestCaseClassLoader();
- return loader.loadClass(aClass.getName(), true);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/util/StandardTestSuiteLoader.java b/org.eclipse.jdt.ui.tests/JUnit/junit/util/StandardTestSuiteLoader.java
deleted file mode 100644
index 8a14e80..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/util/StandardTestSuiteLoader.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package junit.util;
-
-/**
- * The standard test suite loader. It can only load the same class once.
- */
-public class StandardTestSuiteLoader implements TestSuiteLoader {
- /**
- * Uses the system class loader to load the test class
- */
- public Class load(String suiteClassName) throws ClassNotFoundException {
- return Class.forName(suiteClassName);
- }
- /**
- * Uses the system class loader to load the test class
- */
- public Class reload(Class aClass) throws ClassNotFoundException {
- return aClass;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/util/StringUtil.java b/org.eclipse.jdt.ui.tests/JUnit/junit/util/StringUtil.java
deleted file mode 100644
index 26901b7..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/util/StringUtil.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package junit.util;
-
-import java.text.NumberFormat;
-
-/**
- * A class with junit related String utilities.
- */
-public class StringUtil {
- protected StringUtil() {
- }
- public static String elapsedTimeAsString(long runTime) {
- return NumberFormat.getInstance().format((double)runTime/1000);
- }
- public static String extractClassName(String className) {
- if(className.startsWith("Default package for"))
- return className.substring(className.lastIndexOf(".")+1);
- return className;
- }
- static public String truncate(String s, int length) {
- if (s.length() > length)
- s= s.substring(0, length)+"...";
- return s;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/util/TestCaseClassLoader.java b/org.eclipse.jdt.ui.tests/JUnit/junit/util/TestCaseClassLoader.java
deleted file mode 100644
index 8d1db50..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/util/TestCaseClassLoader.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package junit.util;
-
-import java.util.*;
-import java.io.*;
-/**
- * A custom class loader which enables the reloading
- * of classes for each test run. The class loader
- * can be configured with a list of package paths that
- * should be excluded from loading. The loading
- * of these packages is delegated to the system class
- * loader. They will be shared across test runs.
- * <p>
- * The list of excluded package paths is specified in
- * a properties file "excluded.properties" that is located in
- * the same place as the TestCaseClassLoader class.
- * <p>
- * <b>Known limitation:</b> the TestCaseClassLoader cannot load classes
- * from jar files.
- */
-
-
-public class TestCaseClassLoader extends ClassLoader {
- /** scanned class path */
- private String[] fPathItems;
- /** excluded paths */
- private String[] fExcluded= { "com.sun.", "sun."};
- /** name of excluded properties file */
- static final String EXCLUDED_FILE= "excluded.properties";
- /**
- * Constructs a TestCaseLoader. It scans the class path
- * and the excluded package paths
- */
- public TestCaseClassLoader() {
- super();
- String classPath= System.getProperty("java.class.path");
- String separator= System.getProperty("path.separator");
-
- // first pass: count elements
- StringTokenizer st= new StringTokenizer(classPath, separator);
- int i= 0;
- while (st.hasMoreTokens()) {
- st.nextToken();
- i++;
- }
- // second pass: split
- fPathItems= new String[i];
- st= new StringTokenizer(classPath, separator);
- i= 0;
- while (st.hasMoreTokens()) {
- fPathItems[i++]= st.nextToken();
- }
-
- String[] excluded= readExcludedPackages();
- if (excluded != null)
- fExcluded= excluded;
- }
- public java.net.URL getResource(String name) {
- return ClassLoader.getSystemResource(name);
- }
- public InputStream getResourceAsStream(String name) {
- return ClassLoader.getSystemResourceAsStream(name);
- }
- protected boolean isExcluded(String name) {
- // exclude the "java" and "junit" packages.
- // They always need to be excluded so that they are loaded by the system class loader
- if (name.startsWith("java.") ||
- name.startsWith("junit.framework") ||
- name.startsWith("junit.extensions") ||
- name.startsWith("junit.util") ||
- name.startsWith("junit.ui"))
- return true;
-
- // exclude the user defined package paths
- for (int i= 0; i < fExcluded.length; i++) {
- if (name.startsWith(fExcluded[i])) {
- return true;
- }
- }
- return false;
- }
- public synchronized Class loadClass(String name, boolean resolve)
- throws ClassNotFoundException {
-
- Class c= findLoadedClass(name);
- if (c != null)
- return c;
- //
- // Delegate the loading of excluded classes to the
- // standard class loader.
- //
- if (isExcluded(name)) {
- try {
- c= findSystemClass(name);
- return c;
- } catch (ClassNotFoundException e) {
- // keep searching
- }
- }
- if (c == null) {
- File file= locate(name);
- if (file == null)
- throw new ClassNotFoundException();
- byte data[]= loadClassData(file);
- c= defineClass(name, data, 0, data.length);
- }
- if (resolve)
- resolveClass(c);
- return c;
- }
- private byte[] loadClassData(File f) throws ClassNotFoundException {
- try {
- //System.out.println("loading: "+f.getPath());
- FileInputStream stream= new FileInputStream(f);
-
- try {
- byte[] b= new byte[stream.available()];
- stream.read(b);
- stream.close();
- return b;
- }
- catch (IOException e) {
- throw new ClassNotFoundException();
- }
- }
- catch (FileNotFoundException e) {
- throw new ClassNotFoundException();
- }
- }
- /**
- * Locate the given file.
- * @return Returns null if file couldn't be found.
- */
- private File locate(String fileName) {
- fileName= fileName.replace('.', '/')+".class";
- File path= null;
-
- if (fileName != null) {
- for (int i= 0; i < fPathItems.length; i++) {
- path= new File(fPathItems[i], fileName);
- if (path.exists())
- return path;
- }
- }
- return null;
- }
- private String[] readExcludedPackages() {
- InputStream is= getClass().getResourceAsStream(EXCLUDED_FILE);
- if (is == null)
- return null;
- Properties p= new Properties();
- try {
- p.load(is);
- }
- catch (IOException e) {
- return null;
- }
- Vector v= new Vector(10);
- for (Enumeration e= p.propertyNames(); e.hasMoreElements(); ) {
- String key= (String)e.nextElement();
- if (key.startsWith("excluded.")) {
- String path= p.getProperty(key);
- if (path.endsWith("*"))
- path= path.substring(0, path.length()-1);
- if (path.length() > 0)
- v.addElement(path);
- }
- }
- String[] excluded= new String[v.size()];
- for (int i= 0; i < v.size(); i++)
- excluded[i]= (String)v.elementAt(i);
- return excluded;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/util/TestSuiteLoader.java b/org.eclipse.jdt.ui.tests/JUnit/junit/util/TestSuiteLoader.java
deleted file mode 100644
index ac98c07..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/util/TestSuiteLoader.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package junit.util;
-
-/**
- * An interface to define how a test suite should be loaded.
- */
-public interface TestSuiteLoader {
- abstract public Class load(String suiteClassName) throws ClassNotFoundException;
- abstract public Class reload(Class aClass) throws ClassNotFoundException;
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/JUnit/junit/util/Version.java b/org.eclipse.jdt.ui.tests/JUnit/junit/util/Version.java
deleted file mode 100644
index 6bd251b..0000000
--- a/org.eclipse.jdt.ui.tests/JUnit/junit/util/Version.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package junit.util;
-
-/**
- * This class defines the current version of JUnit
- */
-public class Version {
- private Version() {
- // don't instantiate
- }
-
- public static String id() {
- return "3.2";
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/plugin.jars b/org.eclipse.jdt.ui.tests/plugin.jars
deleted file mode 100644
index d43194c..0000000
--- a/org.eclipse.jdt.ui.tests/plugin.jars
+++ /dev/null
@@ -1,5 +0,0 @@
-javacoretests.jar=\
- Test Plugin,\
- JUnit,\
- Refactoring Tests,\
- Java UI Tests
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/plugin.xml b/org.eclipse.jdt.ui.tests/plugin.xml
deleted file mode 100644
index 08c7aa6..0000000
--- a/org.eclipse.jdt.ui.tests/plugin.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<plugin
- name="Java Test Plugin"
- id="org.eclipse.jdt.testplugin"
- version="1.0"
- vendor-name="IBM"
- class="org.eclipse.jdt.testplugin.JavaTestPlugin">
-
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.apache.xerces"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- <import plugin="org.eclipse.jdt.ui"/>
- </requires>
-
-<runtime>
- <library name="javauitests.jar" >
- <export name = "*"/>
- </library>
-</runtime>
-
-<extension id="test" point="org.eclipse.core.runtime.applications">
- <application>
- <run class="org.eclipse.jdt.testplugin.ui.JavaTestUIApplication">
- </run>
- </application>
-</extension>
-
-
-</plugin>
diff --git a/org.eclipse.jdt.ui.tests/refactoring/MoveCu.txt b/org.eclipse.jdt.ui.tests/refactoring/MoveCu.txt
deleted file mode 100644
index 42bb4d3..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/MoveCu.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-
- Move cu to another package (same project)
- /SIMPLEST POSSIBLE IMPLEMENTATION - NO SMARTNESS INVOLVED/
-
- arguments:
- cu,
- newNackage
-
- preconditions:
- 1. cu.name must not exist in newPackage
- 2. none of the cu.topLevelTypes must exist in newPackage
- 3. there must not be a main method in any of the cu.topLevelTypes
- (or is cu.publicType enough?)
- 4. there must not be a native method declared in _any_ of the types declared
- in cu.
- 5. none of cu.topLevelTypes must be used os a parameter of a native method
- 6. this could be more smart (i'll be more restrictive for a start):
- - in new package there can be no type (toplevel or nested) with any of cu.types names
- 7. there must no be references (outside of cu) to package-visibles members in cu
- 8. inside the cu there must not be any references to package-visible java elements from other cus
- 9. inside the cu all references to protected java elements from other cus in this package must be
- visible from other packages
- 10. other cus in the same package can reference protected java elements from cu only if these references
- are in corresponding sub-hierarchies (blah, blah - rewrite)
-
- changes:
- 1. move the cu
- - java model does: package declaration change
- 2. remove imports of types from newPackage (optional)
- 3. add import cu.package; to cu (if it's not already there)
- possible improvement: check if this import is really needed
- /however, imports on demand *almost* never harmful/
- 4. change all fully qualified references to types in cu to the new ones.
- (this, of course, does not solve the problem with non-uniqueness of fully
- qualified type names)
- 5. add import newPackage.*; to all cus (outside of cu.package) that referenced cu.publicType
- . only add the import if it's not already there
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/TODO.txt b/org.eclipse.jdt.ui.tests/refactoring/TODO.txt
deleted file mode 100644
index d3bfeda..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/TODO.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-(random order)
-
-. order TODO list according to importance
-. see the comment in RenameProvateMethodRefactoring.isVisible
- (does it mean the tests are unreliable and we have to test things manually?)
- (it's a bug, but where?)
-. find better names for renameMethod classes, actions and wizards
-. nls
-. unify the method names in UndoManager
-. support for 'scripts':
- .after you do a series of refactorings you can dump the refactoring stack
- and perform the same series on another mashine, for instance, from the generated 'script'
-
-UI
-? add change log action
-? drag and drop support for move type/method/field
-
-OTHER REFACTORINGS
- more interesting
- . inline temp
- . abstract method in superclass
- . move type
- . push down method
- . pull up method
- . inner-type rename
- . split class (insert a new class into the hierarchy)
- . pull up field
- less interesting
- . make class abstract/non-abstract
- . convert temp to query
- . change the access qualifier of a type/method/field
- . move method
- . add a method parameter
- . push down field
- . abstract field
- . reorder type members
- . make type non/final
-
-TESTS
- .rework tests - lots of duplicated code in helper methods
- .tests for method renaming and inner type issues
- .tests showing that StubUtility.findMethod uses declared type names, not fully qualified ones
- .tests for refactorings performed on multiple files in multiple packages
- .overloading and methodRename
-
-ORG.ECLIPSE.JDT.REFACTORING.CHANGES ISSUES
-. what level of abstraction should the changes be?
- .for instance: should there be RemoveClassChange or only TextSubstitute?
-
-SPECIFIC REFACTORING ISSUES
-
- SAFE DELETE METHOD REFACTORING
- . in case of virtual methods - do we remove all the hierarchy?
-
- SAFE DELETE TYPE REFACTORING
- . do we delete a type/method if it refers to itself (and nobody else)?
- . should there be SafeDeleteRefactoring class?
- (and SafeRenameMethod/Type would be its subclasses)
- .if the type is top level and there's no other type in that cu the cu should be removed
- (option maybe)
- (or create SafeRemoveCompilationUnitRefactoring)
-
- RENAME METHOD REFACTORING
- . MUST unify the way we look for methods that have to be renamed
- now the logic is duplicated heavily
- . the working copy business
- . overloading issues
- . how do ensure that at most one 'rename method' menu item shows up when ou rightclick?
diff --git a/org.eclipse.jdt.ui.tests/refactoring/experiments/AbstractFieldRefactoring.java b/org.eclipse.jdt.ui.tests/refactoring/experiments/AbstractFieldRefactoring.java
deleted file mode 100644
index eda5891..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/experiments/AbstractFieldRefactoring.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package experiments;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.core.refactoring.Assert;
-import org.eclipse.jdt.internal.core.refactoring.NullChange;
-import org.eclipse.jdt.internal.core.refactoring.base.IChange;
-import org.eclipse.jdt.internal.core.refactoring.base.Refactoring;
-import org.eclipse.jdt.internal.core.refactoring.base.RefactoringStatus;
-import org.eclipse.jdt.internal.core.refactoring.text.ITextBufferChangeCreator;
-
-/*
- * The following should be cofigurable:
- * .change field access modifier. default: leave unchanged
- * .create accessor
- * .create setter
- * .create getter
- * .create both (default)
- * .getter and setter access modifiers (default: same as field)
- * .getter and setter names (default: getX, setX, where X is getField().getElementName())
- * .use asymetric assignment (no default, must set in constructor)
- */
-
-//XXX should be a subclass of FieldRefactoring
-public class AbstractFieldRefactoring extends Refactoring {
-
- public static final int PRIVATE= 0;
- public static final int DEFAULT= 1;
- public static final int PROTECTED= 2;
- public static final int PUBLIC= 3;
-
- private boolean fCreateGetter= true;
- private boolean fCreateSetter= true;
- private int fGetterModifier;
- private int fSetterModifier;
- private String fGetterName;
- private String fSetterName;
- private boolean fAsymetricAssignment;
-
- private ITextBufferChangeCreator fTextBufferChangeCreator;
-
- private IField fField;
-
- public AbstractFieldRefactoring(ITextBufferChangeCreator changeCreator, IField field, boolean useAsymetricAssignement){
- fField= field;
- fTextBufferChangeCreator= changeCreator;
- Assert.isNotNull(changeCreator, "change creator"); //$NON-NLS-1$
- Assert.isTrue(field.exists(), "field must exist");
- setDefaults();
- correctScope();
- }
-
- public final IField getField() {
- return fField;
- }
-
- /* XXX: copied from RenameField
- * narrow down the scope
- */
- private void correctScope(){
- if (getField().isBinary())
- return;
- try{
- //only the declaring compilation unit
- if (Flags.isPrivate(getField().getFlags()))
- setScope(SearchEngine.createJavaSearchScope(new IResource[]{getResource(getField())}));
- } catch (JavaModelException e){
- //do nothing
- }
- }
-
- // --- framework methods
-
- public RefactoringStatus checkInput(IProgressMonitor pm) throws JavaModelException {
- RefactoringStatus result= new RefactoringStatus();
- //if (fCreateGetter)
- // result.merge(checkGetterName());
- //if (fCreateSetter)
- // result.merge(checkSetterName());
- return result;
- }
-
- public RefactoringStatus checkActivation(IProgressMonitor pm) throws JavaModelException {
- return new RefactoringStatus();
- }
-
- public IChange createChange(IProgressMonitor pm) throws JavaModelException {
- return new NullChange();
- }
-
- public String getName() {
- return "Abstract Field: " + getField().getElementName();
- }
-
- //-- customize methods
-
- public void setCreateGetter(boolean create){
- fCreateSetter= create;
- Assert.isTrue(fCreateGetter || fCreateSetter, "must create getter or setter");
- }
-
- public void setCreateSetter(boolean create){
- fCreateSetter= create;
- Assert.isTrue(fCreateGetter || fCreateSetter, "must create getter or setter");
- }
-
- public boolean getCreateGetter(){
- return fCreateGetter;
- }
-
- public boolean getCreateSetter(){
- return fCreateSetter;
- }
-
- public void setGetterModifier(int modifier){
- Assert.isTrue(fCreateGetter, "setting getter modifier not possible");
- Assert.isTrue(modifier == PRIVATE || modifier == DEFAULT || modifier == PROTECTED || modifier == PUBLIC, "incorrect acces modifier");
- fGetterModifier= modifier;
- }
-
- public void setSetterModifier(int modifier){
- Assert.isTrue(fCreateSetter, "setting setter modifier not possible");
- Assert.isTrue(modifier == PRIVATE || modifier == DEFAULT || modifier == PROTECTED || modifier == PUBLIC, "incorrect acces modifier");
- fSetterModifier= modifier;
- }
-
- public int getGetterModifier() {
- return fGetterModifier;
- }
-
- public int getSetterModifier() {
- return fSetterModifier;
- }
-
- public String getGetterName() {
- return fGetterName;
- }
-
- public void setGetterName(String getterName) {
- Assert.isNotNull(getterName);
- fGetterName = getterName;
- }
-
- public String getSetterName() {
- return fSetterName;
- }
-
- public void setSetterName(String setterName) {
- Assert.isNotNull(setterName);
- fSetterName = setterName;
- }
-
- //---
- private void setDefaults(){
- fCreateGetter= true;
- fCreateSetter= true;
- fGetterName= "get" + upperCaseFirstChar(getField().getElementName());
- fSetterName= "set" + upperCaseFirstChar(getField().getElementName());
- try{
- fGetterModifier= getFlagConst(getField().getFlags());
- fSetterModifier= getFlagConst(getField().getFlags());
- }catch (JavaModelException e){
- //XXX
- }
- }
-
- private static int getFlagConst(int flag){
- if (Flags.isPrivate(flag))
- return PRIVATE;
- if (Flags.isProtected(flag))
- return PROTECTED;
- if (Flags.isPublic(flag))
- return PUBLIC;
- return DEFAULT;
- }
-
- private static String upperCaseFirstChar(String s){
- if ("".equals(s))
- return s;
- if (Character.isUpperCase(s.charAt(0)))
- return s;
- return Character.toLowerCase(s.charAt(0)) +
- (s.length() == 1 ? "": s.substring(1));
- }
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/experiments/MyAction.java b/org.eclipse.jdt.ui.tests/refactoring/experiments/MyAction.java
deleted file mode 100644
index bd14812..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/experiments/MyAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package experiments;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/*
- Action Used for to get something running quickly
-
- you should add this stuff to plugin.xml
-
-<extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.jdt.core.ICompilationUnit"
- id="org.eclipse.jdt.internal.ui.nls">
- <action
- label="MyAction"
- class="experiments.MyAction"
- menubarPath="additions"
- enablesFor="1"
- id="MyAction">
- </action>
- </objectContribution>
-</extension>
-*/
-public class MyAction implements IWorkbenchWindowActionDelegate {
-
- public void dispose() {
- }
- public void init(IWorkbenchWindow window) {
- }
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- }
-
- protected IStructuredSelection getSelection() {
- IWorkbenchWindow window= JavaPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- ISelection selection= window.getSelectionService().getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
- }
- return null;
- }
-
- private ICompilationUnit getCompilationUnit(IStructuredSelection selection) {
- if (selection == null)
- return null;
- return (ICompilationUnit)selection.getFirstElement();
- }
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterASTAnalyzer.java b/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterASTAnalyzer.java
deleted file mode 100644
index e7e2bde..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterASTAnalyzer.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package experiments;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jdt.internal.compiler.ast.*;
-import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
-import org.eclipse.jdt.internal.core.refactoring.AbstractRefactoringASTAnalyzer;
-import org.eclipse.jdt.internal.core.refactoring.Assert;
-import org.eclipse.jdt.internal.core.refactoring.SearchResult;
-
-class ReorderParameterASTAnalyzer extends AbstractRefactoringASTAnalyzer {
-
- private List fSearchResults;
-
- ReorderParameterASTAnalyzer(List searchResults){
- fSearchResults= searchResults;
- }
-
- private boolean isStartPositionOnList(int start){
- for (Iterator iter=fSearchResults.iterator(); iter.hasNext();){
- SearchResult sr= (SearchResult)iter.next();
- if (sr.getStart() == start)
- return true;
- };
- return false;
- }
-
- private boolean isOurMethod(MessageSend messageSend){
- return isStartPositionOnList((int) (messageSend.nameSourcePosition >> 32));
- }
-
- private static boolean canAnyHaveSideEffects(Expression[] ex){
- if (ex == null)
- return false;
- for (int i= 0; i < ex.length; i++){
- if (ex[i] != null && canHaveSideEffects(ex[i]))
- return true;
- }
- return false;
- }
-
- /**
- * returns true if the expression has for sure safe no side effects
- */
- private static boolean canHaveSideEffects(Expression ex){
- if (ex == null)
- return false;
-
- if (ex instanceof AllocationExpression)
- return true;
-
- if (ex instanceof ArrayAllocationExpression)
- return canAnyHaveSideEffects(((ArrayAllocationExpression)ex).dimensions);
-
- if (ex instanceof ArrayInitializer)
- return canAnyHaveSideEffects(((ArrayInitializer)ex).expressions);
-
- if (ex instanceof Assignment)
- return canHaveSideEffects(((Assignment)ex).expression);
-
- if (ex instanceof CastExpression)
- return canHaveSideEffects(((CastExpression)ex).expression);
-
- if (ex instanceof ClassLiteralAccess)
- return false;
-
- if (ex instanceof Literal)
- return false;
-
- if (ex instanceof MessageSend)
- return true;
-
- if (ex instanceof BinaryExpression){
- return canHaveSideEffects(((BinaryExpression)ex).left)
- || canHaveSideEffects(((BinaryExpression)ex).right);
- }
-
- if (ex instanceof ConditionalExpression){
- return canHaveSideEffects(((ConditionalExpression)ex).condition)
- || canHaveSideEffects(((ConditionalExpression)ex).valueIfTrue)
- || canHaveSideEffects(((ConditionalExpression)ex).valueIfFalse);
- }
-
- if (ex instanceof InstanceOfExpression)
- return canHaveSideEffects(((InstanceOfExpression)ex).expression);
-
- if (ex instanceof UnaryExpression)
- return canHaveSideEffects(((UnaryExpression)ex).expression);
-
- if (ex instanceof ArrayReference){
- return canHaveSideEffects(((ArrayReference)ex).receiver)
- || canHaveSideEffects(((ArrayReference)ex).position);
- }
-
- if (ex instanceof FieldReference)
- return canHaveSideEffects(((FieldReference)ex).receiver);
-
- if (ex instanceof NameReference)
- return false;
-
- if (ex instanceof ThisReference)
- return false;
-
- if (ex instanceof TypeReference)
- return false;
-
- return true;
- }
-
- private void analyzeArgument(Expression ex){
- if (canHaveSideEffects(ex))
- addError("Expression used in method invocation in line:" + getLineNumber(ex) + " may have side effects. If it does, reordering the parameters will modify your program's behavior");
- }
-
- //------- visit methods
- public boolean visit(MessageSend messageSend, BlockScope scope) {
- if (! isOurMethod(messageSend))
- return true;
- Assert.isTrue(messageSend.arguments != null, "analyzed method must have arguments");
- for (int i= 0; i < messageSend.arguments.length; i++)
- analyzeArgument(messageSend.arguments[i]);
- return true;
- }
-
-
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterMoveFinder.java b/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterMoveFinder.java
deleted file mode 100644
index 92c0411..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParameterMoveFinder.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package experiments;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.compiler.AbstractSyntaxTreeVisitorAdapter;
-import org.eclipse.jdt.internal.compiler.ast.MessageSend;
-import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
-import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
-import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
-import org.eclipse.jdt.internal.core.CompilationUnit;
-import org.eclipse.jdt.internal.core.refactoring.AbstractRefactoringASTAnalyzer;
-import org.eclipse.jdt.internal.core.refactoring.DebugUtils;
-import org.eclipse.jdt.internal.core.refactoring.SearchResult;
-
-class ReorderParameterMoveFinder extends AbstractSyntaxTreeVisitorAdapter {
-
- private List fRegionsFound;
- private List fSearchResults;
-
- /**
- * returns List of TextRegion[]
- */
- List findParameterRegions(List searchResults, ICompilationUnit cu) throws JavaModelException{
- fSearchResults= searchResults;
- fRegionsFound= new ArrayList();
- ((CompilationUnit)cu).accept(this);
- return fRegionsFound;
- }
-
- private static TextRegion[] createRegionsArray(MessageSend messageSend){
- TextRegion[] result= new TextRegion[messageSend.arguments.length];
- for (int i= 0; i < result.length; i++){
- int length= messageSend.arguments[i].sourceEnd() - messageSend.arguments[i].sourceStart() + 1;
- result[i]= new TextRegion(messageSend.arguments[i].sourceStart(), length);
- }
- return result;
- }
-
- private static TextRegion[] createRegionsArray(MethodDeclaration methodDeclaration){
- TextRegion[] result= new TextRegion[methodDeclaration.arguments.length];
- for (int i= 0; i < result.length; i++){
- int length= methodDeclaration.arguments[i].sourceEnd() - methodDeclaration.arguments[i].sourceStart() + 1;
- result[i]= new TextRegion(methodDeclaration.arguments[i].sourceStart(), length);
- }
- return result;
- }
-
- private boolean isStartPositionOnList(int start){
- for (Iterator iter=fSearchResults.iterator(); iter.hasNext();){
- SearchResult sr= (SearchResult)iter.next();
- if (sr.getStart() == start)
- return true;
- };
- return false;
- }
-
- private boolean isOurMethod(MessageSend messageSend){
- return isStartPositionOnList((int) (messageSend.nameSourcePosition >> 32));
- }
-
- private boolean isOurMethod(MethodDeclaration methodDeclaration){
- return isStartPositionOnList(methodDeclaration.sourceStart());
- }
-
- //------visit methods
-
- public boolean visit(MessageSend messageSend, BlockScope scope) {
- if (isOurMethod(messageSend))
- fRegionsFound.add(createRegionsArray(messageSend));
- return true;
- }
-
- public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
- if (isOurMethod(methodDeclaration))
- fRegionsFound.add(createRegionsArray(methodDeclaration));
- return true;
- }
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParametersRefactoring.java b/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParametersRefactoring.java
deleted file mode 100644
index 2c156ef..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/experiments/ReorderParametersRefactoring.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/experiments/TextRegion.java b/org.eclipse.jdt.ui.tests/refactoring/experiments/TextRegion.java
deleted file mode 100644
index 796a8f8..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/experiments/TextRegion.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package experiments;
-
-import org.eclipse.jdt.internal.core.refactoring.text.ITextRegion;
-
-class TextRegion implements ITextRegion {
-
- public int offset;
- public int length;
-
- TextRegion(int offset, int length){
- this.offset= offset;
- this.length= length;
- }
-
- /**
- * @see ITextRegion#getOffset()
- */
- public int getOffset() {
- return offset;
- }
-
- /**
- * @see ITextRegion#getLength()
- */
- public int getLength() {
- return length;
- }
-
- //debugging only
- public String toString() {
- StringBuffer buffer = new StringBuffer();
- buffer.append("[offset=");
- buffer.append(this.offset);
- buffer.append(", length=");
- buffer.append(this.length);
- buffer.append("]");
- return buffer.toString();
- }
-
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AbstractFieldTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AbstractFieldTests.java
deleted file mode 100644
index e03a89a..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AbstractFieldTests.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.core.refactoring.base.IRefactoring;
-import org.eclipse.jdt.internal.core.refactoring.base.RefactoringStatus;
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.TestPluginUILauncher;
-
-import experiments.AbstractFieldRefactoring;
-
-public class AbstractFieldTests extends RefactoringTest {
-
- private static final String REFACTORING_PATH= "AbstractField/";
-
- public AbstractFieldTests(String name) {
- super(name);
- }
-
- protected String getRefactoringPath() {
- return REFACTORING_PATH;
- }
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), AbstractFieldTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(noSetupSuite());
- return new JavaTestSetup(suite);
- }
-
- public static Test noSetupSuite() {
- return new TestSuite(AbstractFieldTests.class);
- }
-
- private String getSimpleTestFileName(boolean canReorder, boolean input){
- String fileName = "A_" + name();
- if (canReorder)
- fileName += input ? "_in": "_out";
- return fileName + ".java";
- }
-
- private String getTestFileName(boolean canReorder, boolean input){
- String fileName= TEST_PATH_PREFIX + getRefactoringPath();
- fileName += (canReorder ? "can/": "cannot/");
- return fileName + getSimpleTestFileName(canReorder, input);
- }
-
- private String getPassingTestFileName(boolean input){
- return getTestFileName(true, input);
- }
-
- protected ICompilationUnit createCUfromTestFile(IPackageFragment pack, boolean canRename, boolean input) throws Exception {
- return createCU(pack, getSimpleTestFileName(canRename, input), getFileContents(getTestFileName(canRename, input)));
- }
-
- private AbstractFieldRefactoring createRefactoring(IField field, boolean createGetter, boolean createSetter, int getterModifier, int setterModifier,
- String getterName, String setterName, boolean asymetric){
- AbstractFieldRefactoring ref= new AbstractFieldRefactoring(fgChangeCreator, field, asymetric);
- ref.setCreateGetter(createGetter);
- ref.setCreateSetter(createSetter);
- ref.setGetterModifier(getterModifier);
- ref.setSetterModifier(setterModifier);
- ref.setGetterName(getterName);
- ref.setSetterName(setterName);
- return ref;
- }
-
- private void helper1(String fieldName, boolean createGetter, boolean createSetter, int getterModifier, int setterModifier,
- String getterName, String setterName, boolean asymetric) throws Exception{
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), true, true);
- IType classA= getType(cu, "A");
-
- IRefactoring ref= createRefactoring(classA.getField(fieldName), createGetter,
- createSetter, getterModifier, setterModifier, getterName, setterName, asymetric);
-
- RefactoringStatus result= performRefactoring(ref);
- assertEquals("precondition was supposed to pass", null, result);
-
- IPackageFragment pack= (IPackageFragment)cu.getParent();
- String newCuName= getSimpleTestFileName(true, true);
- ICompilationUnit newcu= pack.getCompilationUnit(newCuName);
- assert(newCuName + " does not exist", newcu.exists());
- assertEquals("invalid renaming", getFileContents(getTestFileName(true, false)), newcu.getSource());
- }
-
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AllRefactoringTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AllRefactoringTests.java
deleted file mode 100644
index 0ff3270..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/AllRefactoringTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ExtractMethodTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ExtractMethodTests.java
deleted file mode 100644
index 6a63272..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ExtractMethodTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/MoveCUTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/MoveCUTests.java
deleted file mode 100644
index 72876d1..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/MoveCUTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/NullRefactoring.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/NullRefactoring.java
deleted file mode 100644
index 17acaca..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/NullRefactoring.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.jdt.internal.core.refactoring.base.IChange;
-import org.eclipse.jdt.internal.core.refactoring.base.IRefactoring;
-import org.eclipse.jdt.internal.core.refactoring.base.RefactoringStatus;
-
-import org.eclipse.jdt.internal.core.refactoring.NullChange;
-
-/**
- * useful for tests
- */
-public class NullRefactoring implements IRefactoring {
-
- public IChange createChange(IProgressMonitor pm){
- pm.beginTask("", 1);
- pm.worked(1);
- pm.done();
- return new NullChange("NullRefactoring");
- }
-
- public RefactoringStatus checkPreconditions(IProgressMonitor pm){
- pm.beginTask("", 1);
- pm.worked(1);
- pm.done();
- return new RefactoringStatus();
- }
-
- public String getName(){
- return "Null Refactoring";
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/PathTransformationTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/PathTransformationTests.java
deleted file mode 100644
index d4157a3..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/PathTransformationTests.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.jdt.internal.core.refactoring.RenameResourceChange;
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.TestPluginUILauncher;
-
-public class PathTransformationTests extends TestCase {
-
- public PathTransformationTests(String name) {
- super(name);
- }
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), PathTransformationTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(noSetupSuite());
- return new JavaTestSetup(suite);
- }
-
- public static Test noSetupSuite() {
- return new TestSuite(PathTransformationTests.class);
- }
-
-/************/
- private IPath createIPath(String p){
- return Path.EMPTY.append(p);
- }
-
- private void check(String path, String oldName, String newName){
- IPath pOld= createIPath(path + "/" + oldName);
- String extension= "";
- if (oldName.lastIndexOf(".") != -1)
- extension= oldName.substring(oldName.lastIndexOf("."));
- IPath pNew= createIPath(path + "/" + newName + extension);
- IPath newPath= RenameResourceChange.renamedResourcePath(pOld, newName);
-
- assertEquals(pNew.toString(), newPath.toString());
- }
-
-/************/
-
- public void test0(){
- check("/s/p", "A.java", "B");
- }
-
- public void test1(){
- check("/s/p", "A.java", "A");
- }
-
- public void test2(){
- check("/s/p", "A.txt", "B");
- }
-
- public void test3(){
- check("/s/p", "A", "B");
- }
-
- public void test4(){
- check("/s/p/p", "A.java", "B");
- }
-
- public void test5(){
- check("/s/p/p", "A.java", "A");
- }
-
- public void test6(){
- check("/s/p/p", "A.txt", "B");
- }
-
- public void test7(){
- check("/s", "A", "B");
- }
-
- public void test8(){
- check("/s", "A.java", "B");
- }
-
- public void test9(){
- check("/s", "A.java", "A");
- }
-
- public void test10(){
- check("/s", "A.txt", "B");
- }
-
- public void test11(){
- check("/s", "A", "B");
- }
-
- public void test12(){
- check("", "A.java", "B");
- }
-
- public void test13(){
- check("", "A.java", "A");
- }
-
- public void test14(){
- check("", "A.txt", "B");
- }
-
- public void test15(){
- check("", "A", "B");
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RefactoringTest.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RefactoringTest.java
deleted file mode 100644
index 5423c13..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RefactoringTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameFieldTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameFieldTests.java
deleted file mode 100644
index a44190c..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameFieldTests.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.TestPluginUILauncher;
-
-public class RenameFieldTests {
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), RenameFieldTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(RenameNonPrivateFieldTests.noSetupSuite());
- suite.addTest(RenamePrivateFieldTests.noSetupSuite());
- return new JavaTestSetup(suite);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodInInterfaceTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodInInterfaceTests.java
deleted file mode 100644
index 2e4df71..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodInInterfaceTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodTests.java
deleted file mode 100644
index c50e76e..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameMethodTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.*;
-
-public class RenameMethodTests {
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), RenameMethodTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(RenameVirtualMethodInClassTests.noSetupSuite());
- suite.addTest(RenameMethodInInterfaceTests.noSetupSuite());
- suite.addTest(RenamePrivateMethodTests.noSetupSuite());
- suite.addTest(RenameStaticMethodTests.noSetupSuite());
- return new JavaTestSetup(suite);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameNonPrivateFieldTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameNonPrivateFieldTests.java
deleted file mode 100644
index 67c0776..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameNonPrivateFieldTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePackageTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePackageTests.java
deleted file mode 100644
index 72e90f6..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePackageTests.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.internal.core.refactoring.base.IRefactoring;
-import org.eclipse.jdt.internal.core.refactoring.base.RefactoringStatus;
-import org.eclipse.jdt.internal.core.refactoring.packages.RenamePackageRefactoring;
-import org.eclipse.jdt.internal.core.refactoring.DebugUtils;
-
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.*;
-
-public class RenamePackageTests extends RefactoringTest {
-
- private static final String REFACTORING_PATH= "RenamePackage/";
-
- public RenamePackageTests(String name) {
- super(name);
- //fgIsVerbose= true;
- }
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), RenamePackageTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(noSetupSuite());
- return new JavaTestSetup(suite);
- }
-
- public static Test noSetupSuite() {
- return new TestSuite(RenamePackageTests.class);
- }
-
- protected String getRefactoringPath() {
- return REFACTORING_PATH;
- }
-
- // -------------
- private RenamePackageRefactoring createRefactoring(IPackageFragment pack, String newName) {
- return new RenamePackageRefactoring(fgChangeCreator, pack, newName);
- }
-
- /* non java-doc
- * the 0th one is the one to rename
- */
- private void helper1(String packageNames[], String[][] packageFiles, String newPackageName) throws Exception{
- IPackageFragment[] packages= new IPackageFragment[packageNames.length];
- for (int i= 0; i < packageFiles.length; i++){
- packages[i]= getRoot().createPackageFragment(packageNames[i], true, null);
- for (int j= 0; j < packageFiles[i].length; j++){
- createCUfromTestFile(packages[i], packageFiles[i][j], packageNames[i].replace('.', '/') + "/");
- //DebugUtils.dump(cu.getElementName() + "\n" + cu.getSource());
- }
- }
- IPackageFragment thisPackage= packages[0];
- IRefactoring ref= createRefactoring(thisPackage, newPackageName);
- RefactoringStatus result= performRefactoring(ref);
- assertNotNull("precondition was supposed to fail", result);
- if (fIsVerbose)
- DebugUtils.dump("" + result);
- }
-
- /* non java-doc
- * the 0th one is the one to rename
- */
- private void helper1(String[] packageNames, String newPackageName) throws Exception{
- IPackageFragment[] packages= new IPackageFragment[packageNames.length];
- for (int i= 0; i < packageNames.length; i++){
- packages[i]= getRoot().createPackageFragment(packageNames[i], true, null);
- }
- IPackageFragment thisPackage= packages[0];
- IRefactoring ref= createRefactoring(thisPackage, newPackageName);
- RefactoringStatus result= performRefactoring(ref);
- assertNotNull("precondition was supposed to fail", result);
- if (fIsVerbose)
- DebugUtils.dump("" + result);
- }
-
- private void helper1() throws Exception{
- helper1(new String[]{"p"}, new String[][]{{"A"}}, "p1");
- }
-
- private void helper2(String[] packageNames, String[][] packageFileNames, String newPackageName) throws Exception{
- IPackageFragment[] packages= new IPackageFragment[packageNames.length];
- ICompilationUnit[][] cus= new ICompilationUnit[packageFileNames.length][packageFileNames[0].length];
- for (int i= 0; i < packageNames.length; i++){
- packages[i]= getRoot().createPackageFragment(packageNames[i], true, null);
- for (int j= 0; j < packageFileNames[i].length; j++){
- cus[i][j]= createCUfromTestFile(packages[i], packageFileNames[i][j], packageNames[i].replace('.', '/') + "/");
- }
- }
- IPackageFragment thisPackage= packages[0];
- RefactoringStatus result= performRefactoring(createRefactoring(thisPackage, newPackageName));
- assertEquals("preconditions were supposed to pass", null, result);
-
- //---
-
- assert("package not renamed", ! getRoot().getPackageFragment(packageNames[0]).exists());
- IPackageFragment newPackage= getRoot().getPackageFragment(newPackageName);
- assert("new package does not exist", newPackage.exists());
-
- for (int i= 0; i < packageFileNames.length; i++){
- String packageName= (i == 0)
- ? newPackageName.replace('.', '/') + "/"
- : packageNames[i].replace('.', '/') + "/";
- for (int j= 0; j < packageFileNames[i].length; j++){
- String s1= getFileContents(getOutputTestFileName(packageFileNames[i][j], packageName));
- ICompilationUnit cu=
- (i == 0)
- ? newPackage.getCompilationUnit(packageFileNames[i][j] + ".java")
- : cus[i][j];
- //DebugUtils.dump("cu:" + cu.getElementName());
- String s2= cu.getSource();
-
- //DebugUtils.dump("expected:" + s1);
- //DebugUtils.dump("was:" + s2);
- assertEquals("invalid update in file " + cu.getElementName(), s1, s2);
- }
- }
- }
-
- // ---------- tests -------------
- public void testFail0() throws Exception{
- helper1(new String[]{"p"}, new String[][]{{"A"}}, "9");
- }
-
- public void testFail1() throws Exception{
- helper1(new String[]{"p.p1"}, new String[][]{{"A"}}, "p");
- }
-
- public void testFail2() throws Exception{
- helper1(new String[]{"p.p1", "fred"}, "fred");
- }
-
- public void testFail3() throws Exception{
- helper1(new String[]{"p"}, new String[][]{{"A"}}, "fred");
- }
-
- public void testFail4() throws Exception{
- helper1();
- }
-
- public void testFail5() throws Exception{
- helper1();
- }
-
- public void testFail6() throws Exception{
- helper1();
- }
-
- public void testFail7() throws Exception{
- helper1(new String[]{"p", "p1"}, new String[][]{{"A"}, {"A"}}, "fred");
- }
-
- public void testFail8() throws Exception{
- helper1(new String[]{"p", "p1"}, new String[][]{{"A"}, {"A"}}, "fred");
- }
-
- //native method used p.A as a paramter
- public void testFail9() throws Exception{
- helper1(new String[]{"p", "p1"}, new String[][]{{"A"}, {"A"}}, "fred");
- }
-
- public void testFail10() throws Exception{
- helper1(new String[]{"p.p1", "p"}, new String[][]{{"A"}, {"A"}}, "p");
- }
-
- public void testFail11() throws Exception{
- helper1(new String[]{"p.p1", "p", "r.p1"}, new String[][]{{"A"}, {"A"}, {}}, "r.p1");
- }
-
- //-------
- public void test0() throws Exception{
- helper2(new String[]{"p"}, new String[][]{{"A"}}, "p1");
- }
-
- public void test1() throws Exception{
- helper2(new String[]{"p"}, new String[][]{{"A"}}, "p1");
- }
-
- public void test2() throws Exception{
- helper2(new String[]{"p", "fred"}, new String[][]{{"A"}, {"A"}}, "p1");
- }
-
- public void test3() throws Exception{
- helper2(new String[]{"fred", "p.r"}, new String[][]{{"A"}, {"B"}}, "p");
- }
-
- public void test4() throws Exception{
- helper2(new String[]{"p.p1", "p"}, new String[][]{{"A"}, {"A"}}, "r");
- }
-}
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameParametersTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameParametersTests.java
deleted file mode 100644
index 56c0800..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameParametersTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateFieldTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateFieldTests.java
deleted file mode 100644
index 7cbf867..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateFieldTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateMethodTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateMethodTests.java
deleted file mode 100644
index b905388..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenamePrivateMethodTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameStaticMethodTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameStaticMethodTests.java
deleted file mode 100644
index c964653..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameStaticMethodTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameTypeTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameTypeTests.java
deleted file mode 100644
index c19b9cd..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameTypeTests.java
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.core.refactoring.base.IRefactoring;
-import org.eclipse.jdt.internal.core.refactoring.base.RefactoringStatus;
-import org.eclipse.jdt.internal.core.refactoring.types.RenameTypeRefactoring;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.internal.core.refactoring.DebugUtils;
-
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.*;
-
-public class RenameTypeTests extends RefactoringTest {
-
- private static final String REFACTORING_PATH= "RenameType/";
-
- public RenameTypeTests(String name) {
- super(name);
- }
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), RenameTypeTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(noSetupSuite());
- return new JavaTestSetup(suite);
- }
-
- public static Test noSetupSuite() {
- return new TestSuite(RenameTypeTests.class);
- }
-
- protected String getRefactoringPath() {
- return REFACTORING_PATH;
- }
-
- /******* shortcuts **********/
-
- private RenameTypeRefactoring createRefactoring(IJavaSearchScope scope, IType type, String newName){
- return new RenameTypeRefactoring(fgChangeCreator, scope, type, newName);
- }
-
- private void helper1_0(String className, String newName) throws Exception{
- IType classA= getClassFromTestFile(getPackageP(), className);
- IRefactoring ref= createRefactoring(getScope(), classA, newName);
- RefactoringStatus result= performRefactoring(ref);
- assertNotNull("precondition was supposed to fail", result);
- if (fIsVerbose)
- DebugUtils.dump("result: " + result);
- }
-
- private void helper1() throws Exception{
- helper1_0("A", "B");
- }
-
- private void helper2(String oldName, String newName) throws Exception{
- helper2_0(oldName, newName, newName);
- }
-
- private void helper2_0(String oldName, String newName, String newCUName) throws Exception{
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), oldName);
- IPath path= cu.getUnderlyingResource().getFullPath();
- IType classA= getType(cu, oldName);
-
- //IPath newpath= path;
- //ICompilationUnit newcu= cu;
- /* if (!oldName.equals(newCUName)){
- newcu= createCU(getPackageP(), newCUName +".java", getFileContents(getOutputTestFileName(newCUName)));
- //newpath= RenameResourceChange.renamedResourcePath(path, newName);
- //newcu= (ICompilationUnit) fFactory.create(JavaPlugin.getWorkspace().findResource(newpath));
- }*/
-
-
- IPackageFragment pack= (IPackageFragment)cu.getParent();
- IRefactoring ref= createRefactoring(getScope(), classA, newName);
- assertEquals("was supposed to pass", null, performRefactoring(ref));
- ICompilationUnit newcu= pack.getCompilationUnit(newCUName + ".java");
- assert("cu " + newcu.getElementName()+ " does not exist", newcu.exists());
- assertEquals("invalid renaming", getFileContents(getOutputTestFileName(newCUName)), newcu.getSource());
- }
-
- private IType getClassFromTestFile(IPackageFragment pack, String className) throws Exception{
- return getType(createCUfromTestFile(pack, className), className);
- }
-
- /****** tests ***********/
-
- public void testIllegalInnerClass() throws Exception {
- helper1();
- }
-
- public void testIllegalTypeName1() throws Exception {
- helper1_0("A", "X ");
- }
-
- public void testIllegalTypeName2() throws Exception {
- helper1_0("A", " X");
- }
-
- public void testIllegalTypeName3() throws Exception {
- helper1_0("A", "34");
- }
-
- public void testIllegalTypeName4() throws Exception {
- helper1_0("A", "this");
- }
-
- public void testIllegalTypeName5() throws Exception {
- helper1_0("A", "fred");
- }
-
- public void testIllegalTypeName6() throws Exception {
- helper1_0("A", "class");
- }
-
- public void testIllegalTypeName7() throws Exception {
- helper1_0("A", "A.B");
- }
-
- public void testIllegalTypeName8() throws Exception {
- helper1_0("A", "A$B");
- }
-
- public void testNoOp() throws Exception {
- helper1_0("A", "A");
- }
-
- public void testWrongArg1() throws Exception {
- helper1_0("A", "");
- }
-
- public void testFail0() throws Exception {
- helper1();
- }
-
- public void testFail1() throws Exception {
- helper1();
- }
-
- public void testFail2() throws Exception {
- helper1();
- }
-
- public void testFail3() throws Exception {
- helper1();
- }
-
- public void testFail4() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- getClassFromTestFile(getPackageP(), "B");
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail5() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- getClassFromTestFile(getPackageP(), "B");
- getClassFromTestFile(getPackageP(), "C");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail6() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- getClassFromTestFile(getPackageP(), "B");
- getClassFromTestFile(getPackageP(), "C");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail7() throws Exception {
- helper1();
- }
-
- public void testFail8() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- getClassFromTestFile(getPackageP(), "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail9() throws Exception {
- helper1();
- }
-
- public void testFail10() throws Exception {
- helper1();
- }
-
- public void testFail11() throws Exception {
- helper1();
- }
-
- public void testFail12() throws Exception {
- helper1();
- }
-
- public void testFail16() throws Exception {
- helper1();
- }
-
- public void testFail17() throws Exception {
- helper1();
- }
-
- public void testFail18() throws Exception {
- helper1();
- }
-
- public void testFail19() throws Exception {
- helper1();
- }
-
- public void testFail20() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- IType classAA= getClassFromTestFile(packageP2, "AA");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail22() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- getClassFromTestFile(getPackageP(), "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail23() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
- IPackageFragment packageP3= getRoot().createPackageFragment("p3", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- getClassFromTestFile(packageP3, "B");
- getClassFromTestFile(packageP2, "Bogus");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail24() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- getClassFromTestFile(packageP2, "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail25() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- getClassFromTestFile(packageP2, "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail26() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- getClassFromTestFile(packageP2, "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail27() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- getClassFromTestFile(packageP2, "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail28() throws Exception {
- helper1();
- }
-
- public void testFail29() throws Exception {
- helper1();
- }
-
- public void testFail30() throws Exception {
- helper1();
- }
-
- public void testFail31() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- IPackageFragment packageP2= getRoot().createPackageFragment("p2", true, null);
- IPackageFragment packageP3= getRoot().createPackageFragment("p3", true, null);
-
- IType classA= getClassFromTestFile(packageP1, "A");
- getClassFromTestFile(packageP2, "B");
- getClassFromTestFile(packageP3, "C");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail32() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- getClassFromTestFile(packageP1, "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail33() throws Exception {
- helper1();
- }
-
- public void testFail34() throws Exception {
- helper1();
- }
-
- public void testFail35() throws Exception {
- helper1();
- }
-
- public void testFail36() throws Exception {
- helper1();
- }
-
- public void testFail37() throws Exception {
- IType classA= getClassFromTestFile(getPackageP(), "A");
- getClassFromTestFile(getPackageP(), "B");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- public void testFail38() throws Exception {
- helper1();
- }
-
- public void testFail39() throws Exception {
- helper1();
- }
-
- public void testFail40() throws Exception {
- helper1();
- }
-
- public void testFail41() throws Exception {
- helper1();
- }
-
- public void testFail42() throws Exception {
- helper1();
- }
-
- public void testFail43() throws Exception {
- helper1();
- }
-
- public void testFail44() throws Exception {
- helper1();
- }
-
- public void testFail45() throws Exception {
- helper1();
- }
-
- public void testFail46() throws Exception {
- helper1();
- }
-
- public void testFail47() throws Exception {
- helper1();
- }
-
- public void testFail48() throws Exception {
- helper1();
- }
-
- public void testFail49() throws Exception {
- helper1();
- }
-
- public void testFail50() throws Exception {
- helper1();
- }
-
- public void testFail51() throws Exception {
- helper1();
- }
-
- public void testFail52() throws Exception {
- helper1();
- }
-
- public void testFail53() throws Exception {
- helper1();
- }
-
- public void testFail54() throws Exception {
- helper1();
- }
-
- public void testFail55() throws Exception {
- helper1();
- }
-
- public void testFail56() throws Exception {
- helper1();
- }
-
- public void testFail57() throws Exception {
- helper1();
- }
-
- public void testFail58() throws Exception {
- helper1();
- }
-
- public void testFail59() throws Exception {
- helper1();
- }
-
- public void testFail60() throws Exception {
- helper1();
- }
-
- public void testFail61() throws Exception {
- helper1();
- }
-
- public void testFail62() throws Exception {
- helper1();
- }
-
- public void testFail63() throws Exception {
- helper1();
- }
-
- public void testFail64() throws Exception {
- helper1();
- }
-
- public void testFail65() throws Exception {
- helper1();
- }
-
- public void testFail66() throws Exception {
- helper1();
- }
-
- public void testFail67() throws Exception {
- helper1();
- }
-
- public void testFail68() throws Exception {
- helper1();
- }
-
- public void testFail69() throws Exception {
- helper1();
- }
-
- public void testFail70() throws Exception {
- helper1();
- }
-
- public void testFail71() throws Exception {
- helper1();
- }
-
- public void testFail72() throws Exception {
- helper1();
- }
-
- public void testFail73() throws Exception {
- helper1();
- }
-
- public void testFail74() throws Exception {
- helper1();
- }
-
- public void testFail75() throws Exception {
- helper1();
- }
-
- public void testFail76() throws Exception {
- helper1();
- }
-
- public void testFail77() throws Exception {
- helper1();
- }
-
- public void testFail78() throws Exception {
- helper1();
- }
-
- public void testFail79() throws Exception {
- helper1();
- }
-
- public void testFail80() throws Exception {
- helper1();
- }
-
- public void testFail81() throws Exception {
- helper1();
- }
-
- public void testFail82() throws Exception {
- helper1();
- }
-
- public void testFail83() throws Exception {
- helper1_0("A", "Cloneable");
- }
-
- public void testFail84() throws Exception {
- helper1_0("A", "List");
- }
-
- public void testFail85() throws Exception {
- helper1();
- }
-
- public void testFail86() throws Exception {
- helper1();
- }
-
- public void testFail87() throws Exception {
- helper1();
- }
-
- public void testFail88() throws Exception {
- helper1();
- }
-
- public void testFail89() throws Exception {
- helper1();
- }
-
- public void testFail90() throws Exception {
- helper1();
- }
-
- public void testFail91() throws Exception {
- helper1();
- }
-
- public void testFail92() throws Exception {
- helper1();
- }
-
- public void testFail93() throws Exception {
- helper1();
- }
-
- public void testFail94() throws Exception {
- helper1();
- }
-
- public void testFail95() throws Exception {
- helper1();
- }
-
- public void testFail00() throws Exception {
- helper1();
- }
-
- public void testFail01() throws Exception {
- helper1_0("A", "B");
- }
-
- public void testFail02() throws Exception {
- helper1();
- }
-
- public void testFail03() throws Exception {
- helper1_0("A", "C");
- }
-
- public void testFail04() throws Exception {
- helper1_0("A", "A");
- }
-
- public void testFailRegression1GCRKMQ() throws Exception {
- IPackageFragment myPackage= getRoot().createPackageFragment("", true, new NullProgressMonitor());
- IType myClass= getClassFromTestFile(myPackage, "Blinky");
-
- RefactoringStatus result= performRefactoring(new RenameTypeRefactoring(fgChangeCreator, getScope(), myClass, "B"));
- assertNotNull("precondition was supposed to fail", result);
- }
-
- /******************/
-
- public void test0() throws Exception {
- helper2("A", "B");
- }
-
- public void test1() throws Exception {
- helper2("A", "B");
- }
-
- public void test10() throws Exception {
- helper2("A", "B");
- }
-
- public void test12() throws Exception {
- helper2("A", "B");
- }
-
- public void test13() throws Exception {
- helper2("A", "B");
- }
-
- public void test14() throws Exception {
- helper2("A", "B");
- }
-
- public void test15() throws Exception {
- helper2("A", "B");
- }
-
- public void test16() throws Exception {
- helper2("A", "B");
- }
-
- public void test17() throws Exception {
- helper2("A", "B");
- }
-
- public void test18() throws Exception {
- helper2("A", "B");
- }
-
- public void test19() throws Exception {
- helper2("A", "B");
- }
-
- public void test2() throws Exception {
- helper2("A", "B");
- }
-
- public void test20() throws Exception {
- IPackageFragment packageA= getRoot().createPackageFragment("A", true, null);
-
- ICompilationUnit cu= createCUfromTestFile(packageA, "A");
- IType classA= getType(cu, "A");
-
- IRefactoring ref= new RenameTypeRefactoring(fgChangeCreator, getScope(), classA, "B");
-
- assertEquals("was supposed to pass", null, performRefactoring(ref));
-
- ICompilationUnit newcu= packageA.getCompilationUnit("B.java");
- assertEquals("invalid renaming", getFileContents(getOutputTestFileName("B")), newcu.getSource());
- }
-
- public void test21() throws Exception {
- helper2("A", "B");
- }
-
- public void test22() throws Exception {
- helper2("A", "B");
- }
-
- public void test23() throws Exception {
- helper2("A", "B");
- }
-
- public void test24() throws Exception {
- helper2("A", "B");
- }
-
- public void test25() throws Exception {
- helper2("A", "B");
- }
-
- public void test26() throws Exception {
- helper2("A", "B");
- }
-
- public void test27() throws Exception {
- helper2("A", "B");
- }
-
- public void test28() throws Exception {
- helper2("A", "B");
- }
-
- public void test29() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- ICompilationUnit cuC= createCUfromTestFile(packageP1, "C");
-
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), "A");
- IType classA= getType(cu, "A");
-
- IRefactoring ref= createRefactoring(getScope(), classA, "B");
-
- assertEquals("was supposed to pass", null, performRefactoring(ref));
-
- ICompilationUnit newcu= getPackageP().getCompilationUnit("B.java");
- ICompilationUnit newcuC= packageP1.getCompilationUnit("C.java");
- assertEquals("invalid renaming A", getFileContents(getOutputTestFileName("B")), newcu.getSource());
- assertEquals("invalid renaming C", getFileContents(getOutputTestFileName("C")), newcuC.getSource());
-
- }
-
- public void test3() throws Exception {
- helper2("A", "B");
- }
-
- public void test30() throws Exception {
- ICompilationUnit cuAA= createCUfromTestFile(getPackageP(), "AA");
-
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), "A");
- IType classA= getType(cu, "A");
-
- IRefactoring ref= createRefactoring(getScope(), classA, "B");
-
- assertEquals("was supposed to pass", null, performRefactoring(ref));
-
- ICompilationUnit newcu= getPackageP().getCompilationUnit("B.java");
- ICompilationUnit newcuAA= getPackageP().getCompilationUnit("AA.java");
- assertEquals("invalid renaming A", getFileContents(getOutputTestFileName("B")), newcu.getSource());
- assertEquals("invalid renaming AA", getFileContents(getOutputTestFileName("AA")), newcuAA.getSource());
- }
- public void test31() throws Exception {
- ICompilationUnit cuAA= createCUfromTestFile(getPackageP(), "AA");
-
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), "A");
- IType classA= getType(cu, "A");
-
- IRefactoring ref= createRefactoring(getScope(), classA, "B");
-
- assertEquals("was supposed to pass", null, performRefactoring(ref));
-
- ICompilationUnit newcu= getPackageP().getCompilationUnit("B.java");
- ICompilationUnit newcuAA= getPackageP().getCompilationUnit("AA.java");
- assertEquals("invalid renaming A", getFileContents(getOutputTestFileName("B")), newcu.getSource());
- assertEquals("invalid renaming AA", getFileContents(getOutputTestFileName("AA")), newcuAA.getSource());
- }
- public void test32() throws Exception {
- helper2("A", "B");
- }
-
- public void test33() throws Exception {
- helper2("A", "B");
- }
-
- public void test34() throws Exception {
- helper2("A", "B");
- }
-
- public void test35() throws Exception {
- helper2("A", "B");
- }
-
- public void test36() throws Exception {
- helper2("A", "B");
- }
-
- public void test37() throws Exception {
- helper2("A", "B");
- }
-
- public void test38() throws Exception {
- helper2("A", "B");
- }
-
- public void test39() throws Exception {
- helper2("A", "B");
- }
-
- public void test4() throws Exception {
- helper2("A", "B");
- }
-
- public void test40() throws Exception {
- helper2("A", "B");
- }
-
- public void test41() throws Exception {
- helper2("A", "B");
- }
-
- public void test42() throws Exception {
- helper2("A", "B");
- }
-
- public void test43() throws Exception {
- helper2("A", "B");
- }
-
- public void test44() throws Exception {
- helper2("A", "B");
- }
-
- public void test45() throws Exception {
- helper2("A", "B");
- }
-
- public void test46() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- ICompilationUnit cuC= createCUfromTestFile(packageP1, "C");
-
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), "A");
- IType classA= getType(cu, "A");
-
- IRefactoring ref= createRefactoring(getScope(), classA, "B");
-
- assertEquals("was supposed to pass", null, performRefactoring(ref));
-
- ICompilationUnit newcu= getPackageP().getCompilationUnit("B.java");
- ICompilationUnit newcuC= packageP1.getCompilationUnit("C.java");
- assertEquals("invalid renaming A", getFileContents(getOutputTestFileName("B")), newcu.getSource());
- assertEquals("invalid renaming C", getFileContents(getOutputTestFileName("C")), newcuC.getSource());
- }
-
- public void test47() throws Exception {
- helper2("A", "B");
- }
-
- public void test48() throws Exception {
- helper2("A", "B");
- }
-
- public void test49() throws Exception {
- helper2("A", "B");
- }
-
- public void test50() throws Exception {
- helper2("A", "B");
- }
-
- public void test51() throws Exception {
- IPackageFragment packageP1= getRoot().createPackageFragment("p1", true, null);
- ICompilationUnit cuC= createCUfromTestFile(packageP1, "C");
-
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), "A");
- IType classA= getType(cu, "A");
-
- IRefactoring ref= createRefactoring(getScope(), classA, "B");
-
- assertEquals("was supposed to pass", null, performRefactoring(ref));
-
- ICompilationUnit newcu= getPackageP().getCompilationUnit("B.java");
- ICompilationUnit newcuC= packageP1.getCompilationUnit("C.java");
- assertEquals("invalid renaming A", getFileContents(getOutputTestFileName("B")), newcu.getSource());
- assertEquals("invalid renaming C", getFileContents(getOutputTestFileName("C")), newcuC.getSource());
-
- }
-
- public void test5() throws Exception {
- helper2("A", "B");
- }
-
- public void test6() throws Exception {
- helper2("A", "B");
- }
-
- public void test7() throws Exception {
- helper2("A", "B");
- }
-
- public void test8() throws Exception {
- helper2("A", "B");
- }
-
- public void test9() throws Exception {
- helper2("A", "B");
- }
-}
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameVirtualMethodInClassTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameVirtualMethodInClassTests.java
deleted file mode 100644
index def5eb0..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/RenameVirtualMethodInClassTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ReorderParametersTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ReorderParametersTests.java
deleted file mode 100644
index ab08e53..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/ReorderParametersTests.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package org.eclipse.jdt.refactoring.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.core.refactoring.base.IRefactoring;
-import org.eclipse.jdt.internal.core.refactoring.base.RefactoringStatus;
-import org.eclipse.jdt.testplugin.JavaTestSetup;
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-import org.eclipse.jdt.testplugin.ui.TestPluginUILauncher;
-
-import experiments.ReorderParametersRefactoring;
-
-public class ReorderParametersTests extends RefactoringTest {
-
- private static final String REFACTORING_PATH= "ReorderParameters/";
-
- /**
- * Constructor for ReorderParametersTests
- */
- public ReorderParametersTests(String name) {
- super(name);
- }
-
- protected String getRefactoringPath() {
- return REFACTORING_PATH;
- }
-
- public static void main(String[] args) {
- TestPluginUILauncher.run(TestPluginLauncher.getLocationFromProperties(), ReorderParametersTests.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(noSetupSuite());
- return new JavaTestSetup(suite);
- }
-
- public static Test noSetupSuite() {
- return new TestSuite(ReorderParametersTests.class);
- }
-
- private String getSimpleTestFileName(boolean canReorder, boolean input){
- String fileName = "A_" + name();
- if (canReorder)
- fileName += input ? "_in": "_out";
- return fileName + ".java";
- }
-
- private String getTestFileName(boolean canReorder, boolean input){
- String fileName= TEST_PATH_PREFIX + getRefactoringPath();
- fileName += (canReorder ? "canReorder/": "cannotReorder/");
- return fileName + getSimpleTestFileName(canReorder, input);
- }
-
- //private String getFailingTestFileName(){
- // return getTestFileName(false, false);
- //}
-
- private String getPassingTestFileName(boolean input){
- return getTestFileName(true, input);
- }
-
-
- //---helpers
-
- protected ICompilationUnit createCUfromTestFile(IPackageFragment pack, boolean canRename, boolean input) throws Exception {
- return createCU(pack, getSimpleTestFileName(canRename, input), getFileContents(getTestFileName(canRename, input)));
- }
-
- private void helper1(String[] newOrder, String[] signature) throws Exception{
- ICompilationUnit cu= createCUfromTestFile(getPackageP(), true, true);
- //DebugUtils.dump("cu" + cu.getSource());
- IType classA= getType(cu, "A");
- //DebugUtils.dump("classA" + classA);
- IRefactoring ref= new ReorderParametersRefactoring(fgChangeCreator, classA.getMethod("m", signature), newOrder);
- RefactoringStatus result= performRefactoring(ref);
- assertEquals("precondition was supposed to pass", null, result);
-
- IPackageFragment pack= (IPackageFragment)cu.getParent();
- String newCuName= getSimpleTestFileName(true, true);
- ICompilationUnit newcu= pack.getCompilationUnit(newCuName);
- assert(newCuName + " does not exist", newcu.exists());
- assertEquals("invalid renaming", getFileContents(getTestFileName(true, false)), newcu.getSource());
- }
-
- private void helper2(String[] newOrder, String[] signature, int expectedSeverity) throws Exception{
- IType classA= getType(createCUfromTestFile(getPackageP(), false, false), "A");
- //DebugUtils.dump("classA" + classA);
- IRefactoring ref= new ReorderParametersRefactoring(fgChangeCreator, classA.getMethod("m", signature), newOrder);
- RefactoringStatus result= performRefactoring(ref);
- assertNotNull("precondition was supposed to fail", result);
- assertEquals("Severity:", expectedSeverity, result.getSeverity());
- }
-
- //------- tests
-
- public void testFail0() throws Exception{
- helper2(new String[]{"j", "i"}, new String[]{"I", "I"}, RefactoringStatus.ERROR);
- }
-
- //---------
- public void test0() throws Exception{
- helper1(new String[]{"j", "i"}, new String[]{"I", "I"});
- }
-
- public void test1() throws Exception{
- helper1(new String[]{"j", "i"}, new String[]{"I", "I"});
- }
-
- public void test2() throws Exception{
- helper1(new String[]{"j", "i"}, new String[]{"I", "I"});
- }
-
- public void test3() throws Exception{
- helper1(new String[]{"j", "i"}, new String[]{"I", "I"});
- }
-
- //XXX to be decided
- //public void test4() throws Exception{
- // helper1(new String[]{"j", "i"}, new String[]{"I", "I"});
- //}
-
- public void test5() throws Exception{
- helper1(new String[]{"j", "i"}, new String[]{"I", "I"});
- }
-
- public void test6() throws Exception{
- helper1(new String[]{"k", "i", "j"}, new String[]{"I", "I", "I"});
- }
-
- public void test7() throws Exception{
- helper1(new String[]{"i", "k", "j"}, new String[]{"I", "I", "I"});
- }
-
- public void test8() throws Exception{
- helper1(new String[]{"k", "j", "i"}, new String[]{"I", "I", "I"});
- }
-
- public void test9() throws Exception{
- helper1(new String[]{"j", "i", "k"}, new String[]{"I", "I", "I"});
- }
-
- public void test10() throws Exception{
- helper1(new String[]{"j", "k", "i"}, new String[]{"I", "I", "I"});
- }
-
- public void test11() throws Exception{
- helper1(new String[]{"j", "k", "i"}, new String[]{"I", "I", "I"});
- }
-
- public void test12() throws Exception{
- helper1(new String[]{"j", "k", "i"}, new String[]{"I", "I", "I"});
- }
-
- public void test13() throws Exception{
- helper1(new String[]{"j", "k", "i"}, new String[]{"I", "I", "I"});
- }
-
-}
-
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/UndoManagerTests.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/UndoManagerTests.java
deleted file mode 100644
index fe98a80..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/UndoManagerTests.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/FileDocumentManager.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/FileDocumentManager.java
deleted file mode 100644
index 16bedc1..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/FileDocumentManager.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests.infra;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-
-import org.eclipse.jdt.internal.ui.util.IDocumentManager;
-
-public class FileDocumentManager implements IDocumentManager{
-
- private ICompilationUnit fCU;
- private IDocument fDocument;
-
- public FileDocumentManager(ICompilationUnit cu) throws JavaModelException {
- fCU= cu;
- }
-
- public void save(IProgressMonitor pm) throws CoreException {
- if (fDocument == null)
- return;
- String newSource= fDocument.get();
- fCU.getBuffer().setContents(newSource);
- fCU.save(pm, true);
- }
-
- public void connect(){
- if (fDocument != null)
- return;
- try{
- fDocument= new Document(fCU.getSource());
- } catch (JavaModelException e){
- e.printStackTrace();
- }
- }
-
- public void disconnect() {
- fDocument= null;
- }
-
- public IDocument getDocument() {
- return fDocument;
- }
-
- public void changed(){
- //??
- }
-
- public void aboutToChange(){
- //??
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TestExceptionHandler.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TestExceptionHandler.java
deleted file mode 100644
index 9ce5a88..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TestExceptionHandler.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TextBufferChangeCreator.java b/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TextBufferChangeCreator.java
deleted file mode 100644
index fd5a8ce..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/org/eclipse/jdt/refactoring/tests/infra/TextBufferChangeCreator.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.refactoring.tests.infra;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.refactoring.text.ITextBufferChange;
-import org.eclipse.jdt.internal.core.refactoring.text.ITextBufferChangeCreator;
-
-import org.eclipse.jdt.internal.ui.refactoring.changes.DocumentTextBufferChange;
-
-public class TextBufferChangeCreator implements ITextBufferChangeCreator{
-
- public ITextBufferChange create(String name, ICompilationUnit cu) throws JavaModelException {
- return new DocumentTextBufferChange(name, cu, new FileDocumentManager(cu));
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/pendingPRs.txt b/org.eclipse.jdt.ui.tests/refactoring/pendingPRs.txt
deleted file mode 100644
index c14e1ed..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/pendingPRs.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-1GA7QA1: ITPJCORE:WINNT - incorrect references to type found for duplicate type names
-1GA7PAS: ITPJCORE:WINNT - references in imports found only for some packages
-1G52F7P: ITPJCORE:WINNT - Search - finds bogus references to class
-1GABG8P: JFUIF:WINNT - Wizard.setWindowTitle throws NPE
-1GAH59E: ITPUI:WINNT - Need a way to access Error, Warning and Info icons
-1GAL424: ITPJCORE:WINNT - array declarations not found as type references
-1GBEBYC: ITPJCORE:WINNT - search for package references - incorrect IImportDeclarations found
-1GBK7B2: ITPJCORE:WINNT - package references: could be more precise
-1G5HC6K: ITPJUI:WINNT - Search - reference to class. selects the whole fully qualified name
-1GC2ODY: ITPJCORE:WINNT - need to extend the searchEngine/matchLocator mechanism
-1GCBPRI: ITPJCORE:WINNT - need to find method declarations in anonymous inner types
-1GCBQ2E: ITPJCORE:WINNT - how to efficiently find methods alogn 'the ripple'?
-1GCFJEN: ITPJCORE:WINNT - walkback in builder
-1GCSMN2: ITPJCORE:WINNT - walback on searching for package references (default package)
-1GCU5TA: ITPJUI:WINNT - walkback: search for type references
-1GCUF7U: ITPJCORE:WINNT - search for method declarations: private methods are never overloaded
-1GD3LZA: ITPJCORE:WINNT - search for method occurences - NullPointerException
-1GD79XM: ITPJCORE:WINNT - search for field references - not all found
-1GDXMOZ: ITPUI:WIN98 - SubProgressMonitor::done should not clear the subtask
diff --git a/org.eclipse.jdt.ui.tests/refactoring/regression.txt b/org.eclipse.jdt.ui.tests/refactoring/regression.txt
deleted file mode 100644
index 33c3dbc..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/regression.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-1. move junit.framework.TestCase to junit.samples causes NPE
- fixed in > 108
- (should never call List::addAll with null)
-
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/refactoring/smokeTest.txt b/org.eclipse.jdt.ui.tests/refactoring/smokeTest.txt
deleted file mode 100644
index 88d5ab6..0000000
--- a/org.eclipse.jdt.ui.tests/refactoring/smokeTest.txt
+++ /dev/null
@@ -1,71 +0,0 @@
---------------------------------
- Refactoring:
- 0. delete all projects from your workspace except for JUnit
-
- RenameType
- 1. open junit.framework.Test in the editor
- 2. go to the outliner, rightclick and select 'Refactoring >> Rename'
- 3. a wizard shows up, enter 'Fred' as a new name for the interface
- 4. press 'next>' - verify that a progress monitor is shown
- 5. a page with proposed changes shows up
- 6. verify that all checkboxes are checked and not-grayed
- 6a. verify that the 'next>' button is the only disabled button on the page
- 7. select the second element: verify that the compare viewer is fed with the 'junit.textui.TestRunner.java' file contents
- there should be exactly 12 differences
- 8. press 'finish>' - verify progress notification
- 9. verify that there are no compiler errors (if you have the autobuild off, then it on before verifying)
-
- Undo
- 10. rightclick in the outliner
- 10a. verify that '"Refactoring>>Redo"' is not in the menu
- 10b. select "Refactoring>>Undo"
- 11. verify that there are no compiler errors
-
- Redo
- 12. verify that 'Undo' is not available in the Refactoring menu and 'Redo' is
- 13. select 'Refactoring>>Redo'
- 14. verify that there are no compiler errors
-
- RenameMethod
- 1. open junit.framework.Test in the editor
- 2. select the run(TestResult) method
- 3. rightclick and select Refactoring>>Rename
- 4. enter basicRun as the new name
- 5. press next>
- 6. a page with errors should come up - 1 error saying that the method exists in types related to Test
- 6a. verify that only '<back' and cancel buttons are enabled
- 7. press <back
- 8. enter 'bogus' as the new name
- 9. press next>
- 10. you should see a page with proposed changes: there should be exactly 13 entries (top level nodes)
- 11. press finish - verify that there are no compiler errors
-
- Undo
- 11. rightclick in the outliner and select "Refactoring>>Undo"
- 12. verify that there are no compiler errors
-
- RenamePackage:
- 1. select junit.framework in the package viewer
- 2. choose 'refactoring/rename' from the popup menu
- 3. enter new name
- - verify that empty string is not a valid name
- 4. 'finish'
- 5. verify that no compiler errors are introduced
- 6. undo and verify that there are no compiler errors
- 7. create a default package and verify that the rename refactoring is not activated for it
-
- Move a CompilationUnit
- 1. select junit.framework.Test in the package view
- 2. choose 'refactoring/move'
- 3. enter junit.ui as a new package name
- 4. 'finish' and verify that there are no compiler errors
- 5. undo and verify that there are no compiler errors
-
- 6. in a similar manner - verify that it is not possible to move "junit.ui.TestRunner.java" to junit.textui
-
- Rename Parameters
- 1. open junit.ui.TestRunner
- 2. select appendFailure(String, Test, Throwable)
- 3. verify that you're not allowed to rename the first parameter to fExceptions
- 4.rename it to x and 'finish'
- 5. verify that there're no compiler errors
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestPlugin.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestPlugin.java
deleted file mode 100644
index 6dd6d83..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestPlugin.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-
-
-public class JavaTestPlugin extends Plugin {
-
- private static JavaTestPlugin fgDefault;
-
- public JavaTestPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- fgDefault= this;
- }
-
- public static JavaTestPlugin getDefault() {
- return fgDefault;
- }
-
- public static IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public static void enableAutobuild(boolean enable) throws CoreException {
- // disable auto build
- IWorkspace workspace= fgDefault.getWorkspace();
- IWorkspaceDescription desc= workspace.getDescription();
- desc.setAutoBuilding(enable);
- workspace.setDescription(desc);
- }
-
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestProject.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestProject.java
deleted file mode 100644
index aad9b3c..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestProject.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-
-public class JavaTestProject {
-
- private IJavaProject fJavaProject;
-
- public JavaTestProject(IWorkspaceRoot root, String projectName, String binFolderName) throws CoreException {
- IProject project= root.getProject(projectName);
- if (!project.exists()) {
- project.create(null);
- } else {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- }
-
- if (!project.isOpen()) {
- project.open(null);
- }
-
- IPath outputLocation;
- if (binFolderName != null) {
- IFolder binFolder= project.getFolder(binFolderName);
- if (!binFolder.exists()) {
- binFolder.create(false, true, null);
- }
- outputLocation= binFolder.getFullPath();
- } else {
- outputLocation= project.getFullPath();
- }
-
- if (!project.hasNature(JavaCore.NATURE_ID)) {
- addNatureToProject(project, JavaCore.NATURE_ID, null);
- }
-
- fJavaProject= JavaCore.create(project);
-
- fJavaProject.setOutputLocation(outputLocation, null);
- fJavaProject.setRawClasspath(new IClasspathEntry[0], null);
- }
-
- public IJavaProject getJavaProject() {
- return fJavaProject;
- }
-
- /**
- * Removes the TestJavaProject
- */
- public void remove() throws CoreException {
- fJavaProject.getProject().delete(true, true, null);
- fJavaProject= null;
- }
-
- public void removeSourceContainer(String containerName) throws CoreException {
- IFolder folder= fJavaProject.getProject().getFolder(containerName);
- removeFromClasspath(folder.getFullPath());
- fJavaProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
- folder.delete(true, null);
- }
-
- public IPackageFragmentRoot addSourceContainer(String containerName) throws CoreException {
- IProject project= fJavaProject.getProject();
- IContainer container= null;
- if (containerName == null || containerName.length() == 0) {
- container= project;
- } else {
- IFolder folder= fJavaProject.getProject().getFolder(containerName);
- if (!folder.exists()) {
- folder.create(false, true, null);
- }
- container= folder;
- }
- IPackageFragmentRoot root= fJavaProject.getPackageFragmentRoot(container);
-
- IClasspathEntry cpe= JavaCore.newSourceEntry(root.getPath());
- addToClasspath(cpe);
- return root;
- }
-
- public IPackageFragmentRoot addSourceContainerWithImport(String containerName, IPath importPath) throws IOException, CoreException {
- IPackageFragmentRoot root= addSourceContainer(containerName);
- IResource res= root.getUnderlyingResource();
- importFiles(importPath, (IContainer)res, new String[] { "java" });
- return root;
- }
-
- public IPackageFragmentRoot addLibrary(IPath path) throws JavaModelException {
- return addLibrary(path, null, null);
- }
-
- public IPackageFragmentRoot addLibrary(IPath path, IPath sourceAttachPath, IPath sourceAttachRoot) throws JavaModelException {
- IClasspathEntry cpe= JavaCore.newLibraryEntry(path, sourceAttachPath, sourceAttachRoot);
- addToClasspath(cpe);
- return fJavaProject.getPackageFragmentRoot(path.toString());
- }
-
- public IPackageFragmentRoot addLibraryWithImport(IPath jarPath, IPath sourceAttachPath, IPath sourceAttachRoot) throws IOException, CoreException {
- IProject project= fJavaProject.getProject();
- importFiles(jarPath, project, null);
- IFile file= project.getFile(jarPath.lastSegment());
- return addLibrary(file.getFullPath(), sourceAttachPath, sourceAttachRoot);
- }
-
- public IPackageFragmentRoot addRTJar() throws CoreException {
- IPath[] rtJarPath= findRtJar();
- if (rtJarPath != null) {
- return addLibrary(rtJarPath[0], rtJarPath[1], rtJarPath[2]);
- }
- return null;
- }
-
- public void addRequiredProject(IJavaProject jproject) throws JavaModelException {
- IClasspathEntry cpe= JavaCore.newProjectEntry(jproject.getProject().getFullPath());
- addToClasspath(cpe);
- }
-
- private void addToClasspath(IClasspathEntry cpe) throws JavaModelException {
- IClasspathEntry[] oldEntries= fJavaProject.getRawClasspath();
- for (int i= 0; i < oldEntries.length; i++) {
- if (oldEntries[i].equals(cpe)) {
- return;
- }
- }
- int nEntries= oldEntries.length;
- IClasspathEntry[] newEntries= new IClasspathEntry[nEntries + 1];
- System.arraycopy(oldEntries, 0, newEntries, 0, nEntries);
- newEntries[nEntries]= cpe;
- fJavaProject.setRawClasspath(newEntries, null);
- }
-
- private void removeFromClasspath(IPath path) throws JavaModelException {
- IClasspathEntry[] oldEntries= fJavaProject.getRawClasspath();
- int nEntries= oldEntries.length;
- Vector vec= new Vector(nEntries);
- for (int i= 0 ; i < nEntries ; i++) {
- IClasspathEntry curr= oldEntries[i];
- if (!path.equals(curr.getPath())) {
- vec.addElement(curr); }
- }
-
- IClasspathEntry[] newEntries= new IClasspathEntry[vec.size()];
- vec.copyInto(newEntries);
- fJavaProject.setRawClasspath(newEntries, null);
- }
-
- private void importFiles(IPath sourcePath, IContainer destContainer, String[] suffixes) throws CoreException, JavaModelException, IOException {
- File file= sourcePath.toFile();
- if (file.isDirectory()) {
- File[] list= file.listFiles();
- if (list != null) {
- for (int i= 0; i < list.length; i++) {
- doImport(list[i], destContainer, suffixes);
- }
- }
- } else {
- doImport(file, destContainer, suffixes);
- }
- destContainer.refreshLocal(IResource.DEPTH_INFINITE, null);
- }
-
- private void doImport(File file, IContainer parent, String[] suffixes) throws CoreException, IOException {
- if (file.exists()) {
- IPath filePath= new Path(file.getName());
- if (file.isFile()) {
- if (hasSuffix(filePath, suffixes)) {
- try {
- parent.getFile(filePath).create(new FileInputStream(file), false, null);
- } catch (CoreException e) {
- System.out.println("unable to create " + file.getAbsolutePath());
- throw e;
- }
- }
- } else {
- try {
- IFolder folder= parent.getFolder(filePath);
- if (!folder.exists()) {
- folder.create(false, true, null);
- }
- String[] list= file.list();
- for (int i= 0; i < list.length; i++) {
- String path= file.getAbsolutePath() + file.separatorChar + list[i];
- doImport(new java.io.File(path), folder, suffixes);
- }
- } catch (CoreException e) {
- System.out.println("unable to create " + file.getAbsolutePath());
- throw e;
- }
- }
- }
- }
-
- private boolean hasSuffix(IPath path, String[] suffixes) {
- if (suffixes == null) {
- return true;
- }
- for (int i= 0; i < suffixes.length; i++) {
- if (path.getFileExtension().equals((suffixes[i]))) {
- return true;
- }
- }
- return false;
- }
-
- public static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException {
- IProjectDescription description = proj.getDescription();
- String[] prevNatures= description.getNatureIds();
- String[] newNatures= new String[prevNatures.length + 1];
- System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
- newNatures[prevNatures.length]= natureId;
- description.setNatureIds(newNatures);
- proj.setDescription(description, monitor);
- }
-
- /**
- * Try to find rt.jar
- */
- private static IPath[] findRtJar() {
- IPath javaHome= new Path(System.getProperty("java.home"));
- IPath javaExe= javaHome.removeLastSegments(1).append("bin").append("java.exe");
- if (javaExe.toFile().exists()) {
- javaHome= javaHome.removeLastSegments(1);
- }
-
- IPath rtJar= javaHome.append("jre").append("lib").append("rt.jar");
- if (!rtJar.toFile().exists()) {
- return null;
- }
-
- IPath rtRoot= null;
- IPath rtSrc= javaHome.append("src.jar");
- if (rtSrc.toFile().exists()) {
- rtRoot= new Path("src");
- } else {
- rtSrc= null;
- rtRoot= null;
- }
- // System.out.println(rtJar + " " + rtSrc + " " + rtRoot);
- return new IPath[] { rtJar, rtSrc, rtRoot };
- }
-
-
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestSetup.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestSetup.java
deleted file mode 100644
index 06b6092..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/JavaTestSetup.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-import org.eclipse.core.resources.IWorkspaceRoot;
-
-
-public class JavaTestSetup extends TestSetup {
-
- private static JavaTestProject fgTestProject;
-
- public static JavaTestProject getTestProject() throws Exception {
- if (fgTestProject != null) {
- return fgTestProject;
- }
- throw new Exception("JavaTestSetup not initialized");
- }
-
- public JavaTestSetup(Test test) {
- super(test);
- }
-
- protected void setUp() throws Exception {
- IWorkspaceRoot root= JavaTestPlugin.getWorkspace().getRoot();
- fgTestProject= new JavaTestProject(root, "TestProject", "bin");
-
- if (fgTestProject.addRTJar() == null) {
- throw new Exception("JDK not found");
- }
-
- }
-
- protected void tearDown() throws Exception {
- fgTestProject.remove();
- }
-
-
-
-
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/NewMain.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/NewMain.java
deleted file mode 100644
index c8dca8a..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/NewMain.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin;
-
-import org.eclipse.core.launcher.Main;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-/**
- * Application is responsible for calling core launch api
- */
-
-public class NewMain extends Main {
- private static final String DEFAULT_APPLICATION= "org.eclipse.ui.workbench";
-
-
- public NewMain(String application, String location, URL pluginPathLocation, String bootLocation, boolean debug) throws IOException {
- this.application= application;
- this.location= location;
- this.pluginPathLocation= pluginPathLocation;
- this.bootLocation= bootLocation;
- }
-
- public static void main(String[] args) {
- try {
- String location= getLocationFromProperties("platform");
- new NewMain(DEFAULT_APPLICATION, location, null, null, true).run(args);
- } catch (Throwable e) {
- System.out.println("Exception launching the Eclipse Platform UI:");
- e.printStackTrace();
- }
- System.exit(0);
- }
-
-
- /**
- * Run this launcher with the arguments specified in the given string.
- * This is a short cut method for people running the launcher from
- * a scrapbook (i.e., swip-and-doit facility).
- */
- public static void main(String argString) throws Exception {
- Vector list= new Vector(5);
- for (StringTokenizer tokens= new StringTokenizer(argString, " "); tokens.hasMoreElements();)
- list.addElement((String) tokens.nextElement());
- main((String[]) list.toArray(new String[list.size()]));
- }
-
- public static String getLocationFromProperties(String key) {
- Properties properties= new Properties();
- try {
- FileInputStream fis= new FileInputStream("eclipse-platform.properties");
- properties.load(fis);
- return properties.getProperty(key);
- } catch (IOException e) {
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/TestPluginLauncher.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/TestPluginLauncher.java
deleted file mode 100644
index 2f4ea7a..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/TestPluginLauncher.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/JavaTestCoreApplication.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/JavaTestCoreApplication.java
deleted file mode 100644
index a3d190d..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/JavaTestCoreApplication.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin.core;
-
-import junit.textui.TestRunner;
-
-import org.eclipse.core.boot.IPlatformRunnable;
-
-public class JavaTestCoreApplication implements IPlatformRunnable {
-
- public static final String APP_NAME= "org.eclipse.jdt.testplugin.test";
-
- public Object run(Object arguments) throws Exception {
- if (arguments instanceof String[]) {
- TestRunner.main((String[])arguments);
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/TestPluginCoreLauncher.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/TestPluginCoreLauncher.java
deleted file mode 100644
index 404fc0c..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/core/TestPluginCoreLauncher.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/HelloWorld.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/HelloWorld.java
deleted file mode 100644
index e4c91ca..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/HelloWorld.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/JavaTestCase.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/JavaTestCase.java
deleted file mode 100644
index 44e17fb..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/test/JavaTestCase.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/JavaTestUIApplication.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/JavaTestUIApplication.java
deleted file mode 100644
index fd6c548..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/JavaTestUIApplication.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin.ui;
-
-import junit.textui.TestRunner;
-
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.preference.PreferenceManager;
-
-import org.eclipse.core.boot.IPlatformRunnable;
-import org.eclipse.core.runtime.IAdaptable;
-
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-
-public class JavaTestUIApplication implements IPlatformRunnable {
-
- public static final String APP_NAME= "org.eclipse.jdt.testplugin.test";
-
- public Object run(Object arguments) throws Exception {
-
- if (arguments instanceof String[]) {
- // create a display for the current thread
- Display display=new Display();
- // a dummy workbench
- WorkbenchPlugin.getDefault().setWorkbench(new TestWorkbench());
- TestRunner.main((String[])arguments);
- }
- return null;
- }
-
-
- public class TestWorkbench implements IWorkbench {
-
- public boolean close() {
- return true;
- }
-
- public IWorkbenchWindow getActiveWorkbenchWindow() {
- return null;
- }
-
- public IEditorRegistry getEditorRegistry() {
- return WorkbenchPlugin.getDefault().getEditorRegistry();
- }
-
- public IPerspectiveRegistry getPerspectiveRegistry() {
- return WorkbenchPlugin.getDefault().getPerspectiveRegistry();
- }
-
- public PreferenceManager getPreferenceManager() {
- return WorkbenchPlugin.getDefault().getPreferenceManager();
- }
-
- public ISharedImages getSharedImages() {
- return WorkbenchPlugin.getDefault().getSharedImages();
- }
-
- public IWorkbenchWindow[] getWorkbenchWindows() {
- return new IWorkbenchWindow[0];
- }
-
- public IWorkbenchWindow openWorkbenchWindow(IAdaptable input) throws WorkbenchException {
- return null;
- }
-
- public IWorkbenchWindow openWorkbenchWindow(String perspID, IAdaptable input) throws WorkbenchException {
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/TestPluginUILauncher.java b/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/TestPluginUILauncher.java
deleted file mode 100644
index c0e4289..0000000
--- a/org.eclipse.jdt.ui.tests/test plugin/org/eclipse/jdt/testplugin/ui/TestPluginUILauncher.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.testplugin.ui;
-
-import org.eclipse.jdt.testplugin.TestPluginLauncher;
-
-public class TestPluginUILauncher extends TestPluginLauncher {
-
- public static void run(String location, Class testCase, String[] args) {
- TestPluginLauncher.run(JavaTestUIApplication.APP_NAME, location, testCase, args);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/MultiElementListSelectorTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/MultiElementListSelectorTest.java
deleted file mode 100644
index b7874b9..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/MultiElementListSelectorTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/StringInputDialogTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/StringInputDialogTest.java
deleted file mode 100644
index d74f4ac..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/StringInputDialogTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/TwoPaneElementSelectorTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/TwoPaneElementSelectorTest.java
deleted file mode 100644
index 3b03a4a..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/internal/ui/dialogs/tests/TwoPaneElementSelectorTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/AddUnimplementedMethodsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/AddUnimplementedMethodsTest.java
deleted file mode 100644
index 57e36fc..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/AddUnimplementedMethodsTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeHierarchyTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeHierarchyTest.java
deleted file mode 100644
index ff66dc8..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeHierarchyTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeRefTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeRefTest.java
deleted file mode 100644
index 0f786c7..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/TypeRefTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/CheckBoxExample.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/CheckBoxExample.java
deleted file mode 100644
index bad4cde..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/CheckBoxExample.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/DialogFieldExample.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/DialogFieldExample.java
deleted file mode 100644
index e53a83a..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/DialogFieldExample.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/TabTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/TabTest.java
deleted file mode 100644
index 343f847..0000000
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/wizards/examples/TabTest.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.vcm/.classpath b/org.eclipse.jdt.ui.vcm/.classpath
deleted file mode 100644
index 8dd0517..0000000
--- a/org.eclipse.jdt.ui.vcm/.classpath
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="Eclipse Java UI VCM"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.ui"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="src" sourcepath="JRE_SRC"/>
- <classpathentry kind="lib"
- path="/org.eclipse.core.runtime/runtime.jar" sourcepath="/org.eclipse.core.runtime/runtimesrc.zip"/>
- <classpathentry kind="lib" path="/org.eclipse.swt/swt.jar" sourcepath="/org.eclipse.swt/swtsrc.zip"/>
- <classpathentry kind="lib" path="/org.eclipse.vcm.core/vcm.jar" sourcepath="/org.eclipse.vcm.core/vcmsrc.zip"/>
- <classpathentry kind="lib" path="/org.eclipse.vcm.ui/vcmui.jar" sourcepath="/org.eclipse.vcm.ui/vcmuisrc.zip"/>
- <classpathentry kind="lib"
- path="/org.eclipse.core.resources/resources.jar" sourcepath="/org.eclipse.core.resources/resourcessrc.zip"/>
- <classpathentry kind="src" path="/org.eclipse.jdt.core"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.jdt.ui.vcm/.cvsignore b/org.eclipse.jdt.ui.vcm/.cvsignore
deleted file mode 100644
index fe99505..0000000
--- a/org.eclipse.jdt.ui.vcm/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/org.eclipse.jdt.ui.vcm/.vcm_meta b/org.eclipse.jdt.ui.vcm/.vcm_meta
deleted file mode 100644
index 32edfa7..0000000
--- a/org.eclipse.jdt.ui.vcm/.vcm_meta
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-description>
- <comment></comment>
- <nature id="org.eclipse.jdt.core.javanature"/>
- <reference project-name="org.eclipse.jdt.ui"/>
- <reference project-name="org.eclipse.ui"/>
- <reference project-name="org.eclipse.jdt.core"/>
- <builder name="org.eclipse.jdt.core.javabuilder">
- </builder>
-</project-description>
diff --git a/org.eclipse.jdt.ui.vcm/build.properties b/org.eclipse.jdt.ui.vcm/build.properties
deleted file mode 100644
index 0ad3174..0000000
--- a/org.eclipse.jdt.ui.vcm/build.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-bin.includes = plugin.xml,\
- plugin.properties,\
- *.jar
-source.jdtvcm.jar = Eclipse Java UI VCM
-build.includes = build.properties,\
- plugin.jars,\
- plugin.properties,\
- plugin.xml
-build.vaj.Eclipse\ Java\ UI\ VCM = Eclipse Java UI VCM
diff --git a/org.eclipse.jdt.ui.vcm/exportplugin.xml b/org.eclipse.jdt.ui.vcm/exportplugin.xml
deleted file mode 100644
index 5df145f..0000000
--- a/org.eclipse.jdt.ui.vcm/exportplugin.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!-- build script to create a plugin from org.eclipse.jdt.ui.vcm -->
-<project name="org.eclipse.jdt.ui.vcm" default="export" basedir=".">
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../../plugin-export" />
- <property name="plugin" value="org.eclipse.jdt.ui.vcm" />
- <property name="dest" value="${destdir}/${plugin}" />
- </target>
-
- <target name="build" depends="init">
- <incremental project="${plugin}" kind="incr"/>
- </target>
-
- <target name="export" depends="build">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- </target>
-</project>
diff --git a/org.eclipse.jdt.ui.vcm/plugin.jars b/org.eclipse.jdt.ui.vcm/plugin.jars
deleted file mode 100644
index 35a59ba..0000000
--- a/org.eclipse.jdt.ui.vcm/plugin.jars
+++ /dev/null
@@ -1,2 +0,0 @@
-jdtvcm.jar=\
- Eclipse Java UI VCM
diff --git a/org.eclipse.jdt.ui.vcm/plugin.properties b/org.eclipse.jdt.ui.vcm/plugin.properties
deleted file mode 100644
index 8b89d6c..0000000
--- a/org.eclipse.jdt.ui.vcm/plugin.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-#########################################
-# (c) Copyright IBM Corp. 2000, 2001.
-# All Rights Reserved.
-#########################################
-
-pluginName=Java Development Tools VCM UI
-
-ReplaceWithMenu.label=Rep&lace With
-TogglePackagesViewVersionLabels.label = Show &Version Info
-TogglePackagesViewVersionLabels.tooltip = Show Version Info in the Packages View
-
-#
-# Contributions from org.eclipse.vcm.ui plugins.properties
-#
-Managing = Team
-ManageGroupMenu.label = &Team
-VersionAction.label = &Version from Workspace...
-VersionAction.tooltip = Create a Version Based on the Contents in Your Workspace
-MergeAction.label = &Merge...
-MergeAction.tooltip = Merge two streams into this project
-BrowseHistoryAction.label = Show in Resource &History
-BrowseHistoryAction.tooltip = Display the Version History of This Resource
-SyncAction.label = &Synchronize with Stream
-SyncAction.tooltip = Synchronize the Selected Resources With the Repository
-ReplaceWithVersionAction.label = &Version...
-ReplaceWithVersionAction.tooltip = Replace the Selected Resources With Another Version
-ReplaceWithTeamStreamAction.label = &Stream Contents
-ReplaceWithTeamStreamAction.tooltip = Replace the Selected Resources With a Version in its Stream
-ReplaceWithBaseVersionAction.label = &Base Version
-ReplaceWithBaseVersionAction.tooltip = Replace the Selected Resources With Their Base Versions
-CompareWithVersionAction.label = &Version...
-CompareWithVersionAction.tooltip = Compare the Selected Resource With Another Version
-CompareWithTeamStreamAction.label = &Stream Contents
-CompareWithTeamStreamAction.tooltip = Compare the Selected Resource With a Version in its Stream
-CompareWithBaseVersionAction.label = &Base Version
-CompareWithBaseVersionAction.tooltip = Compare the Selected Resources With Their Base Versions
diff --git a/org.eclipse.jdt.ui.vcm/plugin.xml b/org.eclipse.jdt.ui.vcm/plugin.xml
deleted file mode 100644
index 24ab8e2..0000000
--- a/org.eclipse.jdt.ui.vcm/plugin.xml
+++ /dev/null
@@ -1,345 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ======================================================================= -->
-<!-- This plugin provides basic VCM functionality to the Eclipse Java UI -->
-<!-- ======================================================================= -->
-<plugin
- name="%pluginName"
- id = "org.eclipse.jdt.ui.vcm"
- version = "1.0"
- provider-name = "Object Technology International, Inc.">
-
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.vcm.core"/>
- <import plugin="org.eclipse.vcm.ui"/>
- <import plugin="org.eclipse.jdt.ui"/>
- <import plugin="org.eclipse.jdt.core"/>
- </requires>
-
-<runtime>
- <library name="jdtvcm.jar">
- <export name = "*"/>
- </library>
-</runtime>
-
-<extension point="org.eclipse.vcm.core.ignore">
- <ignore pattern = "*.class" selected = "true"/>
-</extension>
-
-<!-- **************** View Actions ******************* -->
-<extension point="org.eclipse.ui.viewActions">
- <viewContribution
- id="org.eclipse.vcm.packageViewContribution"
- targetID="org.eclipse.jdt.ui.PackageExplorer">
- <action id="org.eclipse.vcm.vcminfoinpkg"
- label="%TogglePackagesViewVersionLabels.label"
- menubarPath="additions"
- state="false"
- tooltip="%TogglePackagesViewVersionLabels.tooltip"
- class="org.eclipse.jdt.ui.vcm.TogglePackageViewVersionLabels">
- </action>
- </viewContribution>
-</extension>
-
-<!-- **************** PROPERTY PAGES ******************* -->
- <extension
- point="org.eclipse.ui.propertyPages">
- <page name="%Managing"
- id="org.eclipse.jdt.ui.vcm.propertypages.managing"
- objectClass="org.eclipse.jdt.core.IJavaElement"
- class="org.eclipse.vcm.internal.ui.VCMPropertyPage">
- </page>
- </extension>
-
-<!-- ************** POPUP ACTIONS ******************* -->
-
- <extension
- point = "org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.jdt.ui.vcm.JavaElementContributions"
- objectClass="org.eclipse.jdt.core.IJavaElement">
- <menu
- id="vcm.managing"
- path="additions"
- label="%ManageGroupMenu.label">
- <separator name="manageGroup"/>
- </menu>
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jdt.ui.vcm.ProjectContributions"
- objectClass="org.eclipse.jdt.core.IJavaProject">
- <menu
- id="replaceWithMenu"
- path="additions"
- label="%ReplaceWithMenu.label">
- <separator name="replaceWithGroup"/>
- </menu>
-
- <action
- id="org.eclipse.jdt.ui.vcm.Version"
- label="%VersionAction.label"
- tooltip="%VersionAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.actions.VersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.MergeStreams"
- label="%MergeAction.label"
- tooltip="%MergeAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.merge.MergeAction">
- </action>
-
- <action
- id="vcm.BrowseHistory"
- label="%BrowseHistoryAction.label"
- tooltip="%BrowseHistoryAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.actions.BrowseHistoryAction">
- </action>
-
- <action
- id="vcm.Sync"
- label="%SyncAction.label"
- tooltip="%SyncAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.sync.SyncAction">
- </action>
-
- <action
- id="ReplaceWithVersion"
- label="%ReplaceWithVersionAction.label"
- tooltip="%ReplaceWithVersionAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.ReplaceWithTeamStream"
- label="%ReplaceWithTeamStreamAction.label"
- tooltip="%ReplaceWithTeamStreamAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithTeamStreamAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithVersion"
- label="%CompareWithVersionAction.label"
- tooltip="%CompareWithVersionAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithTeamStream"
- label="%CompareWithTeamStreamAction.label"
- tooltip="%CompareWithTeamStreamAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithTeamStreamAction">
- </action>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jdt.ui.vcm.PackageFragmentContributions"
- objectClass="org.eclipse.jdt.core.IPackageFragment">
- <menu
- id="replaceWithMenu"
- path="additions"
- label="%ReplaceWithMenu.label">
- <separator name="replaceWithGroup"/>
- </menu>
-
- <action
- id="vcm.BrowseHistory"
- label="%BrowseHistoryAction.label"
- tooltip="%BrowseHistoryAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.actions.BrowseHistoryAction">
- </action>
-
- <action
- id="vcm.Sync"
- label="%SyncAction.label"
- tooltip="%SyncAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.sync.SyncAction">
- </action>
-
- <action
- id="ReplaceWithVersion"
- label="%ReplaceWithVersionAction.label"
- tooltip="%ReplaceWithVersionAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.ReplaceWithTeamStream"
- label="%ReplaceWithTeamStreamAction.label"
- tooltip="%ReplaceWithTeamStreamAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithTeamStreamAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithVersion"
- label="%CompareWithVersionAction.label"
- tooltip="%CompareWithVersionAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithTeamStream"
- label="%CompareWithTeamStreamAction.label"
- tooltip="%CompareWithTeamStreamAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithTeamStreamAction">
- </action>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jdt.ui.vcm.PackageFragmentRootContributions"
- objectClass="org.eclipse.jdt.core.IPackageFragmentRoot">
- <menu
- id="replaceWithMenu"
- path="additions"
- label="%ReplaceWithMenu.label">
- <separator name="replaceWithGroup"/>
- </menu>
- <action
- id="vcm.BrowseHistory"
- label="%BrowseHistoryAction.label"
- tooltip="%BrowseHistoryAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.actions.BrowseHistoryAction">
- </action>
-
- <action
- id="vcm.Sync"
- label="%SyncAction.label"
- tooltip="%SyncAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.sync.SyncAction">
- </action>
-
- <action
- id="ReplaceWithVersion"
- label="%ReplaceWithVersionAction.label"
- tooltip="%ReplaceWithVersionAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.ReplaceWithTeamStream"
- label="%ReplaceWithTeamStreamAction.label"
- tooltip="%ReplaceWithTeamStreamAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithTeamStreamAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithVersion"
- label="%CompareWithVersionAction.label"
- tooltip="%CompareWithVersionAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithTeamStream"
- label="%CompareWithTeamStreamAction.label"
- tooltip="%CompareWithTeamStreamAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithTeamStreamAction">
- </action>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jdt.ui.vcm.CompilationUnitContributions"
- objectClass="org.eclipse.jdt.core.ICompilationUnit">
-
- <action
- id="org.eclipse.jdt.ui.vcm.element.ReplaceWithBaseVersion"
- label="%ReplaceWithBaseVersionAction.label"
- tooltip="%ReplaceWithBaseVersionAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithBaseVersionAction">
- </action>
-
- <action
- id="vcm.BrowseHistory"
- label="%BrowseHistoryAction.label"
- tooltip="%BrowseHistoryAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.actions.BrowseHistoryAction">
- </action>
-
- <action
- id="vcm.Sync"
- label="%SyncAction.label"
- tooltip="%SyncAction.tooltip"
- menubarPath="vcm.managing/manageGroup"
- class="org.eclipse.vcm.internal.ui.sync.SyncAction">
- </action>
-
- <action
- id="ReplaceWithVersion"
- label="%ReplaceWithVersionAction.label"
- tooltip="%ReplaceWithVersionAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.ReplaceWithTeamStream"
- label="%ReplaceWithTeamStreamAction.label"
- tooltip="%ReplaceWithTeamStreamAction.tooltip"
- menubarPath="replaceWithMenu/replaceWithGroup"
- class="org.eclipse.vcm.internal.ui.actions.ReplaceWithTeamStreamAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.element.CompareWithBaseVersion"
- label="%CompareWithBaseVersionAction.label"
- tooltip="%CompareWithBaseVersionAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithBaseVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithVersion"
- label="%CompareWithVersionAction.label"
- tooltip="%CompareWithVersionAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithVersionAction">
- </action>
-
- <action
- id="org.eclipse.jdt.ui.vcm.CompareWithTeamStream"
- label="%CompareWithTeamStreamAction.label"
- tooltip="%CompareWithTeamStreamAction.tooltip"
- menubarPath="compareWithMenu/compareWithGroup"
- enablesFor="1"
- class="org.eclipse.vcm.internal.ui.actions.CompareWithTeamStreamAction">
- </action>
-
- </objectContribution>
- </extension>
-</plugin>
\ No newline at end of file
diff --git a/org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/JavaVCMLabelDecorator.java b/org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/JavaVCMLabelDecorator.java
deleted file mode 100644
index b0a87aa..0000000
--- a/org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/JavaVCMLabelDecorator.java
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/TogglePackageViewVersionLabels.java b/org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/TogglePackageViewVersionLabels.java
deleted file mode 100644
index 6a5e7e2..0000000
--- a/org.eclipse.jdt.ui.vcm/vcm/org/eclipse/jdt/ui/vcm/TogglePackageViewVersionLabels.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.jdt.ui.vcm;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
-
-/**
- * This action decorates the packages view with
- * version labels.
- */
-public class TogglePackageViewVersionLabels implements IViewActionDelegate {
- private IViewPart fPart;
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart part) {
- fPart= part;
- }
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- if (fPart instanceof PackageExplorerPart) {
- final PackageExplorerPart packageExplorer= (PackageExplorerPart) fPart;
- if (action.isChecked()) {
- final Shell shell= fPart.getSite().getShell();
- BusyIndicator.showWhile(shell.getDisplay(), new Runnable() {
- public void run() {
- packageExplorer.setLabelDecorator(new JavaVCMLabelDecorator(shell));
- }
- });
- } else {
- packageExplorer.setLabelDecorator(null);
- }
- }
- }
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-}
\ No newline at end of file