Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2002-11-08 20:16:30 +0000
committercvs2svn2002-11-08 20:16:30 +0000
commit2f124b510e2265eda43e37942398dca4a4f475b9 (patch)
treee9a019e09686c8d333e5e6624beae32199f113ed
parent6b63c5a5dc410b26ff832ebf78f76b9383424e3d (diff)
downloadorg.eclipse.cdt-2f124b510e2265eda43e37942398dca4a4f475b9.tar.gz
org.eclipse.cdt-2f124b510e2265eda43e37942398dca4a4f475b9.tar.xz
org.eclipse.cdt-2f124b510e2265eda43e37942398dca4a4f475b9.zip
This commit was manufactured by cvs2svn to create tagGA_1_0_candidate_20021108
'GA_1_0_candidate_20021108'. Sprout from master 2002-11-08 20:16:29 UTC Judy N. Green <jgreen@qnx.com> 'Added support for converting projects' Delete: core/org.eclipse.cdt.ui.tests/.classpath core/org.eclipse.cdt.ui.tests/.cvsignore core/org.eclipse.cdt.ui.tests/.project core/org.eclipse.cdt.ui.tests/ChangeLog core/org.eclipse.cdt.ui.tests/about.html core/org.eclipse.cdt.ui.tests/build.properties core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/cfiles/TranslationUnits.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/common.mk core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/main.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/exe_g core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/main.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test2.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test2.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test2.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/exe core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/main.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test2.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/common.mk core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/main.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/exebig_g core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/main.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/common.mk core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test2.c core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test2.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/Makefile core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_gS.a core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test.o core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test2.o core/org.eclipse.cdt.ui.tests/plugin.xml core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CProjectHelper.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestWorkbench.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/test/HelloWorld.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/DialogCheck.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java core/org.eclipse.cdt.ui.tests/test.xml core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/UIInteractiveSuite.java core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/dialogs/PreferencesTest.java core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt debug/org.eclipse.cdt.debug.ui.tests/.classpath debug/org.eclipse.cdt.debug.ui.tests/.cvsignore debug/org.eclipse.cdt.debug.ui.tests/.project debug/org.eclipse.cdt.debug.ui.tests/Changelog debug/org.eclipse.cdt.debug.ui.tests/about.html debug/org.eclipse.cdt.debug.ui.tests/build.properties debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/main.c debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/Makefile debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/main.exe debug/org.eclipse.cdt.debug.ui.tests/plugin.xml debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CElementDecorator.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestSetup.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/Main.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/NewMain.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestPluginLauncher.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/test/HelloWorld.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/AccessibilityTestPass.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FailureDialog.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FocusTestPass.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/IDialogTestPass.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/SizingTestPass.java debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/VerifyDialog.java debug/org.eclipse.cdt.debug.ui.tests/test.xml
-rw-r--r--core/org.eclipse.cdt.ui.tests/.classpath18
-rw-r--r--core/org.eclipse.cdt.ui.tests/.cvsignore1
-rw-r--r--core/org.eclipse.cdt.ui.tests/.project37
-rw-r--r--core/org.eclipse.cdt.ui.tests/ChangeLog11
-rw-r--r--core/org.eclipse.cdt.ui.tests/about.html44
-rw-r--r--core/org.eclipse.cdt.ui.tests/build.properties1
-rw-r--r--core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java472
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java42
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java199
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java429
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java113
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java222
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java212
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java298
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/cfiles/TranslationUnits.c68
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/common.mk7
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/main.c7
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/Makefile1
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/exe_gbin18341 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/main.obin7724 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test.obin8036 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test2.obin8128 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test.c14
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test2.c13
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/Makefile1
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_gbin10783 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.obin5980 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test.obin6148 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test2.obin6284 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/Makefile1
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/exebin4591 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/main.obin892 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test.obin980 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test2.obin1076 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/common.mk7
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/main.c8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/Makefile1
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/exebig_gbin9065 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/main.obin6180 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/common.mk6
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test.c14
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test2.c13
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/Makefile8
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/Makefile1
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.abin12682 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test.obin6156 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test2.obin6284 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/Makefile1
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.sobin10171 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_gS.abin12906 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test.obin6272 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test2.obin6392 -> 0 bytes
-rw-r--r--core/org.eclipse.cdt.ui.tests/plugin.xml23
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java30
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CProjectHelper.java244
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java58
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java31
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java528
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java73
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java57
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestWorkbench.java79
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/test/HelloWorld.java49
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java66
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/DialogCheck.java225
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java96
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java114
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java107
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java68
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java48
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java76
-rw-r--r--core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java305
-rw-r--r--core/org.eclipse.cdt.ui.tests/test.xml51
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java40
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/UIInteractiveSuite.java35
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/dialogs/PreferencesTest.java190
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java253
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt211
-rw-r--r--core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt66
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.classpath17
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.cvsignore1
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.project38
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/Changelog4
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/about.html44
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/build.properties2
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore0
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java43
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java615
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java120
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java169
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java111
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/main.c26
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/Makefile2
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/main.exebin25658 -> 0 bytes
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/plugin.xml24
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java48
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CElementDecorator.java30
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java293
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java58
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestSetup.java31
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/Main.java528
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/NewMain.java73
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestPluginLauncher.java57
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java79
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/test/HelloWorld.java49
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/AccessibilityTestPass.java66
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java225
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java96
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java114
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FailureDialog.java107
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FocusTestPass.java68
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/IDialogTestPass.java48
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/SizingTestPass.java76
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/VerifyDialog.java305
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/test.xml51
120 files changed, 0 insertions, 9059 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/.classpath b/core/org.eclipse.cdt.ui.tests/.classpath
deleted file mode 100644
index a067b89762f..00000000000
--- a/core/org.eclipse.cdt.ui.tests/.classpath
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="ui"/>
- <classpathentry kind="src" path="core"/>
- <classpathentry kind="src" path="model"/>
- <classpathentry kind="src" path="/org.eclipse.core.boot"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.core"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.ui"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.junit"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="src" path="/org.apache.xerces"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/core/org.eclipse.cdt.ui.tests/.cvsignore b/core/org.eclipse.cdt.ui.tests/.cvsignore
deleted file mode 100644
index ba077a4031a..00000000000
--- a/core/org.eclipse.cdt.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/core/org.eclipse.cdt.ui.tests/.project b/core/org.eclipse.cdt.ui.tests/.project
deleted file mode 100644
index fe655272354..00000000000
--- a/core/org.eclipse.cdt.ui.tests/.project
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.ui.tests</name>
- <comment></comment>
- <projects>
- <project>org.apache.xerces</project>
- <project>org.eclipse.cdt.core</project>
- <project>org.eclipse.cdt.ui</project>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- <project>org.junit</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/core/org.eclipse.cdt.ui.tests/ChangeLog b/core/org.eclipse.cdt.ui.tests/ChangeLog
deleted file mode 100644
index 98cf169bfdd..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ChangeLog
+++ /dev/null
@@ -1,11 +0,0 @@
-2002-10-30 Alain Magloire
-
- * model/org/eclipse/cdt/core/model/tests/CModelTests.java (testGetNatureID):
- The fields and the methods use in this test was removed from the CoreModel class.
- (testHasNature): The method use in this case was refactor in the classes
- CProjectNature and CCProjectNature, fix the test.
-
-2002-10-18 Peter Graves
- src/org/eclipse/cdt/testplugin/CProjectHelper.jada
- Cleanup of the CProjectHelper file to remove unused imports, commeted out code etc.
-
diff --git a/core/org.eclipse.cdt.ui.tests/about.html b/core/org.eclipse.cdt.ui.tests/about.html
deleted file mode 100644
index fad1e4a429b..00000000000
--- a/core/org.eclipse.cdt.ui.tests/about.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Third Party Content</h3>
-
-<p>The Content includes items that may be have been sourced from third parties as follows:</p>
-
-<p><b>JUnit 3.7</b></p>
-<p>The plug-in is based on software developed by JUnit.org. Your use of JUnit 3.7 in both source and binary code
-form contained in the plug-in is subject to the terms and conditions of the IBM Public License 1.0 which is available at
-<a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>.
-The source code is located in testresources/junit37-noUI-src.zip.</p>
-
-<p>i) IBM effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;</p>
-<p>ii) IBM effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;</p>
-<p>iii) IBM states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/build.properties b/core/org.eclipse.cdt.ui.tests/build.properties
deleted file mode 100644
index 36df47cc74a..00000000000
--- a/core/org.eclipse.cdt.ui.tests/build.properties
+++ /dev/null
@@ -1 +0,0 @@
-source.cdttests.jar = src/, ui/, core/, model/
diff --git a/core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java b/core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java
deleted file mode 100644
index e3f84ab1a55..00000000000
--- a/core/org.eclipse.cdt.ui.tests/core/org/eclipse/cdt/ui/tests/textmanipulation/TextBufferTest.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * Copyright (c) 2002 IBM Corp. All rights reserved.
- * This file is made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-package org.eclipse.cdt.ui.tests.textmanipulation;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.internal.corext.textmanipulation.MoveTextEdit;
-import org.eclipse.cdt.internal.corext.textmanipulation.SimpleTextEdit;
-import org.eclipse.cdt.internal.corext.textmanipulation.SwapTextEdit;
-import org.eclipse.cdt.internal.corext.textmanipulation.TextBuffer;
-import org.eclipse.cdt.internal.corext.textmanipulation.TextBufferEditor;
-import org.eclipse.cdt.internal.corext.textmanipulation.TextRange;
-import org.eclipse.cdt.internal.corext.textmanipulation.UndoMemento;
-import org.eclipse.cdt.testplugin.TestPluginLauncher;
-
-
-
-public class TextBufferTest extends TestCase {
-
- private static final Class THIS= TextBufferTest.class;
-
- private TextBuffer fBuffer;
- private TextBufferEditor fEditor;
-
- public TextBufferTest(String name) {
- super(name);
- }
-
- public static void main(String[] args) {
- TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), THIS, args);
- }
-
- public static Test suite() {
- TestSuite result= new TestSuite(THIS);
- if (false) { // For hot code replace when debugging test cases
- result.addTestSuite(THIS);
- result.addTestSuite(THIS);
- result.addTestSuite(THIS);
- result.addTestSuite(THIS);
- result.addTestSuite(THIS);
- result.addTestSuite(THIS);
- }
- return result;
- }
-
- protected void setUp() throws Exception {
- fBuffer= TextBuffer.create("0123456789");
- fEditor= new TextBufferEditor(fBuffer);
- }
-
- protected void tearDown() throws Exception {
- fEditor= null;
- }
-
- public void testOverlap1() throws Exception {
- // [ [ ] ]
- fEditor.add(SimpleTextEdit.createReplace(0, 2, "01"));
- fEditor.add(SimpleTextEdit.createReplace(1, 2, "12"));
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testOverlap2() throws Exception {
- // [[ ] ]
- fEditor.add(SimpleTextEdit.createReplace(0, 2, "01"));
- fEditor.add(SimpleTextEdit.createReplace(0, 1, "0"));
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testOverlap3() throws Exception {
- // [ [ ]]
- fEditor.add(SimpleTextEdit.createReplace(0, 2, "01"));
- fEditor.add(SimpleTextEdit.createReplace(1, 1, "1"));
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testOverlap4() throws Exception {
- // [ [ ] ]
- fEditor.add(SimpleTextEdit.createReplace(0, 3, "012"));
- fEditor.add(SimpleTextEdit.createReplace(1, 1, "1"));
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testOverlap5() throws Exception {
- // [ [] ]
- fEditor.add(SimpleTextEdit.createReplace(0, 3, "012"));
- fEditor.add(SimpleTextEdit.createInsert(1, "xx"));
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testOverlap6() throws Exception {
- // [ [] ]
- fEditor.add(SimpleTextEdit.createReplace(0, 3, "012"));
- fEditor.add(SimpleTextEdit.createInsert(2, "xx"));
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testOverlap7() throws Exception {
- boolean catched= false;
- try {
- new MoveTextEdit(2,5,3);
- } catch (Exception e) {
- catched= true;
- }
- assertTrue(catched);
- }
-
- public void testOverlap8() throws Exception {
- boolean catched= false;
- try {
- new MoveTextEdit(2,5,6);
- } catch (Exception e) {
- catched= true;
- }
- assertTrue(catched);
- }
-
- public void testOverlap9() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(3, 1, 7);
- MoveTextEdit e2= new MoveTextEdit(2, 3, 8);
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(!fEditor.canPerformEdits());
- }
-
- public void testInsert1() throws Exception {
- // [][ ]
- SimpleTextEdit e1= SimpleTextEdit.createInsert(2, "yy");
- SimpleTextEdit e2= SimpleTextEdit.createReplace(2, 3, "3456");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTextRange(), 2, 2);
- assert(e2.getTextRange(), 4, 4);
- assertEquals("Buffer content", "01yy345656789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 2, 0);
- assert(e2.getTextRange(), 2, 3);
- }
-
- public void testInsert2() throws Exception {
- // [][]
- SimpleTextEdit e1= SimpleTextEdit.createInsert(2, "yy");
- SimpleTextEdit e2= SimpleTextEdit.createInsert(2, "xx");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTextRange(), 2, 2);
- assert(e2.getTextRange(), 4, 2);
- assertEquals("Buffer content", "01yyxx23456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 2, 0);
- assert(e2.getTextRange(), 2, 0);
- }
-
- public void testInsert3() throws Exception {
- // [ ][][ ]
- SimpleTextEdit e1= SimpleTextEdit.createReplace(0, 2, "011");
- SimpleTextEdit e2= SimpleTextEdit.createInsert(2, "xx");
- SimpleTextEdit e3= SimpleTextEdit.createReplace(2, 2, "2");
- fEditor.add(e1);
- fEditor.add(e2);
- fEditor.add(e3);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTextRange(), 0, 3);
- assert(e2.getTextRange(), 3, 2);
- assert(e3.getTextRange(), 5, 1);
- assertEquals("Buffer content", "011xx2456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 0, 2);
- assert(e2.getTextRange(), 2, 0);
- assert(e3.getTextRange(), 2, 2);
- }
-
- public void testInsert4() throws Exception {
- SimpleTextEdit e1= SimpleTextEdit.createInsert(0, "xx");
- fEditor.add(e1);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer length", 12, fBuffer.getLength());
- assert(e1.getTextRange(), 0, 2);
- assertEquals("Buffer content", "xx0123456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 0, 0);
- }
-
- public void testInsert5() throws Exception {
- SimpleTextEdit e1= SimpleTextEdit.createInsert(10, "xx");
- fEditor.add(e1);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer length", 12, fBuffer.getLength());
- assert(e1.getTextRange(), 10, 2);
- assertEquals("Buffer content", "0123456789xx", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 10, 0);
- }
-
- public void testDelete1() throws Exception {
- SimpleTextEdit e1= SimpleTextEdit.createDelete(3, 1);
- fEditor.add(e1);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTextRange(), 3, 0);
- assertEquals("Buffer content", "012456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 3, 1);
- }
-
- public void testDelete2() throws Exception {
- SimpleTextEdit e1= SimpleTextEdit.createDelete(4, 1);
- SimpleTextEdit e2= SimpleTextEdit.createDelete(3, 1);
- SimpleTextEdit e3= SimpleTextEdit.createDelete(5, 1);
- fEditor.add(e1);
- fEditor.add(e2);
- fEditor.add(e3);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTextRange(), 3, 0);
- assert(e2.getTextRange(), 3, 0);
- assert(e3.getTextRange(), 3, 0);
- assertEquals("Buffer content", "0126789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 4, 1);
- assert(e2.getTextRange(), 3, 1);
- assert(e3.getTextRange(), 5, 1);
- }
-
- public void testDelete3() throws Exception {
- SimpleTextEdit e1= SimpleTextEdit.createInsert(3, "x");
- SimpleTextEdit e2= SimpleTextEdit.createDelete(3, 1);
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTextRange(), 3, 1);
- assert(e2.getTextRange(), 4, 0);
- assertEquals("Buffer content", "012x456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getTextRange(), 3, 0);
- assert(e2.getTextRange(), 3, 1);
- }
-
- public void testMove1() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(2, 2, 5);
- fEditor.add(e1);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0142356789", fBuffer.getContent());
- assert(e1.getTargetRange(), 3, 2);
- assert(e1.getSourceRange(), 2, 0);
- doUndo(undo);
- assert(e1.getSourceRange(), 2, 2);
- assert(e1.getTargetRange(), 5, 0);
- }
-
- public void testMove2() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(5, 2, 2);
- fEditor.add(e1);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0156234789", fBuffer.getContent());
- assert(e1.getTargetRange(), 2, 2);
- assert(e1.getSourceRange(), 7, 0);
- doUndo(undo);
- assert(e1.getSourceRange(), 5, 2);
- assert(e1.getTargetRange(), 2, 0);
- }
-
- public void testMove3() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(2, 2, 7);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(4, 1, "x");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "01x5623789", fBuffer.getContent());
- assert(e1.getTargetRange(), 5, 2);
- assert(e1.getSourceRange(), 2, 0);
- assert(e2.getTextRange(), 2, 1);
- doUndo(undo);
- assert(e1.getSourceRange(), 2, 2);
- assert(e1.getTargetRange(), 7, 0);
- assert(e2.getTextRange(), 4, 1);
- }
-
- public void testMove4() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(7, 2, 2);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(5, 1, "x");
- fEditor.add(e2);
- fEditor.add(e1);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0178234x69", fBuffer.getContent());
- assert(e1.getTargetRange(), 2, 2);
- assert(e1.getSourceRange(), 9, 0);
- assert(e2.getTextRange(), 7, 1);
- doUndo(undo);
- assert(e1.getSourceRange(), 7, 2);
- assert(e1.getTargetRange(), 2, 0);
- assert(e2.getTextRange(), 5, 1);
- }
-
- public void testMove5() throws Exception {
- // Move onto itself
- MoveTextEdit e1= new MoveTextEdit(2, 1, 3);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(2,1,"x");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTargetRange(), 2, 1);
- assert(e1.getSourceRange(), 3, 0);
- assert(e2.getTextRange(), 2, 1);
- assertEquals("Buffer content", "01x3456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getSourceRange(), 2, 1);
- assert(e1.getTargetRange(), 3, 0);
- assert(e2.getTextRange(), 2, 1);
- }
-
- public void testMove6() throws Exception {
- // Move onto itself
- MoveTextEdit e1= new MoveTextEdit(2, 1, 2);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(2,1,"x");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTargetRange(), 2, 1);
- assert(e1.getSourceRange(), 3, 0); // This gets normalized since a move from [2,1] -> 2 == [2,1] -> 3
- assert(e2.getTextRange(), 2, 1);
- assertEquals("Buffer content", "01x3456789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getSourceRange(), 2, 1);
- assert(e1.getTargetRange(), 3, 0);
- assert(e2.getTextRange(), 2, 1);
- }
-
- public void testMove7() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(2, 3, 7);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(3, 1, "x");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "01562x4789", fBuffer.getContent());
- assert(e1.getTargetRange(), 4, 3);
- assert(e1.getSourceRange(), 2, 0);
- assert(e2.getTextRange(), 5, 1);
- doUndo(undo);
- assert(e1.getSourceRange(), 2, 3);
- assert(e1.getTargetRange(), 7, 0);
- assert(e2.getTextRange(), 3, 1);
- }
-
- public void testMove8() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(5, 3, 1);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(6, 1, "x");
- fEditor.add(e2);
- fEditor.add(e1);
- assertTrue(fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "05x7123489", fBuffer.getContent());
- assert(e1.getTargetRange(), 1, 3);
- assert(e1.getSourceRange(), 8, 0);
- assert(e2.getTextRange(), 2, 1);
- doUndo(undo);
- assert(e1.getSourceRange(), 5, 3);
- assert(e1.getTargetRange(), 1, 0);
- assert(e2.getTextRange(), 6, 1);
- }
-
- public void testMove9() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(1, 1, 3);
- MoveTextEdit e2= new MoveTextEdit(1, 3, 5);
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assert(e1.getTargetRange(), 3, 1);
- assert(e1.getSourceRange(), 2, 0);
- assert(e2.getTargetRange(), 2, 3);
- assert(e2.getSourceRange(), 1, 0);
- assertEquals("Buffer content", "0421356789", fBuffer.getContent());
- doUndo(undo);
- assert(e1.getSourceRange(), 1, 1);
- assert(e1.getTargetRange(), 3, 0);
- assert(e2.getSourceRange(), 1, 3);
- assert(e2.getTargetRange(), 5, 0);
- }
-
- public void testMove10() throws Exception {
- MoveTextEdit e1= new MoveTextEdit(2, 2, 8);
- MoveTextEdit e2= new MoveTextEdit(5, 2, 1);
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0561472389", fBuffer.getContent());
- doUndo(undo);
- }
-
- public void testSwap1() throws Exception {
- SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1);
- fEditor.add(e1);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0321456789", fBuffer.getContent());
- doUndo(undo);
- }
-
- public void testSwap2() throws Exception {
- SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1);
- SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1);
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0321476589", fBuffer.getContent());
- doUndo(undo);
- }
-
- public void testSwap3() throws Exception {
- SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1);
- SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1);
- SwapTextEdit e3= new SwapTextEdit(1, 3, 5, 3);
- fEditor.add(e1);
- fEditor.add(e2);
- fEditor.add(e3);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "0765432189", fBuffer.getContent());
- doUndo(undo);
- }
-
- public void testSwapAndReplace() throws Exception {
- SwapTextEdit e1= new SwapTextEdit(1, 3, 5, 3);
- SimpleTextEdit e2= SimpleTextEdit.createReplace(6, 1, "ab");
- fEditor.add(e1);
- fEditor.add(e2);
- assertTrue("Can perform edits", fEditor.canPerformEdits());
- UndoMemento undo= fEditor.performEdits(null);
- assertEquals("Buffer content", "05ab7412389", fBuffer.getContent());
- doUndo(undo);
- }
-
- private void doUndo(UndoMemento undo) throws Exception {
- fEditor.add(undo);
- fEditor.performEdits(null);
- assertBufferContent();
- }
-
- private void assert(TextRange r, int offset, int length) {
- assertEquals("Offset", offset, r.getOffset());
- assertEquals("Length", length, r.getLength());
- }
-
- private void assertBufferContent() {
- assertEquals("Buffer content restored", "0123456789", fBuffer.getContent());
- }
-}
-
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java
deleted file mode 100644
index eddf8c0493d..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- *
- * AllTests.java
- * This is the main entry point for running this suite of JUnit tests
- * for all tests within the package "org.eclipse.cdt.core.model"
- *
- * @author Judy N. Green
- * @since Jul 19, 2002
- */
-public class AllCoreTests {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
-
- // Just add more test cases here as you create them for
- // each class being tested
-
- suite.addTest(CModelTests.suite());
- suite.addTest(CModelExceptionTest.suite());
- suite.addTest(FlagTests.suite());
- suite.addTest(ArchiveTests.suite());
- suite.addTest(TranslationUnitTests.suite());
- return suite;
-
- }
-} // End of AllCoreTests.java
-
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java
deleted file mode 100644
index f581520f0d0..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.testplugin.*;
-import org.eclipse.cdt.testplugin.util.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-
-
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the core C model's Archive
- * class. There is nothing exotic here, mostly just sanity type tests
- *
- */
-public class ArchiveTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- IFile cfile, exefile, libfile, archfile, objfile;
- Path cpath, exepath, libpath, archpath, objpath;
- NullProgressMonitor monitor;
-
-
- /**
- * Constructor for ArchiveTests
- * @param name
- */
- public ArchiveTests(String name) {
- super(name);
- /***
- * The assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
- String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.ui.tests").find(new Path("/")).getFile();
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
-
- cfile = testProject.getProject().getFile("exetest.c");
- if (!cfile.exists()) {
- cfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/main.c"),false, monitor);
-
- }
- cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
-
- objfile = testProject.getProject().getFile("exetest.o");
- if (!objfile.exists()) {
- objfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o"),false, monitor);
-
- }
- objpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.o");
-
- exefile = testProject.getProject().getFile("test_g");
- if (!exefile.exists()) {
- exefile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g"),false, monitor);
-
- }
- exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
-
- archfile = testProject.getProject().getFile("libtestlib_g.a");
- if (!archfile.exists()) {
- archfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
-
- }
- libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
-
- libfile = testProject.getProject().getFile("libtestlib_g.so");
- if (!libfile.exists()) {
- libfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
-
- }
- archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
-
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- CProjectHelper.delete(testProject);
- }
-
- public static TestSuite suite() {
- return new TestSuite(ArchiveTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
-
- public void testGetBinaries() throws CoreException,FileNotFoundException {
- IArchive myArchive;
- IBinary[] bins;
- ICElement[] elements;
- ExpectedStrings expBin, expObj[];
- String[] myStrings;
- int x;
-
-
- /****
- * Setup the expected strings for the binaries, and the elements within
- * the binaries
- */
- myStrings=new String[2];
- myStrings[0]="test.o";
- myStrings[1]="test2.o";
- expBin=new ExpectedStrings(myStrings);
-
- expObj=new ExpectedStrings[2];
- myStrings[0]="func1";
- myStrings[1]="func2";
- expObj[0]=new ExpectedStrings(myStrings);
- myStrings[0]="test2func1";
- myStrings[1]="test2func2";
- expObj[1]=new ExpectedStrings(myStrings);
-
- /***
- * Grab the archive we want to test, and find all the binaries and
- * all the elements in all the binaries and make sure we get
- * everything we expect.
- */
- myArchive=CProjectHelper.findArchive(testProject, "libtestlib_g.a");
- if (myArchive==null)
- fail("Could not find archive");
- bins=myArchive.getBinaries();
- for (x=0;x<bins.length;x++) {
- expBin.foundString(bins[x].getElementName());
- elements=bins[x].getChildren();
- for (int i=0;i<elements.length;i++) {
- expObj[x].foundString(elements[i].getElementName());
- }
- }
-
- assertTrue(expBin.getMissingString(), expBin.gotAll());
- assertTrue(expBin.getExtraString(), !expBin.gotExtra());
- for (x=0;x<expObj.length;x++) {
- assertTrue("Binary " + expBin.expStrings[x] + " " +expObj[x].getMissingString(), expObj[x].gotAll());
- assertTrue("Binary " + expBin.expStrings[x] + " " + expObj[x].getExtraString(), !expObj[x].gotExtra());
- }
- }
- /***
- * Simple sanity test to make sure Archive.isArchive returns true
- *
- */
- public void testIsArchive() throws CoreException,FileNotFoundException {
- IArchive myArchive;
- myArchive=CProjectHelper.findArchive(testProject, "libtestlib_g.a");
-
- assertTrue("A archive", myArchive.isArchive());
- myArchive=null;
-
-
- }
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java
deleted file mode 100644
index c3cf998272d..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java
+++ /dev/null
@@ -1,429 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.testplugin.*;
-import org.eclipse.cdt.testplugin.util.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-
-
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the core C model's Binary
- * class. There is nothing exotic here, mostly just sanity type tests
- *
- */
-public class BinaryTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- IFile cfile, exefile, libfile, archfile, objfile, bigexe, ppcexefile, ndexe;
- Path cpath, exepath, libpath, archpath, objpath;
- NullProgressMonitor monitor;
-
-
-
- /**
- * Constructor for BinaryTests
- * @param name
- */
- public BinaryTests(String name) {
- super(name);
-
- }
-
- /**
- * @see java.lang.Object#finalize()
- */
- protected void finalize() throws Throwable {
- super.finalize();
-
- /**
- * Make sure we leave the workspace clean for the next set of tests
- */
- CProjectHelper.delete(testProject);
-
-
- }
-
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
- String pluginRoot;
- /***
- * The tests assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
-
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
-
- pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.ui.tests").find(new Path("/")).getFile();
-
- cfile = testProject.getProject().getFile("exetest.c");
- if (!cfile.exists()) {
- cfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/main.c"),false, monitor);
-
- }
- cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
-
- objfile = testProject.getProject().getFile("exetest.o");
- if (!objfile.exists()) {
- objfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o"),false, monitor);
-
- }
- objpath=new Path(workspace.getRoot().getLocation()+"/filetest/exetest.o");
-
- exefile = testProject.getProject().getFile("test_g");
- if (!exefile.exists()) {
- exefile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g"),false, monitor);
-
- }
- exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
- ppcexefile = testProject.getProject().getFile("ppctest_g");
- if (!ppcexefile.exists()) {
- ppcexefile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/exe_g"),false, monitor);
-
- }
- ndexe = testProject.getProject().getFile("exetest");
- if (!ndexe.exists()) {
- ndexe.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/exe"),false, monitor);
-
- }
-
-
-
- bigexe = testProject.getProject().getFile("exebig_g");
- if (!bigexe.exists()) {
- bigexe.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/exebig_g"),false, monitor);
-
- }
-
- archfile = testProject.getProject().getFile("libtestlib_g.a");
- if (!archfile.exists()) {
- archfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
-
- }
- libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
-
- libfile = testProject.getProject().getFile("libtestlib_g.so");
- if (!libfile.exists()) {
- libfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
-
- }
- archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
-
-
-
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- // release resources here and clean-up
- testProject.getProject().close(null);
- testProject.getProject().open(null);
-
- CProjectHelper.delete(testProject);
-
- }
-
- public static TestSuite suite() {
- return new TestSuite(BinaryTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
-
- /****
- * Simple tests to make sure we can get all of a binarys children
- */
- public void testGetChildren() throws CoreException,FileNotFoundException {
- IBinary myBinary;
- ICElement[] elements;
- ExpectedStrings expSyms;
- String[] myStrings = {"atexit", "exit", "_init_libc", "printf", "_fini",
- "test.c", "_init","main.c", "_start", "test2.c", "_btext", "errno"};
-
- expSyms=new ExpectedStrings(myStrings);
-
- /***
- * Grab the IBinary we want to test, and find all the elements in all
- * the binarie and make sure we get everything we expect.
- */
- myBinary=CProjectHelper.findBinary(testProject, "test_g");
- elements=myBinary.getChildren();
- for (int i=0;i<elements.length;i++) {
- expSyms.foundString(elements[i].getElementName());
- }
-
- assertTrue(expSyms.getMissingString(), expSyms.gotAll());
- assertTrue(expSyms.getExtraString(), !expSyms.gotExtra());
- }
-
- /***
- * A quick check to make sure the getBSS function works as expected.
- */
- public void testGetBss(){
- IBinary bigBinary,littleBinary;
- bigBinary=CProjectHelper.findBinary(testProject, "exebig_g");
- littleBinary=CProjectHelper.findBinary(testProject, "test_g");
-
- assertTrue("Expected 432, Got: " + bigBinary.getBSS(), bigBinary.getBSS()==432);
- assertTrue("Expected 4, Got: " + littleBinary.getBSS(), littleBinary.getBSS()==4);
- }
- /***
- * A quick check to make sure the getBSS function works as expected.
- */
- public void testGetData(){
- IBinary bigBinary,littleBinary;
- bigBinary=CProjectHelper.findBinary(testProject, "exebig_g");
- littleBinary=CProjectHelper.findBinary(testProject, "test_g");
- if (false) {
- /****
- * Since there is no comment on this function, I have no idea what
- * it is ment to do. Once I find out what it's ment to do, I will
- * actually write some tests.
- * PR23602
- */
- assertTrue("Expected 76 Got: " + bigBinary.getData(), bigBinary.getData()==76);
- assertTrue("Expected 8, Got: " + littleBinary.getData(), littleBinary.getData()==8);
- } else
- fail("PR:23602 No docs, can't test");
- }
-
- /***
- * A very small set of tests to make usre Binary.getCPU() seems to return
- * something sane for the most common exe type (x86) and one other (ppc)
- * This is not a in depth test at all.
- */
- public void testGetCpu() {
- IBinary myBinary;
- myBinary=CProjectHelper.findBinary(testProject, "exebig_g");
-
- assertTrue("Expected: x86 Got: " + myBinary.getCPU(),myBinary.getCPU().equals("x86"));
- myBinary=CProjectHelper.findBinary(testProject, ppcexefile.toString());
- assertTrue("Expected: ppcbe Got: " + myBinary.getCPU(),myBinary.getCPU().equals("ppcbe"));
-
- }
-
- /****
- * A set of simple tests to make sute getNeededSharedLibs seems to be sane
- */
- public void testGetNeededSharedLibs() {
- IBinary myBinary;
- String[] exelibs={"libsocket.so.2", "libc.so.2"};
- String[] bigexelibs={"libc.so.2"};
- String[] gotlibs;
- ExpectedStrings exp;
- int x;
-
- exp=new ExpectedStrings(exelibs);
- myBinary=CProjectHelper.findBinary(testProject, "test_g");
- gotlibs=myBinary.getNeededSharedLibs();
- for (x=0;x<gotlibs.length;x++) {
- exp.foundString(gotlibs[x]);
- }
- assertTrue(exp.getMissingString(), exp.gotAll());
- assertTrue(exp.getExtraString(), !exp.gotExtra());
-
- exp=new ExpectedStrings(bigexelibs);
- myBinary=CProjectHelper.findBinary(testProject,"exebig_g");
- gotlibs=myBinary.getNeededSharedLibs();
- for (x=0;x<gotlibs.length;x++) {
- exp.foundString(gotlibs[x]);
- }
- assertTrue(exp.getMissingString(), exp.gotAll());
- assertTrue(exp.getExtraString(), !exp.gotExtra());
-
- exp=new ExpectedStrings(bigexelibs);
- myBinary=CProjectHelper.findBinary(testProject, "libtestlib_g.so");
- gotlibs=myBinary.getNeededSharedLibs();
- for (x=0;x<gotlibs.length;x++) {
- exp.foundString(gotlibs[x]);
- }
- assertTrue(exp.getMissingString(), exp.gotAll());
- assertTrue(exp.getExtraString(), !exp.gotExtra());
-
- }
-
- /****
- * Simple tests for the getSoname method;
- */
- public void testGetSoname() {
- IBinary myBinary;
- String name;
- myBinary=CProjectHelper.findBinary(testProject, "test_g");
- assertTrue(myBinary.getSoname().equals(""));
-
- myBinary=CProjectHelper.findBinary(testProject, "libtestlib_g.so");
- name=myBinary.getSoname();
- assertNotNull(name);
- assertTrue("Expected: libtestlib_g.so.1 Got: " + name,
- name.equals("libtestlib_g.so.1"));
-
- }
-
- /***
- * Simple tests for getText
- */
- public void testGetText() {
- IBinary bigBinary,littleBinary;
- bigBinary=CProjectHelper.findBinary(testProject, bigexe.toString());
- littleBinary=CProjectHelper.findBinary(testProject, exefile.toString());
- if (false) {
- /****
- * Since there is no comment on this function, I have no idea what
- * it is ment to do. Once I find out what it's ment to do, I will
- * actually write some tests.
- * PR23602
- */
-
- assertTrue("Expected 296, Got: " + bigBinary.getText(), bigBinary.getText()==296);
- assertTrue("Expected 296, Got: " + littleBinary.getText(), littleBinary.getText()==296);
- } else
- fail("PR:23602 No docs, can't test");
- }
-
- /***
- * Simple tests for the hadDebug call
- */
- public void testHasDebug() {
- IBinary myBinary;
- myBinary = CProjectHelper.findBinary(testProject, "test_g");
- assertTrue(myBinary.hasDebug());
- myBinary = CProjectHelper.findBinary(testProject, "libtestlib_g.so");
- assertTrue(myBinary.hasDebug());
- myBinary = CProjectHelper.findBinary(testProject, "exetest");
- assertTrue(!myBinary.hasDebug());
- }
-
- /***
- * Sanity - isBinary and isReadonly should always return true;
- */
- public void testisBinRead() {
- IBinary myBinary;
- myBinary =CProjectHelper.findBinary(testProject, "test_g");
- assertTrue(myBinary.isBinary());
- assertTrue(myBinary.isReadOnly());
-
- }
-
- /***
- * Quick tests to make sure isObject works as expected.
- */
- public void testIsObject() {
- IBinary myBinary;
- myBinary=CProjectHelper.findObject(testProject, "exetest.o");
- assertTrue(myBinary.isObject());
-
-
- myBinary= CProjectHelper.findBinary(testProject, "test_g");
- assertTrue(!myBinary.isObject());
-
- myBinary= CProjectHelper.findBinary(testProject, "libtestlib_g.so");
- assertTrue(!myBinary.isObject());
-
- myBinary= CProjectHelper.findBinary(testProject, "exetest");
- assertTrue(!myBinary.isObject());
-
- }
-
- /***
- * Quick tests to make sure isSharedLib works as expected.
- */
- public void testIsSharedLib() {
- IBinary myBinary;
-
- myBinary=CProjectHelper.findObject(testProject, "exetest.o");
- assertTrue(!myBinary.isSharedLib());
-
- myBinary= CProjectHelper.findBinary(testProject, "libtestlib_g.so");
- assertTrue(myBinary.isSharedLib());
-
- myBinary= CProjectHelper.findBinary(testProject, "test_g");
- assertTrue(!myBinary.isSharedLib());
-
-
- myBinary= CProjectHelper.findBinary(testProject, "exetest");
- assertTrue(!myBinary.isSharedLib());
-
- }
-
- /***
- * Quick tests to make sure isExecutable works as expected.
- */
- public void testIsExecutable() throws InterruptedException {
- IBinary myBinary;
- myBinary=CProjectHelper.findObject(testProject, "exetest.o");
- assertTrue(!myBinary.isExecutable());
-
- myBinary=CProjectHelper.findBinary(testProject, "test_g");
- assertTrue(myBinary.isExecutable());
-
- myBinary= CProjectHelper.findBinary(testProject, "libtestlib_g.so");
- assertTrue(!myBinary.isExecutable());
-
-
- myBinary= CProjectHelper.findBinary(testProject, "exetest");
- assertTrue(myBinary.isExecutable());
-
- }
-
- /***
- * Simple sanity test to make sure Binary.isBinary returns true
- *
- */
- public void testIsBinary() throws CoreException,FileNotFoundException,Exception {
- IBinary myBinary;
-
- myBinary=CProjectHelper.findBinary(testProject, "exebig_g");
- assertTrue("A Binary", myBinary.isBinary());
- }
-
-
-
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java
deleted file mode 100644
index 19261d83846..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICModelStatusConstants;
-import org.eclipse.cdt.internal.core.model.CModelStatus;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- *
- * CModelExceptionTest
- *
- * @author Judy N. Green
- * @since Jul 19, 2002
- */
-public class CModelExceptionTest extends TestCase {
- // Shared values setup and torn down
- private Throwable throwableException;
- private CModelStatus cModelStatus;
- private CoreException coreException;
-
- /**
- * Constructor for TestCModelException.
- * @param name
- */
- public CModelExceptionTest(String name) {
- super(name);
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() {
- // create shared resources and setup the test fixture
- cModelStatus = new CModelStatus();
- coreException = new CoreException(cModelStatus);
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() {
- // release resources here and clean-up
- }
-
- public static TestSuite suite() {
- return new TestSuite(CModelExceptionTest.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
- public void testCreationNoStatus(){
- CModelException testException = new CModelException(coreException);
-
- // should not be null
- assertTrue("TestException is null", (testException != null));
-
- // should be the same object inside
- assertTrue("Object compare failed", testException.getException() == coreException);
- }
- public void testCreationWithStatus(){
- CModelException testException = new CModelException(coreException,
- ICModelStatusConstants.INDEX_OUT_OF_BOUNDS);
- // should not be null
- assertTrue("TestException is null", (testException != null));
-
- // should not be null
- assertTrue("TestException.getStatus() is null", (testException.getStatus() != null));
-
- // should have the same status as was set on creation
- assertTrue("Object compare failed", testException.getStatus().getCode() == ICModelStatusConstants.INDEX_OUT_OF_BOUNDS);
- }
-
- public void testElementDoesNotExist(){
- CModelException testException = new CModelException(coreException,
- ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST);
- // should not be null
- assertTrue("TestException is null", (testException != null));
-
-
- // should not exist since this is the value we set on creation
- assertTrue("Object unexpectedly exists", testException.doesNotExist());
- }
-
- public void testElementExists(){
- CModelException testException = new CModelException(coreException,
- ICModelStatusConstants.INVALID_CONTENTS);
- // should not be null
- assertTrue("TestException is null", (testException != null));
-
-
- // should not exist since this is the value we set on creation
- assertTrue("Object unexpectedly does not exist", testException.doesNotExist() == false);
- }
-
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java
deleted file mode 100644
index 9fa1283ef93..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java
+++ /dev/null
@@ -1,222 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.testplugin.*;
-import org.eclipse.cdt.core.CCProjectNature;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the core C model. Nothing
- * exotic, but should be a small sanity set of tests.
- *
- */
-public class CModelTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- IProject project_c, project_cc;
- NullProgressMonitor monitor;
- String pluginRoot;
-
- /**
- * Constructor for CModelTests.
- * @param name
- */
- public CModelTests(String name) {
- super(name);
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException {
- /***
- * The test of the tests assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- IWorkspaceDescription desc;
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
- pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.ui.tests").find(new Path("/")).getFile();
- desc=workspace.getDescription();
- desc.setAutoBuilding(false);
- workspace.setDescription(desc);
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() {
- // release resources here and clean-up
- }
-
- public static TestSuite suite() {
- return new TestSuite(CModelTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
- /***
- * The follow are a simple set of tests to make usre the HasC/CCNature calls
- * seem to be sane.
- *
- * Assumes that the CProjectHelper.createCProject properly creates a C
- * project with a C nature, but does not add the CC nature.
- * It also assums that the AddCCNature call works
- *
- * @see CProjectHelper#createCProject
- * @see CoreModel#addCCNature
- */
- public void testHasNature() throws CoreException {
- ICProject testProject;
- testProject=CProjectHelper.createCProject("naturetest", "none");
- if (testProject==null)
- fail("Unable to create project");
- assertTrue("hasCNature works", CoreModel.hasCNature(testProject.getProject()));
- assertTrue("hasCCNature works without ccnature", !(CoreModel.hasCCNature(testProject.getProject())));
-
-
- CCProjectNature.addCCNature(testProject.getProject(), monitor);
- assertTrue("hasCCNature works", (CoreModel.hasCCNature(testProject.getProject())));
-
- CCProjectNature.removeCCNature(testProject.getProject(), monitor);
- CCProjectNature.removeCNature(testProject.getProject(), monitor);
- assertTrue("hasCNature works without cnature", !CoreModel.hasCNature(testProject.getProject()));
- assertTrue("hasCCNature works without ccnature or cnature", !(CoreModel.hasCCNature(testProject.getProject())));
-
- }
-
- /***
- * Simple tests to make sure the models file identification methods seem
- * to work as expected.
- */
- public void testFileType() throws CoreException,FileNotFoundException {
- ICProject testProject;
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
-
- IFile file = testProject.getProject().getFile("exetest_g");
- if (!file.exists()) {
- file.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g"),false, monitor);
-
- }
- /***
- * file should be a binary, executable, not shared or archive
- */
- assertTrue("isBinary", CoreModel.isBinary(file));
- assertTrue("isExecutable", CoreModel.isExecutable(file));
- assertTrue("isSharedLib", !CoreModel.isSharedLib(file));
- assertTrue("isArchive", !CoreModel.isArchive(file));
- assertTrue("isObject", !CoreModel.isObject(file));
- assertTrue("isTranslationUnit", !CoreModel.isTranslationUnit(file));
-
-
- file = testProject.getProject().getFile("exetest.c");
- if (!file.exists()) {
- file.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/main.c"),false, monitor);
-
- }
- /***
- * file should be a translation unit
- */
- assertTrue("isBinary", !CoreModel.isBinary(file));
- assertTrue("isExecutable", !CoreModel.isExecutable(file));
- assertTrue("isSharedLib", !CoreModel.isSharedLib(file));
- assertTrue("isArchive", !CoreModel.isArchive(file));
- assertTrue("isObject", !CoreModel.isObject(file));
- assertTrue("isTranslationUnit", CoreModel.isTranslationUnit(file));
-
- file = testProject.getProject().getFile("exetest.o");
- if (!file.exists()) {
- file.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o"),false, monitor);
-
- }
- /***
- * file should be a object file unit
- */
- assertTrue("isBinary", CoreModel.isBinary(file));
- assertTrue("isExecutable", !CoreModel.isExecutable(file));
- assertTrue("isSharedLib", !CoreModel.isSharedLib(file));
- assertTrue("isArchive", !CoreModel.isArchive(file));
- assertTrue("isObject", CoreModel.isObject(file));
- assertTrue("isTranslationUnit", !CoreModel.isTranslationUnit(file));
-
- file = testProject.getProject().getFile("liblibtest_g.so");
- if (!file.exists()) {
- file.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
-
- }
- /***
- * file should be a sharedlib/binary file
- */
- assertTrue("isBinary", CoreModel.isBinary(file));
- assertTrue("isExecutable", !CoreModel.isExecutable(file));
- assertTrue("isSharedLib", CoreModel.isSharedLib(file));
- assertTrue("isArchive", !CoreModel.isArchive(file));
- assertTrue("isObject", !CoreModel.isObject(file));
- assertTrue("isTranslationUnit", !CoreModel.isTranslationUnit(file));
-
- file = testProject.getProject().getFile("liblibtest_g.a");
- if (!file.exists()) {
- file.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
-
- } else {
- fail("Does not exist?");
- }
- /***
- * file should be a archive file
- */
- assertTrue("isArchive", CoreModel.isArchive(file));
- assertTrue("isBinary:", !CoreModel.isBinary(file));
- assertTrue("isExecutable", !CoreModel.isExecutable(file));
- assertTrue("isSharedLib", !CoreModel.isSharedLib(file));
- assertTrue("isArchive", CoreModel.isArchive(file));
- assertTrue("isObject", !CoreModel.isObject(file));
- assertTrue("isTranslationUnit", !CoreModel.isTranslationUnit(file));
-
-
- testProject.getProject().delete(true,true,monitor);
- }
-
- /****
- * Some simple tests for isValidTranslationUnitName
- */
- public void testIsValidTranslationUnitName() throws CoreException {
- assertTrue("Invalid C file", !CoreModel.isValidTranslationUnitName("notcfile"));
- assertTrue("Invalid C file", !CoreModel.isValidTranslationUnitName("not.c.file"));
- assertTrue("Invalid C file", !CoreModel.isValidTranslationUnitName("not.ca"));
- assertTrue("Valid C file", CoreModel.isValidTranslationUnitName("areal.c"));
- }
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java
deleted file mode 100644
index 9da06490c36..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java
+++ /dev/null
@@ -1,212 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.Flags;
-import org.eclipse.cdt.internal.core.model.IConstants;
-
-/**
- * @author Peter Graves
- *
- * This is a very simple set of sanity tests for the flags class to make sure
- * there are no very silly problems in the class. It also verifies that there
- * is no overlap in the IConstants.
- */
-public class FlagTests extends TestCase {
-
- int flags[];
- /**
- * Constructor for FlagTests.
- * @param name
- */
- public FlagTests(String name) {
- super(name);
- }
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() {
- flags=new int[15];
- flags[0]=IConstants.AccPublic;
- flags[1]=IConstants.AccPrivate;
- flags[2]=IConstants.AccProtected;
- flags[3]=IConstants.AccStatic;
- flags[4]=IConstants.AccExtern;
- flags[5]=IConstants.AccInline;
- flags[6]=IConstants.AccVolatile;
- flags[7]=IConstants.AccRegister;
- flags[8]=IConstants.AccExplicit;
- flags[9]=IConstants.AccExport;
- flags[10]=IConstants.AccAbstract;
- flags[11]=IConstants.AccMutable;
- flags[12]=IConstants.AccAuto;
- flags[13]=IConstants.AccVirtual;
- flags[14]=IConstants.AccTypename;
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() {
- // release resources here and clean-up
- }
-
- public static TestSuite suite() {
- return new TestSuite(FlagTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
- public void testIsStatic()
- {
- int x;
- assertTrue("isStatic with a static", Flags.isStatic(IConstants.AccStatic));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccStatic)
- assertTrue("isStatic with a non-static", !Flags.isStatic(flags[x]));
- }
- }
-
- public void testIsAbstract()
- {
- int x;
- assertTrue("isAbstract with a abstract", Flags.isAbstract(IConstants.AccAbstract));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccAbstract)
- assertTrue("isAbstract with a non-abstract", !Flags.isAbstract(flags[x]));
- }
- }
-
- public void testIsExplicit()
- {
- int x;
- assertTrue("isExplicit with a explicit", Flags.isExplicit(IConstants.AccExplicit));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccExplicit)
- assertTrue("isExplicit with a non-explicit", !Flags.isExplicit(flags[x]));
- }
- }
-
- public void testIsExport()
- {
- int x;
- assertTrue("isExport with a Export", Flags.isExport(IConstants.AccExport));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccExport)
- assertTrue("isExport with a non-Export", !Flags.isExport(flags[x]));
- }
- }
- public void testIsExtern()
- {
- int x;
- assertTrue("isExtern with a Extern", Flags.isExtern(IConstants.AccExtern));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccExtern)
- assertTrue("isExtern with a non-Extern", !Flags.isExtern(flags[x]));
- }
- }
-
- public void testIsInline()
- {
- int x;
- assertTrue("isInline with a Inline", Flags.isInline(IConstants.AccInline));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccInline)
- assertTrue("isInline with a non-Inline", !Flags.isInline(flags[x]));
- }
- }
-
- public void testIsMutable()
- {
- int x;
- assertTrue("isMutable with a Mutable", Flags.isMutable(IConstants.AccMutable));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccMutable)
- assertTrue("isMutable with a non-Mutable", !Flags.isMutable(flags[x]));
- }
- }
-
- public void testIsPrivate()
- {
- int x;
- assertTrue("isPrivate with a Private", Flags.isPrivate(IConstants.AccPrivate));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccPrivate)
- assertTrue("isPrivate with a non-Private", !Flags.isPrivate(flags[x]));
- }
- }
-
- public void testIsPublic()
- {
- int x;
- assertTrue("isPublic with a Public", Flags.isPublic(IConstants.AccPublic));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccPublic)
- assertTrue("isPublic with a non-Public", !Flags.isPublic(flags[x]));
- }
- }
-
- public void testIsProtected()
- {
- int x;
- assertTrue("isProtected with a Protected", Flags.isProtected(IConstants.AccProtected));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccProtected)
- assertTrue("isProtected with a non-Protected", !Flags.isProtected(flags[x]));
- }
- }
-
- public void testIsRegister()
- {
- int x;
- assertTrue("isRegister with a Register", Flags.isRegister(IConstants.AccRegister));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccRegister)
- assertTrue("isRegister with a non-Register", !Flags.isRegister(flags[x]));
- }
- }
-
- public void testIsVirtual()
- {
- int x;
- assertTrue("isVirtual with a Virtual", Flags.isVirtual(IConstants.AccVirtual));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccVirtual)
- assertTrue("isVirtual with a non-Virtual", !Flags.isVirtual(flags[x]));
- }
- }
-
- public void testIsVolatile()
- {
- int x;
- assertTrue("isVolatile with a Volatile", Flags.isVolatile(IConstants.AccVolatile));
- for (x=0;x<flags.length;x++) {
- if (flags[x]!=IConstants.AccVolatile)
- assertTrue("isVolatile with a non-Volatile", !Flags.isVolatile(flags[x]));
- }
- }
-
-
-
-
-
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java
deleted file mode 100644
index 9f55a12f0d8..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java
+++ /dev/null
@@ -1,298 +0,0 @@
-package org.eclipse.cdt.core.model.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.Stack;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.testplugin.*;
-import org.eclipse.cdt.testplugin.util.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-
-
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the core C model's TranslationUnit
- * class. There is nothing exotic here, mostly just sanity type tests
- *
- */
-public class TranslationUnitTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- IFile cfile, exefile, libfile, archfile, objfile;
- Path cpath, exepath, libpath, archpath, objpath;
- NullProgressMonitor monitor;
-
- /* This is a list of elements in the test .c file. It will be used
- * in a number of places in the tests
- */
- String[] expectedStringList= {"stdio.h", "unistd.h", "func2p",
- "globalvar", "myenum", "mystruct", "mystruct_t", "myunion", "mytype",
- "func1", "func2", "main", "func3"};
- int[] expectedLines={ 12,14,17,20,23,28,32,35,42,47,53,58,65};
- /* This is a list of that the types of the above list of elements is
- * expected to be.
- */
- int[] expectedTypes= { ICElement.C_INCLUDE, ICElement.C_INCLUDE,
- ICElement.C_FUNCTION_DECLARATION, ICElement.C_VARIABLE,
- ICElement.C_ENUMERATION, ICElement.C_STRUCT, ICElement.C_TYPEDEF,
- ICElement.C_UNION, ICElement.C_TYPEDEF, ICElement.C_FUNCTION,
- ICElement.C_FUNCTION, ICElement.C_FUNCTION,ICElement.C_FUNCTION};
-
-
- /**
- * Constructor for TranslationUnitTests
- * @param name
- */
- public TranslationUnitTests(String name) {
- super(name);
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
- /***
- * The rest of the tests assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- IWorkspaceDescription desc;
- String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.ui.tests").find(new Path("/")).getFile();
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
- desc=workspace.getDescription();
- desc.setAutoBuilding(false);
- workspace.setDescription(desc);
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
-
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
-
- cfile = testProject.getProject().getFile("exetest.c");
- if (!cfile.exists()) {
- cfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/cfiles/TranslationUnits.c"),false, monitor);
-
- }
- cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
-
- objfile = testProject.getProject().getFile("exetest.o");
- if (!objfile.exists()) {
- objfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o"),false, monitor);
-
- }
- objpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.o");
-
- exefile = testProject.getProject().getFile("test_g");
- if (!exefile.exists()) {
- exefile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g"),false, monitor);
-
- }
- exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
-
- archfile = testProject.getProject().getFile("libtestlib_g.a");
- if (!archfile.exists()) {
- archfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
-
- }
- libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
-
- libfile = testProject.getProject().getFile("libtestlib_g.so");
- if (!libfile.exists()) {
- libfile.create(new FileInputStream(pluginRoot+"model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
-
- }
- archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
-
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- // release resources here and clean-up
- testProject.getProject().delete(true,true,monitor);
- }
-
- public static TestSuite suite() {
- return new TestSuite(TranslationUnitTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
-
-
- /***
- * Simple sanity test to make sure TranslationUnit.isTranslationUnit returns true
- *
- */
- public void testIsTranslationUnit() throws CoreException,FileNotFoundException {
- ITranslationUnit myTranslationUnit;
-
- myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
- assertTrue("A TranslationUnit", myTranslationUnit.isTranslationUnit());
-
- }
-
- /***
- * Simple sanity tests to make sure TranslationUnit.getChildren seems to
- * basicly work
- */
- public void testGetChildern() {
- ITranslationUnit myTranslationUnit;
- ICElement[] elements;
- int x;
-
- ExpectedStrings expectedString=new ExpectedStrings(expectedStringList);
-
- myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
-
-
- if (myTranslationUnit.hasChildren()) {
- elements=myTranslationUnit.getChildren();
- for (x=0;x<elements.length;x++) {
- expectedString.foundString(elements[x].getElementName());
- }
- }
- assertTrue("PR:23603 " +expectedString.getMissingString(),expectedString.gotAll());
- assertTrue(expectedString.getExtraString(),!expectedString.gotExtra());
-
- }
-
- /***
- * Simple sanity tests for the getElement() call
- */
- public void testGetElement() throws CModelException {
- ITranslationUnit myTranslationUnit;
- ICElement myElement;
- Stack missing=new Stack();
- int x;
- myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
-
- for (x=0;x<expectedStringList.length;x++) {
- myElement=myTranslationUnit.getElement(expectedStringList[x]);
- if (myElement==null)
- missing.push(expectedStringList[x]);
- else {
- assertTrue("Expected:" + expectedStringList[x] + " Got:" + myElement.getElementName(),
- expectedStringList[x].equals(myElement.getElementName()));
- }
-
- }
- if (!missing.empty()) {
- String output=new String("PR:23603 Could not get elements: ");
- while (!missing.empty())
- output+=missing.pop() + " ";
- assertTrue(output, false);
- }
-
- }
- /***
- * Simple sanity tests for the getElementAtLine() call
- */
- public void testGetElementAtLine() throws CoreException {
- ITranslationUnit myTranslationUnit;
- ICElement myElement;
- Stack missing=new Stack();
- int x;
- myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
-
- for (x=0;x<expectedStringList.length;x++) {
- myElement=myTranslationUnit.getElementAtLine(expectedLines[x]);
- if (myElement==null)
- missing.push(expectedStringList[x]);
- else {
- if (expectedStringList[x].equals("mystruct_t")) {
- assertTrue("PR:23603 expected:" + expectedStringList[x] + " Got:" + myElement.getElementName(),
- expectedStringList[x].equals(myElement.getElementName()));
- } else {
- assertTrue("Expected:" + expectedStringList[x] + " Got:" + myElement.getElementName(),
- expectedStringList[x].equals(myElement.getElementName()));
- }
-
- }
-
- }
- if (!missing.empty()) {
- String output=new String("PR: 23603 Could not get elements: ");
- while (!missing.empty())
- output+=missing.pop() + " ";
- assertTrue(output, false);
- }
-
- }
- /***
- * Simple sanity tests for the getInclude call
- */
- public void testGetInclude() {
- IInclude myInclude;
- int x;
- String includes[]={"stdio.h", "unistd.h"};
- ITranslationUnit myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
-
- for (x=0;x<includes.length;x++) {
- myInclude=myTranslationUnit.getInclude(includes[x]);
- if (myInclude==null)
- fail("Unable to get include: " + includes[x]);
- else
- assertTrue("PR:23478 Expected:"+includes[x] +" Got:"+ myInclude.getIncludeName(), includes[x].equals(myInclude.getIncludeName()));
- }
-
-
- }
- /***
- * Simple sanity tests for the getIncludes call
- */
- public void testGetIncludes() throws CModelException {
- IInclude myIncludes[];
- String includes[]={"stdio.h", "unistd.h"};
- ExpectedStrings myExp= new ExpectedStrings(includes);
- int x;
- ITranslationUnit myTranslationUnit=CProjectHelper.findTranslationUnit(testProject,"exetest.c");
- fail("PR:23478 Unable to test because we can't get the name of an include file");
-
- myIncludes=myTranslationUnit.getIncludes();
- for (x=0;x<myIncludes.length;x++) {
- myExp.foundString(myIncludes[x].getIncludeName());
- }
- assertTrue(myExp.getMissingString(), myExp.gotAll());
- assertTrue(myExp.getExtraString(), !myExp.gotExtra());
-
-
- }
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/cfiles/TranslationUnits.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/cfiles/TranslationUnits.c
deleted file mode 100644
index b4f8bf60115..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/cfiles/TranslationUnits.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-/********
- * This is a sample C file that will be used in testing the TranslationUnit
- * class. It has a specific structure that will be looked for within the
- * test case.
- * This file is only ment to contain various C elements, and may not compile
- * into a running application (but should be valid C)
- */
-
-#include <stdio.h>
-#include <unistd.h>
-
-/* A function prototype */
-int func2p(void);
-
-/* A global variable */
-int globalvar;
-
-/* A enumeration */
-enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4};
-
-/* A structure. This also includes a typedef around the strcture def
- * which at the time of writing was not picked up.
- */
-typedef struct mystruct {
- int a;
- char b;
- long c;
-} mystruct_t;
-
-/* A union */
-union myunion {
- int x;
- char y;
- long z;
-};
-
-/* A typedef */
-typedef struct mystruct mytype;
-
-
-/* A couple functions */
-
-void * func1(void)
-{
- return(NULL);
-}
-
-
-int func2(void)
-{
- return(0);
-}
-
-int main(int argc, char ** argv)
-{
- int var1;
- printf("Hello world\n");
-}
-
-
-void func3()
-{
- printf("This is not really here\n");
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/common.mk b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/common.mk
deleted file mode 100644
index 6e21c521623..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/common.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-ifndef QCONFIG
-QCONFIG=qconfig.mk
-endif
-include $(QCONFIG)
-USEFILE=
-LIBS+=socket
-include $(MKFILES_ROOT)/qtargets.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/main.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/main.c
deleted file mode 100644
index 62952639754..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/main.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main()
-{
- printf("Hello there\n");
- return(0);
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/Makefile
deleted file mode 100644
index 2c760893e32..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../common.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/exe_g b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/exe_g
deleted file mode 100644
index 1c54db11d20..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/exe_g
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/main.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/main.o
deleted file mode 100644
index 41e9e97110e..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/main.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test.o
deleted file mode 100644
index 9a35dfb2cf9..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test2.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test2.o
deleted file mode 100644
index bae3191b475..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/ppc/be.g/test2.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test.c
deleted file mode 100644
index 23baffafb31..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-
-
-int func1 (void)
-{
- printf("This is func1\n");
- return(1);
-}
-
-char * func2(void)
-{
- printf("This is func2\n");
- return(0);
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test2.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test2.c
deleted file mode 100644
index 7b26241b059..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/test2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-int test2func1(void)
-{
- printf("This is a function in the second object\n");
- return(1);
-}
-
-int test2func2(void)
-{
- printf("This is another function in the second object\n");
- return(2);
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/Makefile
deleted file mode 100644
index 2c760893e32..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../common.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g
deleted file mode 100644
index 465e16de33d..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/exe_g
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o
deleted file mode 100644
index 8c61c21f50d..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/main.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test.o
deleted file mode 100644
index 5f956885cbf..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test2.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test2.o
deleted file mode 100644
index aa8de348603..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o.g/test2.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/Makefile
deleted file mode 100644
index 2c760893e32..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../common.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/exe b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/exe
deleted file mode 100644
index d13631162d7..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/exe
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/main.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/main.o
deleted file mode 100644
index a5c78c1ca4e..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/main.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test.o
deleted file mode 100644
index 357c3985ea1..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test2.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test2.o
deleted file mode 100644
index 52e88a7397b..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exe/x86/o/test2.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/common.mk b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/common.mk
deleted file mode 100644
index 80c1e67f6f8..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/common.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-ifndef QCONFIG
-QCONFIG=qconfig.mk
-endif
-include $(QCONFIG)
-USEFILE=
-
-include $(MKFILES_ROOT)/qtargets.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/main.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/main.c
deleted file mode 100644
index ce93b899e09..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/main.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-int bigArray[100];
-int x[10]={1,2,3,4,5,6,7,8,9,0};
-int main()
-{
- printf("Hello there\n");
- return(0);
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/Makefile
deleted file mode 100644
index 2c760893e32..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../common.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/exebig_g b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/exebig_g
deleted file mode 100644
index 3aacf6267c5..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/exebig_g
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/main.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/main.o
deleted file mode 100644
index e7d818de524..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/exebig/x86/o.g/main.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/common.mk b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/common.mk
deleted file mode 100644
index dd99ed569bc..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/common.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-ifndef QCONFIG
-QCONFIG=qconfig.mk
-endif
-include $(QCONFIG)
-
-include $(MKFILES_ROOT)/qtargets.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test.c
deleted file mode 100644
index 23baffafb31..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-
-
-int func1 (void)
-{
- printf("This is func1\n");
- return(1);
-}
-
-char * func2(void)
-{
- printf("This is func2\n");
- return(0);
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test2.c b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test2.c
deleted file mode 100644
index 7b26241b059..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/test2.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-int test2func1(void)
-{
- printf("This is a function in the second object\n");
- return(1);
-}
-
-int test2func2(void)
-{
- printf("This is another function in the second object\n");
- return(2);
-}
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/Makefile
deleted file mode 100644
index 0e22650c04c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LIST=VARIANT
-ifndef QRECURSE
-QRECURSE=recurse.mk
-ifdef QCONFIG
-QRDIR=$(dir $(QCONFIG))
-endif
-endif
-include $(QRDIR)$(QRECURSE)
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/Makefile
deleted file mode 100644
index 2c760893e32..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../common.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a
deleted file mode 100644
index 06377b5ef2f..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/libtestlib_g.a
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test.o
deleted file mode 100644
index a12942b1527..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test2.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test2.o
deleted file mode 100644
index 87e730cd7c5..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/a.g/test2.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/Makefile b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/Makefile
deleted file mode 100644
index 2c760893e32..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-include ../../common.mk
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so
deleted file mode 100644
index c0e76f7695b..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_g.so
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_gS.a b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_gS.a
deleted file mode 100644
index b03c33bdc91..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/libtestlib_gS.a
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test.o
deleted file mode 100644
index c9009cb22dc..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test2.o b/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test2.o
deleted file mode 100644
index a13bcd826b8..00000000000
--- a/core/org.eclipse.cdt.ui.tests/model/org/eclipse/cdt/core/model/tests/resources/testlib/x86/so.g/test2.o
+++ /dev/null
Binary files differ
diff --git a/core/org.eclipse.cdt.ui.tests/plugin.xml b/core/org.eclipse.cdt.ui.tests/plugin.xml
deleted file mode 100644
index 46d78414370..00000000000
--- a/core/org.eclipse.cdt.ui.tests/plugin.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- id="org.eclipse.cdt.ui.tests"
- name="org.eclipse.cdt.ui.tests"
- version="1.0.0">
-
- <runtime>
- <library name="cdttests.jar"/>
- </runtime>
- <requires>
- <import plugin="org.apache.xerces"/>
- <import plugin="org.eclipse.core.boot"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.cdt.core"/>
- <import plugin="org.eclipse.cdt.ui"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.junit"/>
- </requires>
-
-
-</plugin>
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java
deleted file mode 100644
index b6b239f11a9..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CElementDecorator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.LabelProvider;
-
-/**
- * Allows to test decorators for Java elements
- */
-public class CElementDecorator extends LabelProvider implements ILabelDecorator {
-
- /*
- * @see ILabelDecorator#decorateImage(Image, Object)
- */
- public Image decorateImage(Image image, Object element) {
- return null;
- }
-
- /*
- * @see ILabelDecorator#decorateText(String, Object)
- */
- public String decorateText(String text, Object element) {
- return text + "*";
- }
-}
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CProjectHelper.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CProjectHelper.java
deleted file mode 100644
index 2acea29e2d1..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CProjectHelper.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package org.eclipse.cdt.testplugin;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.zip.ZipFile;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CProjectNature;
-import org.eclipse.cdt.core.model.IArchiveContainer;
-import org.eclipse.cdt.core.model.IBinaryContainer;
-import org.eclipse.cdt.core.model.ICFolder;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.IArchive;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.core.resources.IContainer;
-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.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-
-/**
- * Helper methods to set up a ICProject.
- */
-public class CProjectHelper {
-
- /**
- * Creates a ICProject.
- */
- public static ICProject createCProject(String projectName, String binFolderName) throws CoreException {
- IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
- IProject project= root.getProject(projectName);
- if (!project.exists()) {
- project.create(null);
- } else {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- }
-
- if (!project.isOpen()) {
- project.open(null);
- }
-
-
- if (!project.hasNature(CProjectNature.C_NATURE_ID)) {
- addNatureToProject(project, CProjectNature.C_NATURE_ID, null);
- }
-
- ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project);
-
- return cproject;
- }
-
- /**
- * Removes a ICProject.
- */
- public static void delete(ICProject cproject) throws CoreException {
- cproject.getProject().delete(true, true, null);
- }
-
-
- /**
- * Adds a source container to a ICProject.
- */
- public static ICFolder addSourceContainer(ICProject cproject, String containerName) throws CoreException {
- IProject project= cproject.getProject();
- IContainer container= null;
- if (containerName == null || containerName.length() == 0) {
- container= project;
- } else {
- IFolder folder= project.getFolder(containerName);
- if (!folder.exists()) {
- folder.create(false, true, null);
- }
- container= folder;
- }
-
- return (ICFolder)container;
- }
-
- /**
- * Adds a source container to a ICProject and imports all files contained
- * in the given Zip file.
- */
- public static ICFolder addSourceContainerWithImport(ICProject cproject, String containerName, ZipFile zipFile) throws InvocationTargetException, CoreException {
- ICFolder root= addSourceContainer(cproject, containerName);
- importFilesFromZip(zipFile, root.getPath(), null);
- return root;
- }
-
- /**
- * Removes a source folder from a ICProject.
- */
- public static void removeSourceContainer(ICProject cproject, String containerName) throws CoreException {
- IFolder folder= cproject.getProject().getFolder(containerName);
- folder.delete(true, null);
- }
-
-
-
- /**
- * Attempts to find an archive with the given name in the workspace
- */
- public static IArchive findArchive(ICProject testProject,String name) {
- int x;
- IArchive[] myArchives;
- IArchiveContainer archCont;
- /***
- * Since ArchiveContainer.getArchives does not wait until
- * all the archives in the project have been parsed before
- * returning the list, we have to do a sync ArchiveContainer.getChildren
- * first to make sure we find all the archives.
- */
- archCont=testProject.getArchiveContainer();
-
- myArchives=archCont.getArchives();
- if (myArchives.length<1)
- return(null);
- for (x=0;x<myArchives.length;x++) {
- if (myArchives[x].getElementName().equals(name))
- return(myArchives[x]);
-
- }
- return(null);
- }
- /**
- * Attempts to find a binary with the given name in the workspace
- */
- public static IBinary findBinary(ICProject testProject,String name) {
- IBinaryContainer binCont;
- int x;
- IBinary[] myBinaries;
- binCont=testProject.getBinaryContainer();
-
- myBinaries=binCont.getBinaries();
- if (myBinaries.length<1)
- return(null);
- for (x=0;x<myBinaries.length;x++) {
- if (myBinaries[x].getElementName().equals(name))
- return(myBinaries[x]);
-
-
- }
- return(null);
- }
-
- /**
- * Attempts to find an object with the given name in the workspace
- */
- public static IBinary findObject(ICProject testProject,String name) {
- int x;
- ICElement[] myElements;
- myElements=testProject.getChildren();
- if (myElements.length<1)
- return(null);
- for (x=0;x<myElements.length;x++) {
- if (myElements[x].getElementName().equals(name))
- if (myElements[x] instanceof ICElement) {
- if (myElements[x] instanceof IBinary) {
- return((IBinary) myElements[x]);
- }
- }
- }
- return(null);
- }
- /**
- * Attempts to find a TranslationUnit with the given name in the workspace
- */
- public static ITranslationUnit findTranslationUnit(ICProject testProject,String name) {
- int x;
- ICElement[] myElements;
- myElements=testProject.getChildren();
- if (myElements.length<1)
- return(null);
- for (x=0;x<myElements.length;x++) {
- if (myElements[x].getElementName().equals(name))
- if (myElements[x] instanceof ICElement) {
- if (myElements[x] instanceof ITranslationUnit) {
- return((ITranslationUnit) myElements[x]);
- }
- }
- }
- return(null);
- }
-
-
-
- /**
- * Attempts to find an element with the given name in the workspace
- */
- public static ICElement findElement(ICProject testProject,String name) {
- int x;
- ICElement[] myElements;
- myElements=testProject.getChildren();
- if (myElements.length<1)
- return(null);
- for (x=0;x<myElements.length;x++) {
- if (myElements[x].getElementName().equals(name))
- if (myElements[x] instanceof ICElement) {
- return((ICElement) myElements[x]);
- }
-
-
- }
- return(null);
- }
-
- private 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);
- }
-
- private static void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException {
- ZipFileStructureProvider structureProvider= new ZipFileStructureProvider(srcZipFile);
- try {
- ImportOperation op= new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, new ImportOverwriteQuery());
- op.run(monitor);
- } catch (InterruptedException e) {
- // should not happen
- }
- }
-
- private static class ImportOverwriteQuery implements IOverwriteQuery {
- public String queryOverwrite(String file) {
- return ALL;
- }
- }
-
-
-}
-
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java
deleted file mode 100644
index 3fb21c036fb..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestPlugin.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-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.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-
-
-public class CTestPlugin extends Plugin {
-
- private static CTestPlugin fgDefault;
-
- public CTestPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- fgDefault= this;
- }
-
- public static CTestPlugin 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);
- }
-
- public File getFileInPlugin(IPath path) {
- try {
- URL installURL= new URL(getDescriptor().getInstallURL(), path.toString());
- URL localURL= Platform.asLocalURL(installURL);
- return new File(localURL.getFile());
- } catch (IOException e) {
- return null;
- }
- }
-
-
-
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java
deleted file mode 100644
index 2843c2703b7..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/CTestSetup.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-
-
-public class CTestSetup extends TestSetup {
-
- /**
- * @deprecated
- * Not needed anymore. No added value
- */
- public CTestSetup(Test test) {
- super(test);
- }
-
- protected void setUp() throws Exception {
- }
-
- protected void tearDown() throws Exception {
- }
-
-
-
-
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java
deleted file mode 100644
index a6d6af47ca0..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/Main.java
+++ /dev/null
@@ -1,528 +0,0 @@
-package org.eclipse.cdt.testplugin;
-
-// copied from startup.jar. planned to be removed soon
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.net.*;
-import java.lang.reflect.*;
-import java.io.*;
-import java.util.*;
-/**
- * Startup class for Eclipse. Creates a class loader using
- * supplied URL of platform installation, loads and calls
- * the Eclipse Boot Loader. The startup arguments are as follows:
- * <dl>
- * <dd>
- * -application &lt;id&gt;: the identifier of the application to run
- * </dd>
- * <dd>
- * -boot &lt;location&gt;: the location, expressed as a URL, of the platform's boot.jar
- * </dd>
- * <dd>
- * -consolelog : enables log to the console. Handy when combined with -debug
- * </dd>
- * <dd>
- * -data &lt;location&gt;: sets the workspace location and the default location for projects
- * </dd>
- * <dd>
- * -debug [options file]: turns on debug mode for the platform and optionally specifies a location
- * for the .options file. This file indicates what debug points are available for a
- * plug-in and whether or not they are enabled. If a location is not specified, the platform searches
- * for the .options file under the install directory
- * </dd>
- * <dd>
- * -dev [entries]: turns on dev mode and optionally specifies comma-separated class path entries
- * which are added to the class path of each plug-in
- * </dd>
- * <dd>
- * -keyring &lt;location&gt;: the location of the authorization database on disk. This argument
- * has to be used together with the -password argument
- * </dd>
- * <dd>
- * -password &lt;passwd&gt;: the password for the authorization database
- * </dd>
- * <dd>
- * -plugins &lt;location&gt;: The arg is a URL pointing to a file which specs the plugin
- * path for the platform. The file is in property file format where the keys are user-defined
- * names and the values are comma separated lists of either explicit paths to plugin.xml
- * files or directories containing plugins. (e.g., .../eclipse/plugins).
- * </dd>
- * <dd>
- * -ws &lt;window system&gt;: sets the window system value
- * </dd>
- * </dl>
- */
-public class Main {
- /**
- * Indicates whether this instance is running in debug mode.
- */
- protected boolean debug = false;
-
- /**
- * The location of the launcher to run.
- */
- protected String bootLocation = null;
-
- /**
- * The identifier of the application to run.
- */
- protected String application;
-
- /**
- * The path for finding find plugins.
- */
- protected URL pluginPathLocation;
-
- /**
- * The boot path location.
- */
- protected String location;
-
- /**
- * Indicates whether items for UNinstallation should be looked for.
- */
- protected boolean uninstall = false;
-
- /**
- * The item to be uninstalled.
- */
- protected String uninstallCookie;
-
- /**
- * The class path entries.
- */
- protected String devClassPath = null;
-
- /**
- * Indicates whether this instance is running in development mode.
- */
- protected boolean inDevelopmentMode = false;
-
- // static token describing how to take down the splash screen
- private static String endSplash = null;
-
- // constants
- private static final String APPLICATION = "-application";
- private static final String BOOT = "-boot";
- private static final String DEBUG = "-debug";
- private static final String DEV = "-dev";
- private static final String ENDSPLASH = "-endsplash";
- private static final String UNINSTALL = "-uninstall";
- private static final String PI_BOOT = "org.eclipse.core.boot";
- private static final String BOOTLOADER = "org.eclipse.core.boot.BootLoader";
- private static final String UPDATELOADER = "org.eclipse.core.internal.boot.LaunchInfo";
-
- // The project containing the boot loader code. This is used to construct
- // the correct class path for running in VAJ and VAME.
- private static final String PROJECT_NAME = "Eclipse Core Boot";
-
- private static boolean inVAJ;
- static {
- try {
- Class.forName("com.ibm.uvm.lang.ProjectClassLoader");
- inVAJ = true;
- } catch (Exception e) {
- inVAJ = false;
- }
- }
- private static boolean inVAME;
- static {
- try {
- Class.forName("com.ibm.eclipse.core.VAME");
- inVAME = true;
- } catch (Exception e) {
- inVAME = false;
- }
- }
-
-/**
- * Executes the launch.
- *
- * @return the result of performing the launch
- * @param args command-line arguments
- * @exception Exception thrown if a problem occurs during the launch
- */
-protected Object basicRun(String[] args) throws Exception {
- Class clazz = getBootLoader(bootLocation);
- Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, URL.class, String.class, String[].class });
- try {
- return method.invoke(clazz, new Object[] { application, pluginPathLocation, location, args });
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof Error)
- throw (Error) e.getTargetException();
- else
- throw e;
- }
-}
-
-/**
- * Returns the result of converting a list of comma-separated tokens into an array
- *
- * @return the array of string tokens
- * @param prop the initial comma-separated string
- */
-private String[] getArrayFromList(String prop) {
- if (prop == null || prop.trim().equals(""))
- return new String[0];
- Vector list = new Vector();
- StringTokenizer tokens = new StringTokenizer(prop, ",");
- while (tokens.hasMoreTokens()) {
- String token = tokens.nextToken().trim();
- if (!token.equals(""))
- list.addElement(token);
- }
- return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[0]);
-}
-/**
- * Creates and returns a platform <code>BootLoader</code> which can be used to start
- * up and run the platform. The given base, if not <code>null</code>,
- * is the location of the boot loader code. If the value is <code>null</code>
- * then the boot loader is located relative to this class.
- *
- * @return the new boot loader
- * @param base the location of the boot loader
- */
-public Class getBootLoader(String base) throws Exception {
- URLClassLoader loader = new URLClassLoader(getBootPath(base), null);
- return loader.loadClass(BOOTLOADER);
-}
-/**
- * Returns the <code>URL</code>-based class path describing where the boot classes
- * are located when running in development mode.
- *
- * @return the url-based class path
- * @param base the base location
- * @exception MalformedURLException if a problem occurs computing the class path
- */
-protected URL[] getDevPath(URL base) throws MalformedURLException {
- URL url;
- String devBase = base.toExternalForm();
- if (!inDevelopmentMode) {
- url = new URL(devBase + "boot.jar");
- return new URL[] {url};
- }
- String[] locations = getArrayFromList(devClassPath);
- ArrayList result = new ArrayList(locations.length);
- for (int i = 0; i < locations.length; i++) {
- String spec = devBase + locations[i];
- char lastChar = spec.charAt(spec.length() - 1);
- if ((spec.endsWith(".jar") || (lastChar == '/' || lastChar == '\\')))
- url = new URL (spec);
- else
- url = new URL(spec + "/");
- //make sure URL exists before adding to path
- if (new java.io.File(url.getFile()).exists())
- result.add(url);
- }
- url = new URL(devBase + "boot.jar");
- if (new java.io.File(url.getFile()).exists())
- result.add(url);
- return (URL[])result.toArray(new URL[result.size()]);
-}
-
-/**
- * Returns the <code>URL</code>-based class path describing where the boot classes are located.
- *
- * @return the url-based class path
- * @param base the base location
- * @exception MalformedURLException if a problem occurs computing the class path
- */
-protected URL[] getBootPath(String base) throws MalformedURLException {
- URL url = null;
- // if the given location is not null, assume it is correct and use it.
- if (base != null) {
- url = new URL(base);
- if (debug)
- System.out.println("Boot URL: " + url.toExternalForm());
- return new URL[] {url};
- }
- // Create a URL based on the location of this class' code.
- // strip off jar file and/or last directory to get
- // to the directory containing projects.
- URL[] result = null;
- url = getClass().getProtectionDomain().getCodeSource().getLocation();
- String path = url.getFile();
- if (path.endsWith(".jar"))
- path = path.substring(0, path.lastIndexOf("/"));
- else
- if (path.endsWith("/"))
- path = path.substring(0, path.length() - 1);
- if (inVAJ || inVAME) {
- int ix = path.lastIndexOf("/");
- path = path.substring(0, ix + 1);
- path = path + PROJECT_NAME + "/";
- url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
- result = new URL[] {url};
- } else {
- path = searchForPlugins(path);
- path = searchForBoot(path);
- // add on any dev path elements
- url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
- result = getDevPath(url);
- }
- if (debug) {
- System.out.println("Boot URL:");
- for (int i = 0; i < result.length; i++)
- System.out.println(" " + result[i].toExternalForm());
- }
- return result;
-}
-
-/**
- * Searches for a plugins root starting at a given location. If one is
- * found then this location is returned; otherwise an empty string is
- * returned.
- *
- * @return the location where plugins were found, or an empty string
- * @param start the location to begin searching at
- */
-protected String searchForPlugins(String start) {
- File path = new File(start);
- while (path != null) {
- File test = new File(path, "plugins");
- if (test.exists())
- return test.toString();
- path = path.getParentFile();
- path = (path == null || path.length() == 1) ? null : path;
- }
- return "";
-}
-/**
- * Searches for a boot directory starting at a given location. If one
- * is found then this location is returned; otherwise an empty string
- * is returned.
- *
- * @return the location where plugins were found, or an empty string
- * @param start the location to begin searching at
- */
-protected String searchForBoot(String start) {
- FileFilter filter = new FileFilter() {
- public boolean accept(File candidate) {
- return candidate.getName().startsWith(PI_BOOT);
- }
- };
- File[] boots = new File(start).listFiles(filter);
- String result = null;
- String maxVersion = null;
- for (int i = 0; i < boots.length; i++) {
- String name = boots[i].getName();
- int index = name.lastIndexOf('_');
- if (index == -1) {
- result = boots[i].getAbsolutePath();
- i = boots.length;
- } else {
- if (index > 0) {
- String version = name.substring(index + 1);
- if (maxVersion == null) {
- result = boots[i].getAbsolutePath();
- maxVersion = version;
- } else
- if (maxVersion.compareTo(version) == -1) {
- result = boots[i].getAbsolutePath();
- maxVersion = version;
- }
- }
- }
- }
- if (result == null)
- throw new RuntimeException("Could not find bootstrap code. Check location of boot plug-in or specify -boot.");
- return result.replace(File.separatorChar, '/') + "/";
-}
-/**
- * Returns the update loader for the given boot path.
- *
- * @return the update loader
- * @param base the boot path base
- * @exception Exception thrown is a problem occurs determining this loader
- */
-public Class getUpdateLoader(String base) throws Exception {
- URLClassLoader loader = new URLClassLoader(getBootPath(base), null);
- return loader.loadClass(UPDATELOADER);
-}
-/**
- * Runs the platform with the given arguments. The arguments must identify
- * an application to run (e.g., <code>-application com.example.application</code>).
- * After running the application <code>System.exit(N)</code> is executed.
- * The value of N is derived from the value returned from running the application.
- * If the application's return value is an <code>Integer</code>, N is this value.
- * In all other cases, N = 0.
- * <p>
- * Clients wishing to run the platform without a following <code>System.exit</code>
- * call should use <code>run()</code>.
- *
- * @see #run
- *
- * @param args the command line arguments
- */
-public static void main(String[] args) {
- Object result = null;
- try {
- result = new Main().run(args);
- } catch (Throwable e) {
- // try and take down the splash screen.
- endSplash();
- System.out.println("Exception launching the Eclipse Platform:");
- e.printStackTrace();
- }
- int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0;
- System.exit(exitCode);
-}
-/**
- * Tears down the currently-displayed splash screen.
- */
-public static void endSplash() {
- if (endSplash == null)
- return;
- try {
- Runtime.getRuntime().exec(endSplash);
- } catch (Exception e) {
- }
-}
-
-/**
- * Runs this launcher with the arguments specified in the given string.
- *
- * @param argString the arguments string
- * @exception Exception thrown if a problem occurs during launching
- */
-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()]));
-}
-
-/**
- * Processes the command line arguments
- *
- * @return the arguments to pass through to the launched application
- * @param args the command line arguments
- */
-protected String[] processCommandLine(String[] args) throws Exception {
- int[] configArgs = new int[100];
- configArgs[0] = -1; // need to initialize the first element to something that could not be an index.
- int configArgIndex = 0;
- for (int i = 0; i < args.length; i++) {
- boolean found = false;
- // check for args without parameters (i.e., a flag arg)
- // check if debug should be enabled for the entire platform
- if (args[i].equalsIgnoreCase(DEBUG)) {
- debug = true;
- // passed thru this arg (i.e., do not set found = true
- continue;
- }
-
- // check if development mode should be enabled for the entire platform
- // If this is the last arg or there is a following arg (i.e., arg+1 has a leading -),
- // simply enable development mode. Otherwise, assume that that the following arg is
- // actually some additional development time class path entries. This will be processed below.
- if (args[i].equalsIgnoreCase(DEV) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) {
- inDevelopmentMode = true;
- // do not mark the arg as found so it will be passed through
- continue;
- }
-
- // done checking for args. Remember where an arg was found
- if (found) {
- configArgs[configArgIndex++] = i;
- continue;
- }
- // check for args with parameters. If we are at the last argument or if the next one
- // has a '-' as the first character, then we can't have an arg with a parm so continue.
- if (i == args.length - 1 || args[i + 1].startsWith("-"))
- continue;
- String arg = args[++i];
-
- // look for the laucher to run
- if (args[i - 1].equalsIgnoreCase(BOOT)) {
- bootLocation = arg;
- found = true;
- }
-
- // look for the development mode and class path entries.
- if (args[i - 1].equalsIgnoreCase(DEV)) {
- inDevelopmentMode = true;
- devClassPath = arg;
- continue;
- }
-
- // look for the application to run
- if (args[i - 1].equalsIgnoreCase(APPLICATION)) {
- application = arg;
- found = true;
- }
-
- // look for token to use to end the splash screen
- if (args[i - 1].equalsIgnoreCase(ENDSPLASH)) {
- endSplash = arg;
- continue;
- }
-
- // look for items to uninstall
- if (args[i - 1].equalsIgnoreCase(UNINSTALL)) {
- uninstall = true;
- uninstallCookie = arg;
- found = true;
- }
-
- // done checking for args. Remember where an arg was found
- if (found) {
- configArgs[configArgIndex++] = i - 1;
- configArgs[configArgIndex++] = i;
- }
- }
- // remove all the arguments consumed by this argument parsing
- if (configArgIndex == 0)
- return args;
- String[] passThruArgs = new String[args.length - configArgIndex];
- configArgIndex = 0;
- int j = 0;
- for (int i = 0; i < args.length; i++) {
- if (i == configArgs[configArgIndex])
- configArgIndex++;
- else
- passThruArgs[j++] = args[i];
- }
- return passThruArgs;
-}
-/**
- * Runs the application to be launched.
- *
- * @return the return value from the launched application
- * @param args the arguments to pass to the application
- * @exception thrown if a problem occurs during launching
- */
-public Object run(String[] args) throws Exception {
- String[] passThruArgs = processCommandLine(args);
- if (uninstall)
- return updateRun(UNINSTALL, uninstallCookie, passThruArgs);
- else
- return basicRun(passThruArgs);
-}
-/**
- * Performs an update run.
- *
- * @return the return value from the update loader
- * @param flag flag to give to the update loader
- * @param value value to give to the update loader
- * @param args arguments to give to the update loader.
- * @exception Exception thrown if a problem occurs during execution
- */
-protected Object updateRun(String flag, String value, String[] args) throws Exception {
- Class clazz = getUpdateLoader(bootLocation);
- Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, String.class, String.class, String[].class });
- try {
- return method.invoke(clazz, new Object[] { flag, value, location, args });
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof Error)
- throw (Error) e.getTargetException();
- else
- throw e;
- }
-}
-}
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java
deleted file mode 100644
index 66161e7a7bf..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/NewMain.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin;
-
-import java.io.File;
-import java.io.FileInputStream;
-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(getSettingsFile());
- properties.load(fis);
- return properties.getProperty(key);
- } catch (IOException e) {
- }
- return null;
- }
-
- private static File getSettingsFile() {
- String home= System.getProperty("user.home");
- if (home == null) {
- System.out.println("Home dir not defined");
- return null;
- }
- return new File(home, "eclipse-workspaces.properties");
- }
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java
deleted file mode 100644
index 4ee939df6b5..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestPluginLauncher.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin;
-
-import java.net.URL;
-
-/**
- * Helper class to launch a test
- */
-public class TestPluginLauncher {
-
- public static final String APP_NAME= "org.eclipse.jdt.ui.tests.app";
-
- public static void run(String location, Class testCase, String[] args) {
- run(APP_NAME, location, testCase, args);
- }
-
- public static void run(String application, String location, Class testCase, String[] args) {
- try {
- String bootLocation= getBootLocation();
- int nArgs= args.length;
- String[] newArgs= new String[4 + nArgs];
- newArgs[0]= testCase.getName();
- for (int i= 0; i < nArgs; i++) {
- newArgs[1 + i]= args[i];
- }
- newArgs[1 + nArgs]= "-dev";
- newArgs[1 + nArgs + 1]= "bin";
- newArgs[1 + nArgs + 2]= "-debug";
- NewMain newMain= new NewMain(application, location, null, bootLocation, false);
- newMain.run(newArgs);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public static String getLocationFromProperties(String key) {
- return NewMain.getLocationFromProperties(key);
- }
-
- public static String getLocationFromProperties() {
- return NewMain.getLocationFromProperties("tests");
- }
-
- public static String getBootLocation() {
- URL url= TestPluginLauncher.class.getResource("TestPluginLauncher.class");
- String s= url.toString();
- int index= s.indexOf("/org.eclipse.jdt.ui.tests");
- if (index == -1)
- throw new IllegalArgumentException();
- s= s.substring(0, index);
- s= s + "/org.eclipse.core.boot/boot.jar";
- return s;
- }
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestWorkbench.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestWorkbench.java
deleted file mode 100644
index 45bc1e8de3f..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/TestWorkbench.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.ui.internal.Workbench;
-
-public class TestWorkbench extends Workbench {
-
- /**
- * Run an event loop for the workbench.
- */
- protected void runEventLoop() {
- // Dispatch all events.
- Display display = Display.getCurrent();
- while (true) {
- try {
- if (!display.readAndDispatch())
- break;
- } catch (Throwable e) {
- break;
- }
- }
- IPath location= CTestPlugin.getDefault().getWorkspace().getRoot().getLocation();
- System.out.println("Workspace-location: " + location.toString());
-
-
- try {
- String[] args= getCommandLineArgs();
- if (args.length > 0) {
- Test test= getTest(args[0]);
- TestRunner.run(test);
- } else {
- System.out.println("TestWorkbench: Argument must be class name");
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
-
- // Close the workbench.
- close();
- }
-
- public Test getTest(String className) throws Exception {
- Class testClass= getClass().getClassLoader().loadClass(className);
-
- Method suiteMethod= null;
- try {
- suiteMethod= testClass.getMethod(TestRunner.SUITE_METHODNAME, new Class[0]);
- } catch (Exception e) {
- // try to extract a test suite automatically
- return new TestSuite(testClass);
- }
- try {
- return (Test) suiteMethod.invoke(null, new Class[0]); // static method
- } catch (InvocationTargetException e) {
- System.out.println("Failed to invoke suite():" + e.getTargetException().toString());
- } catch (IllegalAccessException e) {
- System.out.println("Failed to invoke suite():" + e.toString());
- }
- return null;
-
- }
-
-
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/test/HelloWorld.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/test/HelloWorld.java
deleted file mode 100644
index c46fa44e098..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/test/HelloWorld.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.testplugin.test;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.testplugin.CProjectHelper;
-import org.eclipse.cdt.testplugin.TestPluginLauncher;
-
-
-public class HelloWorld extends TestCase {
-
- private ICProject fCProject;
-
- public static void main(String[] args) {
- TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), HelloWorld.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(new HelloWorld("test1"));
- return suite;
- }
-
- public HelloWorld(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- fCProject= CProjectHelper.createCProject("TestProject1", "bin");
- }
-
-
- protected void tearDown() throws Exception {
- CProjectHelper.delete(fCProject);
- }
-
- public void test1() throws Exception {
-
- assertTrue("Exception to test", 0 != 0);
-
- }
-
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java
deleted file mode 100644
index 2a6e8fe44bd..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/AccessibilityTestPass.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-import java.util.ArrayList;
-
-
-public class AccessibilityTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 5;
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Accessibility";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the accessibility of the dialogs.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Accessibility";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) all widgets are accessible by tabbing.");
- list.add("&2) forwards and backwards tabbing is in a logical order");
- list.add("&3) all the widgets with labels have an appropriate mnemonic.");
- list.add("&4) there are no duplicate mnemonics.");
- list.add("&5) selectable widgets can be selected using the spacebar.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "Some widgets aren't accessible by tabbing.";
- failureText[1] = "Tabbing order is illogical.";
- failureText[2] = "Missing or inappropriate mnemonics.";
- failureText[3] = "Duplicate mnemonics.";
- failureText[4] = "Some widgets cannot be selected using the spacebar.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the accessibility of the dialog acceptable?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_ACCESS;
- }
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/DialogCheck.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/DialogCheck.java
deleted file mode 100644
index 8ef16ebce24..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/DialogCheck.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import junit.framework.Assert;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-
-import org.eclipse.ui.internal.WorkbenchPlugin;
-
-
-/**
- * A <code>DialogCheck</code> is used test a dialog in
- * various ways.
- * <p>
- * For interactive tests use <code>assertDialog</code>.
- * For automated tests use <code>assert DialogTexts</code>.
- * </p>
- */
-public class DialogCheck {
- private DialogCheck() {
- }
- private static VerifyDialog _verifyDialog;
-
-
- /**
- * Asserts that a given dialog is not null and that it passes
- * certain visual tests. These tests will be verified manually
- * by the tester using an input dialog. Use this assert method
- * to verify a dialog's sizing, initial focus, or accessiblity.
- * To ensure that both the input dialog and the test dialog are
- * accessible by the tester, the getShell() method should be used
- * when creating the test dialog.
- *
- * Example usage:
- * <code>Dialog dialog = new AboutDialog( DialogCheck.getShell() );
- * DialogCheck.assertDialog(dialog, this);</code>
- *
- * @param dialog the test dialog to be verified.
- * @param assert this is the test case object, assertions will be
- * executed on this object.
- */
- public static void assertDialog(Dialog dialog, Assert assert) {
- assert.assertNotNull(dialog);
- if (_verifyDialog.getShell() == null) {
- //force the creation of the verify dialog
- getShell();
- }
- if (_verifyDialog.open(dialog) == IDialogConstants.NO_ID) {
- assert.assertTrue(_verifyDialog.getFailureText(), false);
- }
- }
-
-
- /**
- * Automated test that checks all the labels and buttons of a dialog
- * to make sure there is enough room to display all the text. Any
- * text that wraps is only approximated and is currently not accurate.
- *
- * @param dialog the test dialog to be verified.
- * @param assert this is the test case object, assertions will be
- * executed on this object.
- */
- public static void assertDialogTexts(Dialog dialog, Assert assert) {
- assert.assertNotNull(dialog);
- dialog.setBlockOnOpen(false);
- dialog.open();
- Shell shell = dialog.getShell();
- verifyCompositeText(shell, assert);
- dialog.close();
- }
-
-
- /**
- * This method should be called when creating dialogs to test. This
- * ensures that the dialog's parent shell will be that of the
- * verification dialog.
- *
- * @return Shell The shell of the verification dialog to be used as
- * the parent shell of the test dialog.
- */
- public static Shell getShell() {
- Shell shell =
- WorkbenchPlugin
- .getDefault()
- .getWorkbench()
- .getActiveWorkbenchWindow()
- .getShell();
- _verifyDialog = new VerifyDialog(shell);
- _verifyDialog.create();
- return _verifyDialog.getShell();
- }
-
-
- /*
- * Looks at all the child widgets of a given composite and
- * verifies the text on all labels and widgets.
- * @param composite The composite to look through
- * @param assert The object to invoke assertions on.
- */
- private static void verifyCompositeText(Composite composite, Assert assert) {
- Control children[] = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- try {
- //verify the text if the child is a button
- verifyButtonText((Button) children[i], assert);
- } catch (ClassCastException exNotButton) {
- try {
- //child is not a button, maybe a label
- verifyLabelText((Label) children[i], assert);
- } catch (ClassCastException exNotLabel) {
- try {
- //child is not a label, make a recursive call if it is a composite
- verifyCompositeText((Composite) children[i], assert);
- } catch (ClassCastException exNotComposite) {
- //the child is not a button, label, or composite - ignore it.
- }
- }
- }
- }
- }
-
- /*
- * Verifies that a given button is large enough to display its text.
- * @param button The button to verify,
- * @param assert The object to invoke assertions on.
- */
- private static void verifyButtonText(Button button, Assert assert) {
- String widget = button.toString();
- Point size = button.getSize();
-
-
- //compute the size with no line wrapping
- Point preferred = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //if (size.y/preferred.y) == X, then label spans X lines, so divide
- //the calculated value of preferred.x by X
- if (preferred.y * size.y > 0) {
- preferred.y /= countLines(button.getText()); //check for '\n\'
- if (size.y / preferred.y > 1) {
- preferred.x /= (size.y / preferred.y);
- }
- }
-
-
- String message =
- new StringBuffer("Warning: ")
- .append(widget)
- .append("\n\tActual Width -> ")
- .append(size.x)
- .append("\n\tRecommended Width -> ")
- .append(preferred.x)
- .toString();
- if (preferred.x > size.x) {
- //close the dialog
- button.getShell().dispose();
- assert.assertTrue(message.toString(), false);
- }
- }
-
- /*
- * Verifies that a given label is large enough to display its text.
- * @param label The label to verify,
- * @param assert The object to invoke assertions on.
- */
- private static void verifyLabelText(Label label, Assert assert) {
- String widget = label.toString();
- Point size = label.getSize();
-
-
- //compute the size with no line wrapping
- Point preferred = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //if (size.y/preferred.y) == X, then label spans X lines, so divide
- //the calculated value of preferred.x by X
- if (preferred.y * size.y > 0) {
- preferred.y /= countLines(label.getText());
- if (size.y / preferred.y > 1) {
- preferred.x /= (size.y / preferred.y);
- }
- }
- String message =
- new StringBuffer("Warning: ")
- .append(widget)
- .append("\n\tActual Width -> ")
- .append(size.x)
- .append("\n\tRecommended Width -> ")
- .append(preferred.x)
- .toString();
- if (preferred.x > size.x) {
- //close the dialog
- label.getShell().dispose();
- assert.assertTrue(message.toString(), false);
- }
- }
-
- /*
- * Counts the number of lines in a given String.
- * For example, if a string contains one (1) newline character,
- * a value of two (2) would be returned.
- * @param text The string to look through.
- * @return int the number of lines in text.
- */
- private static int countLines(String text) {
- int newLines = 1;
- for (int i = 0; i < text.length(); i++) {
- if (text.charAt(i) == '\n') {
- newLines++;
- }
- }
- return newLines;
- }
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java
deleted file mode 100644
index d7cc8c48187..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStrings.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-import java.util.Stack;
-/**
- * @author Peter Graves
- *
- * This utility class maintains a list of strings, and as a tests finds strings
- * in a structure/list, it will maintain a list of unfound/extra strings.
- */
-public class ExpectedStrings {
-
- public String [] expStrings;
- private boolean[] foundStrings;
- private Stack extraStrings; /* A stack of the unecpected strings we
- * recieved
- */
- private boolean extra;
-
- /**
- * Constructor for ExpectedStrings.
- */
- public ExpectedStrings() {
- }
- /**
- * Constructor for ExpectedStrings that accepts a list of strings that
- * we expect to get.
- */
- public ExpectedStrings(String[] values) {
- int x;
- expStrings=new String[values.length];
- for (x=0;x<values.length;x++) {
- expStrings[x]=new String(values[x]);
- }
- foundStrings=new boolean[values.length];
- for (x=0;x<values.length;x++) {
- foundStrings[x]=false;
- }
- extraStrings=new Stack();
- extra=false;
- }
-
- public int foundString(String current) {
- int x;
- for (x=0;x<expStrings.length;x++) {
- if (current.equals(expStrings[x])) {
- foundStrings[x]=true;
- return(0);
- }
- }
- /* If we arrive here, the strings was not found, so this is
- * and extra string
- */
-
- extraStrings.push(new String(current));
- extra=true;
- return(1);
- }
- public int getNum(String name) {
- int x;
- for (x=0;x<expStrings.length;x++) {
- if (name.equals(expStrings[x]))
- return(x);
- }
- return(-1);
- }
- public boolean gotAll() {
- int x;
- for (x=0;x<expStrings.length;x++) {
- if (foundStrings[x]==false)
- return(false);
- }
- return(true);
- }
- public boolean gotExtra() {
- return(extra);
- }
- public String getMissingString() {
- int x;
- String missing = new String("Missing elements: ");
- for (x=0;x<expStrings.length;x++) {
- if (foundStrings[x]==false)
- missing+=expStrings[x];
- missing+=" ";
- }
- return(missing);
- }
- public String getExtraString() {
- String extra= new String("Extra elements: ");
- while (!extraStrings.empty()) {
- extra+=extraStrings.pop();
- extra+=" ";
- }
- return(extra);
- }
-}
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java
deleted file mode 100644
index 30d67776b34..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/ExpectedStringsTests.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * @author Peter Graves
- *
- *Some simple tests to make sure our ExtraStrings class seems to work.
- */
-public class ExpectedStringsTests extends TestCase {
-
- /**
- * Constructor for ExpectedStringsTests.
- * @param name
- */
- public ExpectedStringsTests(String name) {
- super(name);
- }
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() {
-
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() {
- // release resources here and clean-up
- }
-
- public static TestSuite suite() {
- return new TestSuite(ExpectedStringsTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
- public void testGotAll() {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertTrue("No found strings", !myExp.gotAll());
- myExp.foundString("stringOne");
- assertTrue("1 found strings", !myExp.gotAll());
- myExp.foundString("stringTwo");
- assertTrue("2 found strings", !myExp.gotAll());
- myExp.foundString("stringThree");
- assertTrue("All found strings", myExp.gotAll());
-
-
- }
- public void testGotExtra () {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertTrue("No found strings", !myExp.gotExtra());
- myExp.foundString("stringOne");
- assertTrue("1 found strings", !myExp.gotExtra());
- myExp.foundString("stringTwo");
- assertTrue("2 found strings", !myExp.gotExtra());
- myExp.foundString("stringThree");
- assertTrue("All found strings", !myExp.gotExtra());
- myExp.foundString("Somerandomestring");
- assertTrue("Extra String", myExp.gotExtra());
-
- }
-
- public void testGetMissingString()
- {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringOne");
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringTwo");
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringThree");
- assertNotNull(myExp.getMissingString());
-
- }
-
- public void testGetExtraString()
- {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertNotNull(myExp.getExtraString());
- myExp.foundString("stringOnenot");
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringTwonot");
- assertNotNull(myExp.getMissingString());
-
- }
-
-
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java
deleted file mode 100644
index dbe98db5652..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FailureDialog.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-
-
-/*
- * A dialog for collecting notes from the tester regarding
- * the failure of a test.
- */
-public class FailureDialog extends Dialog {
- private Text _text;
- private String _log;
- private int SIZING_TEXT_WIDTH = 400;
- private int SIZING_TEXT_HEIGHT = 200;
-
- /**
- * Constructor for FailureDialog
- */
- public FailureDialog(Shell parentShell) {
- super(parentShell);
- }
- /* (non-Javadoc)
- * Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Dialog Test Failed");
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, "&OK", true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // page group
- Composite composite = (Composite)super.createDialogArea(parent);
- composite.setSize( composite.computeSize(SWT.DEFAULT, SWT.DEFAULT) );
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText("&Enter a note regarding the failure:");
-
- _text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- _text.setFont( JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT) );
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = SIZING_TEXT_WIDTH;
- data.heightHint = SIZING_TEXT_HEIGHT;
- _text.setLayoutData(data);
-
- return composite;
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void okPressed() {
- _log = _text.getText();
- super.okPressed();
- }
- /*
- * @return String the text contained in the input area of
- * the dialog.
- */
- String getText() {
- if (_log == null) {
- return "Empty entry.";
- } else {
- return _log;
- }
- }
- /*
- * Sets the text of the input area. This should only be
- * called to set the initial text so only call before invoking
- * open().
- */
- void setText(String text) {
- _text.setText(text);
- }
- /*
- * Returns a string representation of this class which
- * the text contained in the input area of the dialog.
- */
- public String toString() {
- return getText();
- }
-}
-
-
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java
deleted file mode 100644
index 0f83e03c1c2..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/FocusTestPass.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-
-/*
- * This test pass verifies the initial focus of a dialog
- * when it is given focus.
- */
-public class FocusTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 1;
-
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Initial Focus";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the initial focus of the dialogs.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Initial Focus";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) the initial focus is appropriate.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "The initial focus is inappropriate.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the initial focus of the dialog correct?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_FOCUS;
- }
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java
deleted file mode 100644
index be34fbadf8c..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/IDialogTestPass.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-import java.util.ArrayList;
-
-
-/*
- * Interface to describe a visual test pass for a dialog test.
- */
-public interface IDialogTestPass {
- /*
- * @return String The title of the test pass.
- */
- public String title();
- /*
- * @return String The description of the test pass.
- */
- public String description();
- /*
- * @return String The label of the test pass to be used
- * in a selection list. The return includes an '&'
- * if a mnemonic is desired.
- */
- public String label();
- /*
- * @return ArrayList A list of items to appear in a checklist.
- * The items in the list must be Strings and should include an
- * '&' if a mnemonic is desired.
- */
- public ArrayList checkListTexts();
- /*
- * @return String[] Associated failure messages that correspond
- * to the checklist items. The size of this array should be the
- * same size as the checklist.
- */
- public String[] failureTexts();
- /*
- * @return String The test that corresponds to the test pass to
- * which the tester will respond with a 'yes' or 'no'.
- */
- public String queryText();
- /*
- * @return int A unique number that identifies the test pass.
- */
- public int getID();
-}
-
-
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java
deleted file mode 100644
index dc471637e66..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/SizingTestPass.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-
-/*
- * This test pass verifies visually the sizing of the dialog and its
- * widgets.
- */
-class SizingTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 5;
-
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Sizing and Display";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the sizing and display of the dialogs and widgets.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Sizing and Display";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) the correct dialog displays.");
- list.add("&2) the dialog is an appropriate size for the required resolution (1024x768).");
- list.add("&3) the texts are correct and not cut off.");
- list.add("&4) all strings have been externalized properly.");
- list.add("&5) all the widgets are viewable and not cut off.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "The wrong dialog displayed.";
- failureText[1] = "The dialog is too large for the required resolution.";
- failureText[2] = "Text labels are wrong or cut off.";
- failureText[3] = "Some strings have not been externalized properly.";
- failureText[4] = "Some widgets are cut off.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the sizing and display of the dialog correct?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_SIZING;
- }
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java
deleted file mode 100644
index a28a1e43524..00000000000
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/testplugin/util/VerifyDialog.java
+++ /dev/null
@@ -1,305 +0,0 @@
-package org.eclipse.cdt.testplugin.util;
-
-
-import java.util.Iterator;
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-/*
- * This dialog is intended to verify a dialogs in a testing
- * environment. The tester can test for sizing, initial focus,
- * or accessibility.
- */
-public class VerifyDialog extends TitleAreaDialog {
- private int SIZING_WIDTH = 400;
-
- private static int TEST_TYPE;
- public static final int TEST_SIZING = 0;
- public static final int TEST_FOCUS = 1;
- public static final int TEST_ACCESS = 2;
- private IDialogTestPass _dialogTests[] = new IDialogTestPass[3];
-
-
- private Dialog _testDialog; //the dialog to test
- private Point _testDialogSize;
-
- private Label _queryLabel;
- private Button _yesButton;
- private Button _noButton;
- private Button _checkList[];
- private String _failureText;
-
- /*
- * Create an instance of the verification dialog.
- */
- public VerifyDialog(Shell parent) {
- super(parent);
- if ( !(TEST_TYPE <= 2) && !(TEST_TYPE >= 0) ) {
- TEST_TYPE = TEST_SIZING;
- }
- _failureText = "";
- _dialogTests[0] = new SizingTestPass();
- _dialogTests[1] = new FocusTestPass();
- _dialogTests[2] = new AccessibilityTestPass();
- }
-
- /* (non-Javadoc)
- * Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Dialog Verification");
- setShellStyle(SWT.NONE);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- _yesButton = createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true);
- _noButton = createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void buttonPressed(int buttonId) {
- if (IDialogConstants.YES_ID == buttonId) {
- setReturnCode(IDialogConstants.YES_ID);
- if (_testDialog.getShell() != null) {
- _testDialog.close();
- }
- close();
- } else if (IDialogConstants.NO_ID == buttonId) {
- handleFailure();
- }
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // top level composite
- Composite parentComposite = (Composite)super.createDialogArea(parent);
-
-
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parentComposite, SWT.NONE);
- composite.setSize(SIZING_WIDTH, SWT.DEFAULT);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
- createTestSelectionGroup(composite);
- createCheckListGroup(composite);
-
-
- _queryLabel = new Label(composite, SWT.NONE);
- _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- initializeTest();
- return composite;
- }
- /*
- * Group for selecting type of test.
- */
- private void createTestSelectionGroup(Composite parent) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Testing:");
- group.setLayout( new GridLayout() );
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- for (int i = 0; i < _dialogTests.length; i++) {
- Button radio = new Button(group, SWT.RADIO);
- radio.setText( _dialogTests[i].label() );
- final int testID = _dialogTests[i].getID();
- radio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- TEST_TYPE = testID;
- initializeTest();
- _yesButton.setEnabled(true);
- }
- });
- if ( TEST_TYPE == _dialogTests[i].getID() ) {
- radio.setSelection(true);
- }
- }
- }
- /*
- * Initializes the checklist with empty checks.
- */
- private void createCheckListGroup(Composite parent) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Verify that:");
- group.setLayout( new GridLayout() );
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- int checkListSize = 0;
- for (int i = 0; i < _dialogTests.length; i++) {
- int size = _dialogTests[i].checkListTexts().size();
- if (size > checkListSize) {
- checkListSize = size;
- }
- }
- _checkList = new Button[checkListSize];
- SelectionAdapter selectionAdapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- checkYesEnable();
- }
- };
- for (int i = 0; i < checkListSize; i++) {
- _checkList[i] = new Button(group, SWT.CHECK);
- _checkList[i].addSelectionListener(selectionAdapter);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- _checkList[i].setLayoutData(data);
- }
- }
- /*
- * Disables the yes button if any of the items in the checklist
- * are unchecked. Enables the yes button otherwise.
- */
- private void checkYesEnable() {
- boolean enable = true;
- for (int i = 0; i < _checkList.length; i++) {
- if ( !_checkList[i].getSelection() ) {
- enable = false;
- }
- }
- _yesButton.setEnabled(enable);
- }
- /*
- * Initializes the checklist, banner texts, and query label
- */
- private void initializeTest() {
- IDialogTestPass test = _dialogTests[TEST_TYPE];
- setTitle( test.title() );
- setMessage( test.description() );
- Iterator iterator = test.checkListTexts().iterator();
- for (int i = 0; i < _checkList.length; i++) {
- if ( iterator.hasNext() ) {
- _checkList[i].setText( iterator.next().toString() );
- _checkList[i].setVisible(true);
- _checkList[i].update();
- } else {
- _checkList[i].setVisible(false);
- _checkList[i].update();
- }
- _checkList[i].setSelection(true);
- }
- _queryLabel.setText( test.queryText() );
- }
- public String getFailureText() {
- return _failureText;
- }
- /*
- * Can't open the verification dialog without a specified
- * test dialog, this simply returns a failure and prevents
- * opening. Should use open(Dialog) instead.
- *
- */
- public int open() {
- _failureText = "Testing dialog is required, use VerifyDialog::open(Dialog)";
- return IDialogConstants.NO_ID;
- }
- /*
- * Opens the verification dialog to test the specified dialog.
- */
- public int open(Dialog testDialog) {
- if (getShell() == null) {
- create();
- }
- getShell().setLocation(0, 0);
- getShell().setSize(Math.max(SIZING_WIDTH, getShell().getSize().x), getShell().getSize().y);
- _testDialog = testDialog;
- if (_testDialog.getShell() == null) {
- _testDialog.create();
- }
- _testDialogSize = _testDialog.getShell().getSize();
- openNewTestDialog();
-
- return super.open();
- }
- /*
- * Opens the dialog to be verified.
- */
- private void openNewTestDialog() {
- if (_testDialog.getShell() == null) {
- _testDialog.create();
- }
- _testDialog.setBlockOnOpen(false);
- _testDialog.getShell().setLocation(getShell().getSize().x + 1, 0);
- _testDialog.getShell().setSize(_testDialogSize);
- _testDialog.getShell().addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {
- e.doit = false;
- }
-
- });
- _testDialog.open();
- }
- /*
- * The test dialog failed, open the failure dialog.
- */
- private void handleFailure() {
- IDialogTestPass test = _dialogTests[TEST_TYPE];
- StringBuffer text = new StringBuffer();
- String label = test.label();
- label = label.substring(0, label.indexOf("&")) +
- label.substring(label.indexOf("&") + 1);
- text.append(label).
- append(" failed on the ").
- append(SWT.getPlatform()).
- append(" platform:\n");
-
- String failureMessages[] = test.failureTexts();
- for (int i = 0; i < test.checkListTexts().size(); i++) {
- if ( !_checkList[i].getSelection() ) {
- text.append("- ").append(failureMessages[i]).append("\n");
- }
- }
- FailureDialog dialog = new FailureDialog( getShell() );
- dialog.create();
- String temp = text.toString();
- dialog.setText( text.toString() );
- if (dialog.open() == IDialogConstants.OK_ID) {
- _failureText = dialog.toString();
- setReturnCode(IDialogConstants.NO_ID);
- if (_testDialog.getShell() != null) {
- _testDialog.close();
- }
- close();
- }
- }
- /*
- * In case the shell was closed by a means other than
- * the NO button.
- */
- protected void handleShellCloseEvent() {
- handleFailure();
- }
-}
-
-
diff --git a/core/org.eclipse.cdt.ui.tests/test.xml b/core/org.eclipse.cdt.ui.tests/test.xml
deleted file mode 100644
index 45036dab5c6..00000000000
--- a/core/org.eclipse.cdt.ui.tests/test.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.jdt.ui.tests"/>
- <property name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jdt-folder"
- value="${eclipse-home}/jdt_folder"/>
- <delete dir="${jdt-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jdt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.jdt.ui.tests.AutomatedSuite"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java
deleted file mode 100644
index e26d664c77d..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/AutomatedSuite.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.cdt.ui.tests;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.ui.tests.text.PartitionTokenScannerTest;
-import org.eclipse.cdt.ui.tests.textmanipulation.TextBufferTest;
-
-
-
-/**
- * Test all areas of the UI.
- */
-public class AutomatedSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new AutomatedSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public AutomatedSuite() {
- addTest(PartitionTokenScannerTest.suite());
- addTest(TextBufferTest.suite());
-
-
- }
-
-}
-
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/UIInteractiveSuite.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/UIInteractiveSuite.java
deleted file mode 100644
index 6d731fbc582..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/UIInteractiveSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.ui.tests;
-
-import org.eclipse.cdt.ui.tests.dialogs.PreferencesTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * Test all areas of the UI.
- */
-public class UIInteractiveSuite extends TestSuite {
-
- /**
- * Returns the suite. This is required to
- * use the JUnit Launcher.
- */
- public static Test suite() {
- return new UIInteractiveSuite();
- }
-
- /**
- * Construct the test suite.
- */
- public UIInteractiveSuite() {
- addTest(PreferencesTest.suite());
- //addTest(WizardsTest.suite());
- //addTest(DialogsTest.suite());
- }
-
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/dialogs/PreferencesTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/dialogs/PreferencesTest.java
deleted file mode 100644
index 4b77f378984..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/dialogs/PreferencesTest.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.ui.tests.dialogs;
-
-import java.util.Iterator;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.testplugin.TestPluginLauncher;
-import org.eclipse.cdt.testplugin.util.DialogCheck;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.IHelpContextIds;
-import org.eclipse.ui.internal.WorkbenchMessages;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-import org.eclipse.ui.internal.dialogs.PropertyDialog;
-import org.eclipse.ui.internal.dialogs.PropertyPageContributorManager;
-import org.eclipse.ui.internal.dialogs.PropertyPageManager;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-
-public class PreferencesTest extends TestCase {
-
- public static void main(String[] args) {
- TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), PreferencesTest.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite(PreferencesTest.class.getName());
- suite.addTest(new PreferencesTest("testCBasePrefPage"));
- suite.addTest(new PreferencesTest("testTemplatePrefPage"));
- suite.addTest(new PreferencesTest("testProjectPropertyPrefPage"));
- suite.addTest(new PreferencesTest("testCEditorPrefPage"));
- return suite;
- }
-
- private static class PreferenceDialogWrapper extends PreferenceDialog {
-
- public PreferenceDialogWrapper(Shell parentShell, PreferenceManager manager) {
- super(parentShell, manager);
- }
- protected boolean showPage(IPreferenceNode node) {
- return super.showPage(node);
- }
- }
-
- private class PropertyDialogWrapper extends PropertyDialog {
-
- public PropertyDialogWrapper(Shell parentShell, PreferenceManager manager, ISelection selection) {
- super(parentShell, manager, selection);
- }
- protected boolean showPage(IPreferenceNode node) {
- return super.showPage(node);
- }
- }
-
-
- private boolean fIsInteractive= true;
-
- private static final String PROJECT_NAME = "DummyProject";
-
- public PreferencesTest(String name) {
- super(name);
- }
-
- private Shell getShell() {
- return DialogCheck.getShell();
- }
-
- public void assertDialog(Dialog dialog, Assert assertTrue) {
- if (fIsInteractive) {
- DialogCheck.assertDialog(dialog, this);
- } else {
- DialogCheck.assertDialogTexts(dialog, this);
- }
- }
-
-
- private PreferenceDialog getPreferenceDialog(String id) {
- PreferenceDialogWrapper dialog = null;
- PreferenceManager manager = WorkbenchPlugin.getDefault().getPreferenceManager();
- if (manager != null) {
- dialog = new PreferenceDialogWrapper(getShell(), manager);
- dialog.create();
- WorkbenchHelp.setHelp(dialog.getShell(), IHelpContextIds.PREFERENCE_DIALOG);
-
- for (Iterator iterator = manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();)
- {
- IPreferenceNode node = (IPreferenceNode)iterator.next();
- if ( node.getId().equals(id) ) {
- dialog.showPage(node);
- break;
- }
- }
- }
- return dialog;
- }
-
- private PropertyDialog getPropertyDialog(String id, IAdaptable element) {
- PropertyDialogWrapper dialog = null;
-
- PropertyPageManager manager = new PropertyPageManager();
- String title = "";
- String name = "";
-
- // load pages for the selection
- // fill the manager with contributions from the matching contributors
- PropertyPageContributorManager.getManager().contribute(manager, element);
-
- IWorkbenchAdapter adapter = (IWorkbenchAdapter)element.getAdapter(IWorkbenchAdapter.class);
- if (adapter != null) {
- name = adapter.getLabel(element);
- }
-
- // testing if there are pages in the manager
- Iterator pages = manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- if (!pages.hasNext()) {
- return null;
- } else {
- title = WorkbenchMessages.format("PropertyDialog.propertyMessage", new Object[] {name});
- dialog = new PropertyDialogWrapper(getShell(), manager, new StructuredSelection(element));
- dialog.create();
- dialog.getShell().setText(title);
- WorkbenchHelp.setHelp(dialog.getShell(), IHelpContextIds.PROPERTY_DIALOG);
- for (Iterator iterator = manager.getElements(PreferenceManager.PRE_ORDER).iterator();
- iterator.hasNext();)
- {
- IPreferenceNode node = (IPreferenceNode)iterator.next();
- if ( node.getId().equals(id) ) {
- dialog.showPage(node);
- break;
- }
- }
- }
- return dialog;
- }
-
- public void testCBasePrefPage() {
- Dialog dialog = getPreferenceDialog("org.eclipse.cdt.ui.preferences.CPluginPreferencePage");
- assertDialog(dialog, this);
- }
-
- public void testProjectPropertyPrefPage() {
- Dialog dialog = getPreferenceDialog("org.eclipse.cdt.ui.preferences.CProjectPropertyPage");
- assertDialog(dialog, this);
- }
-
- public void testTemplatePrefPage() {
- Dialog dialog = getPreferenceDialog("org.eclipse.cdt.ui.preferences.TemplatePreferencePage");
- assertDialog(dialog, this);
- }
-
-
- public void testCEditorPrefPage() {
- Dialog dialog = getPreferenceDialog("org.eclipse.cdt.ui.preferences.CEditorPreferencePage");
- assertDialog(dialog, this);
- }
-
-
- /* public void testInfoPropPage() throws Exception {
- IJavaProject jproject= JavaProjectHelper.createJavaProject(PROJECT_NAME, "bin");
- IPackageFragmentRoot root= JavaProjectHelper.addSourceContainer(jproject, "src");
- IPackageFragment pack= root.createPackageFragment("org.eclipse.jdt.internal.ui.wizards.dummy", true, null);
- ICompilationUnit cu= pack.getCompilationUnit("DummyCompilationUnitWizard.java");
- IType type= cu.createType("public class DummyCompilationUnitWizard {\n\n}\n", null, true, null);
-
- Dialog dialog = getPropertyDialog("org.eclipse.jdt.ui.propertyPages.InfoPage", cu);
- assertDialog(dialog, this);
-
- JavaProjectHelper.delete(jproject);
- } */
-
-
-
-
-}
-
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java
deleted file mode 100644
index a5efb1efe63..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/PartitionTokenScannerTest.java
+++ /dev/null
@@ -1,253 +0,0 @@
-package org.eclipse.cdt.ui.tests.text;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.internal.ui.text.CPartitionScanner;
-import org.eclipse.cdt.internal.ui.text.FastCPartitionScanner;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.rules.IPartitionTokenScanner;
-import org.eclipse.jface.text.rules.IToken;
-
-/**
- * Compares two <code>IParitionTokenScanner</code>s for conformance and performance.
- */
-public class PartitionTokenScannerTest extends TestCase {
-
- private IPartitionTokenScanner fReference;
- private IPartitionTokenScanner fTestee;
-
- public PartitionTokenScannerTest(String name) {
- super(name);
- }
-
- protected void setUp() {
- fReference= new CPartitionScanner();
- fTestee= new FastCPartitionScanner();
- }
-
- // read sample java file
- private IDocument getDocument(String name, String lineDelimiter) {
- try {
- InputStream stream= getClass().getResourceAsStream(name);
- BufferedReader reader= new BufferedReader(new InputStreamReader(stream));
-
- StringBuffer buffer= new StringBuffer();
- String line= reader.readLine();
- while (line != null) {
- buffer.append(line);
- buffer.append(lineDelimiter);
- line= reader.readLine();
- }
-
- return new Document(buffer.toString());
-
- } catch (IOException e) {
- }
-
- return null;
- }
-
- private static IDocument getRandomDocument(int size) {
- final char[] characters= {'/', '*', '\'', '"', '\r', '\n', '\\'};
- final StringBuffer buffer= new StringBuffer();
-
- for (int i= 0; i < size; i++) {
- final int randomIndex= (int) (Math.random() * characters.length);
- buffer.append(characters[randomIndex]);
- }
-
- return new Document(buffer.toString());
- }
-
- public static Test suite() {
- return new TestSuite(PartitionTokenScannerTest.class);
- }
-
- public void testTestCaseLF() {
- testConformance(getDocument("TestCase.txt", "\n"));
- }
-
- public void testTestCaseCRLF() {
- testConformance(getDocument("TestCase.txt", "\r\n"));
- }
-
- public void testTestCaseCR() {
- testConformance(getDocument("TestCase.txt", "\r"));
- }
-
- public void testTestCase2LF() {
- testConformance(getDocument("TestCase2.txt", "\n"));
- }
-
- public void testTestCase2CRLF() {
- testConformance(getDocument("TestCase2.txt", "\r\n"));
- }
-
- public void testTestCase2CR() {
- testConformance(getDocument("TestCase2.txt", "\r"));
- }
-
-// XXX not fully passing because of "\<LF> and '\<LF>
-// public void testRandom() {
-// testConformance(getRandomDocument(2048));
-// }
-
- /**
- * Tests performance of the testee against the reference IPartitionTokenScanner.
- */
- public void testPerformance() {
- final int COUNT= 5000;
- final IDocument document= getDocument("TestCase.txt", "\n");
-
- final long referenceTime= getTime(fReference, document, COUNT);
- final long testeeTime= getTime(fTestee, document, COUNT);
-
- if (false) {
- System.out.println("reference time = " + referenceTime / 1000.0f);
- System.out.println("testee time = " + testeeTime / 1000.0f);
- System.out.println("factor = " + (float) referenceTime / testeeTime);
- }
-
- // dangerous: assert no regression in performance
- // assertTrue(testeeTime <= referenceTime);
- }
-
- private long getTime(IPartitionTokenScanner scanner, IDocument document, int count) {
- final long start= System.currentTimeMillis();
-
- for (int i= 0; i < count; i++)
- testPerformance(scanner, document);
-
- final long end= System.currentTimeMillis();
-
- return end - start;
- }
-
- private void testConformance(final IDocument document) {
-
- final StringBuffer message= new StringBuffer();
-
- fReference.setRange(document, 0, document.getLength());
- fTestee.setRange(document, 0, document.getLength());
-
- while (true) {
-
- message.setLength(0);
-
- final IToken referenceToken= fReference.nextToken();
- final IToken testeeToken= fTestee.nextToken();
- assertTokenEquals(referenceToken, testeeToken);
-
- final int referenceOffset= fReference.getTokenOffset();
- final int testeeOffset= fTestee.getTokenOffset();
- message.append(", offset = " + referenceOffset);
- message.append(", " + extractString(document, referenceOffset));
- assertEquals(message.toString(), referenceOffset, testeeOffset);
-
- int referenceLength= fReference.getTokenLength();
- final int testeeLength= fTestee.getTokenLength();
- if(referenceLength != testeeLength) {
- // Special case where the dum scanner creates a token for every character...
- IToken t;
- while(referenceLength < testeeLength) {
- t = fReference.nextToken();
- referenceLength += fReference.getTokenLength();
- if(referenceToken != t)
- assertEquals(message.toString(), referenceToken, t);
- }
- }
- message.append(", length = " + referenceLength);
- assertEquals(message.toString(), referenceLength, testeeLength);
-
- if (referenceToken.isEOF())
- break;
- }
- }
-
- private static void testPerformance(final IPartitionTokenScanner scanner, final IDocument document) {
-
- scanner.setRange(document, 0, document.getLength());
-
- IToken token;
- do {
- token= scanner.nextToken();
- scanner.getTokenOffset();
- scanner.getTokenLength();
-
- } while (!token.isEOF());
- }
-
- private void assertTokenEquals(IToken expected, IToken actual) {
- assertEquals(expected.isEOF(), actual.isEOF());
- assertEquals(expected.isOther(), actual.isOther());
- assertEquals(expected.isUndefined(), actual.isUndefined());
- assertEquals(expected.isWhitespace(), actual.isWhitespace());
- }
-
- private static String extractString(IDocument document, int offset) {
- final StringBuffer buffer= new StringBuffer();
-
- try {
- IRegion region= document.getLineInformationOfOffset(offset);
- String line= document.get(region.getOffset(), region.getLength());
-
- int offsetIndex= offset - region.getOffset();
-
- // XXX kludge
- if (offsetIndex > line.length())
- offsetIndex= line.length();
-
- buffer.append("line = " + document.getLineOfOffset(offset) + ": [");
- buffer.append(line.substring(0, offsetIndex));
- buffer.append("<POS>");
- buffer.append(line.substring(offsetIndex));
- buffer.append(']');
-
- } catch (BadLocationException e) {
- }
-
- return buffer.toString();
- }
-
- /**
- * Escapes CR, LF and TAB in a string.
- */
- private static String escape(String string) {
- final StringBuffer buffer= new StringBuffer();
-
- final int length= string.length();
- for (int i= 0; i < length; i++) {
- final char character= string.charAt(i);
- switch (character) {
- case '\t':
- buffer.append("\\t");
- break;
-
- case '\r':
- buffer.append("\\r");
- break;
-
- case '\n':
- buffer.append("\\n");
- break;
-
- default:
- buffer.append(character);
- break;
- }
- }
-
- return buffer.toString();
- }
-
-}
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt
deleted file mode 100644
index 09eca5f9f63..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase.txt
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.eclipse.jdt.ui.tests.text;
-
-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 String fName;
-
- /**
- * No-arg constructor to enable serialization. This method
- * is not intended to be used by mere mortals.
- */
- TestCase() {
- fName= null;
- }
-
- /**
- * 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.
- * @deprecated use getName()
- */
- 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, null);
- } catch (NoSuchMethodException e) {
- fail("Method \""+fName+"\" not found");
- }
- if (!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()+")";
- }
- /**
- * Gets the name of a TestCase
- * @return returns a String
- */
- public String getName() {
- return fName;
- }
-
- /**
- * Sets the name of a TestCase
- * @param name The name to set
- */
- public void setName(String name) {
- fName= name;
- }
-
-} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt
deleted file mode 100644
index f9a86b87366..00000000000
--- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/TestCase2.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.eclipse.jdt.ui.tests.text;
-
-/**
- * javadoc
- */
-public class TestCase2 {
- /*
- * multi line comment
- */
- private void foo() {
- // single line comment
- int value= 42;
-
- /**/
-
- String s= "string";
- char c= 'c';
-
- String s2= "string2"/* ads*/;
-
- Nastyness: ""/**/''"";
-
- // open strings and characters
- 'open characters
- "open strings
-
- // all state transitions
- /* multi line comment */// single line comment
- /* multi line comment *//* multi line comment */
- /* multi line comment *//** java doc */
- /* multi line comment */'character'
- /* multi line comment */"string"
- /* java doc */// single line comment
- /* java doc *//* multi line comment */
- /* java doc *//** java doc */
- /* java doc */'character'
- /* java doc */"string"
- "string"// single line comment
- "string"//* multi line comment */
- "string"/** java doc */
- "string"'character'
- "string""string"
- 'character'// single line comment
- 'character'"//* multi line comment */
- 'character'/** java doc */
- 'character''character'
- 'character'"string"
-
- // more nasty cases
- /'asdf
- /"asdf
-
- /**
- * // single line comment inside javadoc
- */
-
- /*
- * // single line comment inside multi-line comment
- */
-
- // would fail conformance, but it's ok
- "<backslash>
- '<backslash>
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/.classpath b/debug/org.eclipse.cdt.debug.ui.tests/.classpath
deleted file mode 100644
index 0bf2a1c6967..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/.classpath
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/"/>
- <classpathentry kind="src" path="core/"/>
- <classpathentry kind="src" path="/org.apache.xerces"/>
- <classpathentry kind="src" path="/org.eclipse.core.boot"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="src" path="/org.junit"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.debug.core"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.debug.mi.core"/>
- <classpathentry kind="src" path="/org.eclipse.cdt.core"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/.cvsignore b/debug/org.eclipse.cdt.debug.ui.tests/.cvsignore
deleted file mode 100644
index ba077a4031a..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/.project b/debug/org.eclipse.cdt.debug.ui.tests/.project
deleted file mode 100644
index 3e216ded820..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/.project
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.debug.ui.tests</name>
- <comment></comment>
- <projects>
- <project>org.apache.xerces</project>
- <project>org.eclipse.cdt.core</project>
- <project>org.eclipse.cdt.debug.core</project>
- <project>org.eclipse.cdt.debug.mi.core</project>
- <project>org.eclipse.core.boot</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.ui</project>
- <project>org.junit</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/Changelog b/debug/org.eclipse.cdt.debug.ui.tests/Changelog
deleted file mode 100644
index f8be61f7387..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/Changelog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-10-30 Alain Magloire
-
- * core/org/eclipse/cdt/debug/core/tests/TargetTests.java: Test number
- 24183 is no longer valid, the method was remove from the CDI API. \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/about.html b/debug/org.eclipse.cdt.debug.ui.tests/about.html
deleted file mode 100644
index fad1e4a429b..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/about.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Third Party Content</h3>
-
-<p>The Content includes items that may be have been sourced from third parties as follows:</p>
-
-<p><b>JUnit 3.7</b></p>
-<p>The plug-in is based on software developed by JUnit.org. Your use of JUnit 3.7 in both source and binary code
-form contained in the plug-in is subject to the terms and conditions of the IBM Public License 1.0 which is available at
-<a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>.
-The source code is located in testresources/junit37-noUI-src.zip.</p>
-
-<p>i) IBM effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;</p>
-<p>ii) IBM effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;</p>
-<p>iii) IBM states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/build.properties b/debug/org.eclipse.cdt.debug.ui.tests/build.properties
deleted file mode 100644
index 0c8076a3818..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/build.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-source.cdttests.jar = src/,\
- core/
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/.cvsignore
+++ /dev/null
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java
deleted file mode 100644
index 29895cf4142..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.cdt.debug.core.tests;
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- *
- * AllDedbugTests.java
- * This is the main entry point for running this suite of JUnit tests
- * for all tests within the package "org.eclipse.cdt.debug.core"
- *
- * @author Judy N. Green
- * @since Jul 19, 2002
- */
-public class AllDebugTests {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
-
- // Just add more test cases here as you create them for
- // each class being tested
-
- suite.addTest(DebugTests.suite());
- suite.addTest(BreakpointTests.suite());
- suite.addTest(LocationTests.suite());
- suite.addTest(TargetTests.suite());
- return suite;
-
-
- }
-} // End of AllDebugTests.java
-
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
deleted file mode 100644
index 11925668a1b..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
+++ /dev/null
@@ -1,615 +0,0 @@
-package org.eclipse.cdt.debug.core.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.debug.testplugin.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.cdt.debug.mi.core.*;
-import org.eclipse.cdt.debug.core.cdi.*;
-import org.eclipse.cdt.debug.core.cdi.model.*;
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the CDI break point interfaces.
- * It will currenly use the mi implementation.
- *
- */
-public class BreakpointTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- NullProgressMonitor monitor;
-
-
- /**
- * Constructor for BreakpointTests
- * @param name
- */
- public BreakpointTests(String name) {
- super(name);
- /***
- * The tests assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- CProjectHelper.delete(testProject);
- }
-
- public static TestSuite suite() {
- return new TestSuite(BreakpointTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
- /***
- * A couple tests to make sure setting breakpoints on functions works as
- * expected.
- */
- public void testFunctionBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- ICDILocation location;
- ICDITarget targets[];
- boolean caught=false;
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /**********************************************************************
- * Create a break point on a generic function
- **********************************************************************/
-
- location=breaks.createLocation(null, "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
- /**********************************************************************
- * Create a break point on main
- **********************************************************************/
-
- location=breaks.createLocation(null, "main", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
-
- /**********************************************************************
- * Try to create a break point on a function name that does not exist
- * We expect that this will cause the setLocationBreakpoint to throw
- * a CDIException
- **********************************************************************/
-
- location=breaks.createLocation(null, "badname", 0);
- assertNotNull(location);
- try {
- breaks.setLocationBreakpoint(0, location, null, null);
- } catch (CDIException e) {
- caught=true;
- }
- assertTrue(caught);
-
- breaks.deleteAllBreakpoints();
-
- /**********************************************************************
- * Create a break point on a generic function and see if it will
- * get hit and stop program execution.
- **********************************************************************/
-
- location=breaks.createLocation(null, "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
- targets=session.getTargets();
- /* We better only have one target connected to this session or something
- * is not right...
- */
- assertTrue(targets.length==1);
- /* Resume the target, this should cause it to run till it hits the
- * breakpoint
- */
- targets[0].resume();
- /**
- * Give the process up to 10 seconds to become either terminated or
- * suspended. It sould hit the breakponint almost immediatly so we
- * should only sleep for max 100 ms
- */
- for (int x=0;x<100;x++) {
- if (targets[0].isTerminated() || targets[0].isSuspended())
- break;
- Thread.sleep(100);
- }
- assertTrue(targets[0].isSuspended());
- location=targets[0].getCurrentThread().getStackFrames()[0].getLocation();
- assertTrue(location.getLineNumber()==6);
- assertTrue(location.getFunction().equals("func1"));
- assertTrue(location.getFile().equals("../main.c"));
-
- /* clean up the session */
- session.terminate();
-
-
- }
-
- /***
- * A couple tests to make sure setting breakpoints on line numbers works as
- * expected.
- */
- public void testLineBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- ICDILocation location;
- ICDITarget targets[];
- boolean caught=false;
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /**********************************************************************
- * Create a break point in a generic function
- **********************************************************************/
- location=breaks.createLocation("main.c", null, 7);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
-
- /**********************************************************************
- * Create a break point in main
- **********************************************************************/
- location=breaks.createLocation("main.c", null, 18);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
-
- /**********************************************************************
- * Try to create a break point on a line that does not exist
- * We expect that this will cause the setLocationBreakpoint to throw
- * a CDIException
- **********************************************************************/
-
- location=breaks.createLocation("main.c", null, 30);
- assertNotNull(location);
- try {
- breaks.setLocationBreakpoint(0, location, null, null);
- } catch (CDIException e) {
- caught=true;
- }
- assertTrue(caught);
-
- caught=false;
- /**********************************************************************
- * Try to create a break point on a line that does not have code on it
- **********************************************************************/
-
- location=breaks.createLocation("main.c", null, 11);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
- /**********************************************************************
- * Create a break point in a generic function without passing the source
- * file name. At the time of writing this would just silently fail, so
- * to make sure it works, we will do it once with a valid line number
- * and once with an invalid line number, and the first should always
- * succeed and the second should always throw an exception.
- **********************************************************************/
- location=breaks.createLocation(null, null, 7);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
- caught=false;
- location=breaks.createLocation(null, null, 30);
- assertNotNull(location);
- try {
- breaks.setLocationBreakpoint(0, location, null, null);
- } catch (CDIException e) {
- caught=true;
- }
- assertTrue("Ignoring line numbers with no file specified?", caught);
-
- breaks.deleteAllBreakpoints();
-
- /**********************************************************************
- * Create a break point on a line number and see if it will
- * get hit and stop program execution.
- **********************************************************************/
-
- location=breaks.createLocation(null, null, 7);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
- targets=session.getTargets();
- /* We better only have one target connected to this session or something
- * is not right...
- */
- assertTrue(targets.length==1);
- /* Resume the target, this should cause it to run till it hits the
- * breakpoint
- */
- targets[0].resume();
- /**
- * Give the process up to 10 seconds to become either terminated or
- * suspended. It sould hit the breakponint almost immediatly so we
- * should only sleep for max 100 ms
- */
- for (int x=0;x<100;x++) {
- if (targets[0].isSuspended() || targets[0].isTerminated())
- break;
- Thread.sleep(100);
- }
- assertTrue("Suspended: " + targets[0].isSuspended() + " Termiunated: " + targets[0].isTerminated(), targets[0].isSuspended());
- location=targets[0].getCurrentThread().getStackFrames()[0].getLocation();
- assertTrue(location.getLineNumber()==7);
- assertTrue(location.getFunction().equals("func1"));
- assertTrue(location.getFile().equals("../main.c"));
-
-
- /* clean up the session */
- session.terminate();
-
- }
- /***
- * A couple tests to make sure getting breakpoints works as expected
- */
- public void testGetBreak() throws CoreException, MIException, IOException, CDIException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- ICDILocation location;
- ICDIBreakpoint[] breakpoints;
- ICDILocationBreakpoint curbreak;
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /**********************************************************************
- * Make sure initially we don't have any breakpoints
- **********************************************************************/
- breakpoints=breaks.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==0);
-
- /**********************************************************************
- * Make sure if we create a simple breakpoint, that we can get it back
- * from the system
- *********************************************************************/
- /* Create a break point on a generic function */
- location=breaks.createLocation("../main.c", "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
- breakpoints=breaks.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==1);
- if (breakpoints[0] instanceof ICDILocationBreakpoint) {
- curbreak=(ICDILocationBreakpoint) breakpoints[0];
- } else
- curbreak=null;
- assertNotNull(curbreak);
-
- assertTrue(curbreak.getLocation().equals(location));
-
- /**********************************************************************
- * Make sure if we create multiple break points that we can still
- * get them all back from the system,
- **********************************************************************/
- /* Create another break point on main */
- location=breaks.createLocation("../main.c", "main", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
- breakpoints=breaks.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==2);
- if (breakpoints[1] instanceof ICDILocationBreakpoint) {
- curbreak=(ICDILocationBreakpoint) breakpoints[1];
- } else
- curbreak=null;
- assertNotNull(curbreak);
- /* Make sure the location still looks like we expect it to..
- . */
- assertTrue(curbreak.getLocation().equals(location));
-
- breaks.deleteAllBreakpoints();
-
-
- /* clean up the session */
- session.terminate();
-
-
- }
-
- /***
- * A couple tests to make sure deleting breakpoints works as expected
- */
- public void testDelBreak() throws CoreException, MIException, IOException, CDIException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- ICDILocation location, savedLocation;
- ICDIBreakpoint[] breakpoints, savedbreakpoints;
- ICDILocationBreakpoint curbreak;
-
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /* Make sure initially we don't have any breakpoints */
- breakpoints=breaks.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==0);
-
- /**********************************************************************
- *
- * Test to make sure if we create a new breakpoint, we can delete
- * it by passing a refrence to it to deleteBreakpoint()
- *
- **********************************************************************/
-
- /* Create a break point on a generic function */
- location=breaks.createLocation("../main.c", "func1", 0);
- assertNotNull(location);
- curbreak=breaks.setLocationBreakpoint(0, location, null, null);
- breaks.deleteBreakpoint(curbreak);
- /**
- * we should not have any breakpoints left.
- */
- breakpoints=breaks.getBreakpoints();
- assertTrue(breakpoints.length==0);
-
- /**********************************************************************
- *
- * Test to make sure if we create multiple new breakpoint, we can delete
- * one of them by passing a refrence to it to deleteBreakpoint()
- *
- **********************************************************************/
-
- /* Create a break point on a generic function */
- location=breaks.createLocation("../main.c", "func1", 0);
- assertNotNull(location);
- curbreak=breaks.setLocationBreakpoint(0, location, null, null);
- savedLocation=curbreak.getLocation();
-
- location=breaks.createLocation("../main.c", "main", 0);
- assertNotNull(location);
- curbreak=breaks.setLocationBreakpoint(0, location, null, null);
- breaks.deleteBreakpoint(curbreak);
-
- breakpoints=breaks.getBreakpoints();
- /***
- * Make sure there is only 1 breakpoint left, and it's the one we expect
- */
- assertTrue(breakpoints.length==1);
- curbreak=(ICDILocationBreakpoint) breakpoints[0];
- assertNotNull(curbreak);
- assertTrue(curbreak.getLocation().equals(savedLocation));
- /***
- * Then delete the other breakpoint.
- */
- breaks.deleteBreakpoint(curbreak);
-
- breakpoints=breaks.getBreakpoints();
- assertTrue(breakpoints.length==0);
-
- /**********************************************************************
- * Make sure deleteBreakpoints works when given 1 breakpoint to delete
- **********************************************************************/
- savedbreakpoints= new ICDIBreakpoint[1];
- for (int x=0;x<10;x++) {
- location=breaks.createLocation("../main.c", null, x+1);
- savedbreakpoints[0]=breaks.setLocationBreakpoint(0, location, null, null);
- assertNotNull(savedbreakpoints[0]);
- }
- breaks.deleteBreakpoints(savedbreakpoints);
-
- /* We should now have 9 breakpoints left. */
- breakpoints=breaks.getBreakpoints();
- assertTrue(breakpoints.length==9);
- /* Make sure we have the correct 9 breakpoints left */
- for (int x=0;x<breakpoints.length;x++) {
- curbreak=(ICDILocationBreakpoint)breakpoints[x];
- assertTrue(curbreak.getLocation().getLineNumber()==x+1);
- }
- breaks.deleteAllBreakpoints();
- assertTrue(breaks.getBreakpoints().length==0);
-
- /**********************************************************************
- * Make sure deleteBreakpoints works when given more then 1 but less
- * then all breakpoints to delete
- **********************************************************************/
- savedbreakpoints= new ICDIBreakpoint[4];
- for (int x=0;x<10;x++) {
- location=breaks.createLocation("../main.c", null, x+1);
- savedbreakpoints[x%4]=breaks.setLocationBreakpoint(0, location, null, null);
- assertNotNull(savedbreakpoints[x%4]);
- }
- breaks.deleteBreakpoints(savedbreakpoints);
-
- /* We should now have 6 breakpoints left. */
- breakpoints=breaks.getBreakpoints();
- assertTrue(breakpoints.length==6);
- /* Make sure we have the correct 6 breakpoints left */
- for (int x=0;x<breakpoints.length;x++) {
- curbreak=(ICDILocationBreakpoint)breakpoints[x];
- assertTrue(curbreak.getLocation().getLineNumber()==x+1);
- }
- breaks.deleteAllBreakpoints();
- assertTrue(breaks.getBreakpoints().length==0);
-
- /**********************************************************************
- * Make sure deleteBreakpoints works when given all the breakpoints
- **********************************************************************/
- savedbreakpoints= new ICDIBreakpoint[10];
- for (int x=0;x<10;x++) {
- location=breaks.createLocation("../main.c", null, x+1);
- savedbreakpoints[x]=breaks.setLocationBreakpoint(0, location, null, null);
- assertNotNull(savedbreakpoints[x]);
- }
- breaks.deleteBreakpoints(savedbreakpoints);
-
- /* We should now have 0 breakpoints left. */
- breakpoints=breaks.getBreakpoints();
- assertTrue(breakpoints.length==0);
-
- /**********************************************************************
- * Make sure deleteAllBreakpoints works
- **********************************************************************/
-
- for (int x=0;x<10;x++) {
- location=breaks.createLocation("../main.c", null, x+1);
- curbreak=breaks.setLocationBreakpoint(0, location, null, null);
- assertNotNull(curbreak);
- }
- breaks.deleteAllBreakpoints();
-
- /* We should now have 0 breakpoints left. */
- breakpoints=breaks.getBreakpoints();
- assertTrue(breakpoints.length==0);
-
-
-
- /* clean up the session */
- session.terminate();
-
-
- }
- /***
- * A couple tests to make sure setting breakpoints with conditions seems to
- * work as expected.
- */
- public void testCondBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- ICDILocation location;
- ICDICondition cond;
- ICDITarget targets[];
- boolean caught=false;
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /**********************************************************************
- * Create a break point on a generic function with an empty condition
- **********************************************************************/
- cond=breaks.createCondition(0, "");
- location=breaks.createLocation(null, "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, cond, null);
-
- /**********************************************************************
- * Create a break point on a generic function with an valid condition
- **********************************************************************/
- cond=breaks.createCondition(0, "x<10");
- location=breaks.createLocation(null, "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, cond, null);
-
- /**********************************************************************
- * Create a break point on a generic function with an invalid condition
- * We expect to get a CDIException when we try to set the breakpoint.
- **********************************************************************/
- cond=breaks.createCondition(0, "nonexist<10");
- location=breaks.createLocation(null, "func1", 0);
- assertNotNull(location);
- try {
- breaks.setLocationBreakpoint(0, location, cond, null);
- } catch (CDIException e) {
- caught=true;
- }
- assertTrue(caught);
-
- /**********************************************************************
- * Create a break point on a line number with a condition and make sure
- * it does not suspend execution of the application until the condition
- * is true
- **********************************************************************/
- breaks.deleteAllBreakpoints();
- location=breaks.createLocation(null, null, 23);
- assertNotNull(location);
- cond=breaks.createCondition(0, "a>10");
-
- breaks.setLocationBreakpoint(0, location, cond, null);
- targets=session.getTargets();
- /* We better only have one target connected to this session or something
- * is not right...
- */
- assertTrue(targets.length==1);
- /* Resume the target, this should cause it to run till it hits the
- * breakpoint
- */
- targets[0].resume();
- /**
- * Give the process up to 10 seconds to become either terminated or
- * suspended. It sould hit the breakponint almost immediatly so we
- * should only sleep for max 100 ms
- */
- for (int x=0;x<100;x++) {
- if (targets[0].isSuspended() || targets[0].isTerminated())
- break;
- Thread.sleep(100);
- }
- assertTrue("Suspended: " + targets[0].isSuspended() + " Termiunated: " + targets[0].isTerminated(), targets[0].isSuspended());
- location=targets[0].getCurrentThread().getStackFrames()[0].getLocation();
- assertTrue(location.getLineNumber()==23);
- assertTrue(location.getFunction().equals("main"));
- assertTrue(location.getFile().equals("../main.c"));
- /* Get the value of a and and make sure it is 11 */
- assertTrue(targets[0].evaluateExpressionToString("a"),
- targets[0].evaluateExpressionToString("a").equals("11"));
-
-
- /* clean up the session */
- session.terminate();
-
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java
deleted file mode 100644
index 5a7c2c22f23..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package org.eclipse.cdt.debug.core.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.debug.testplugin.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.cdt.debug.mi.core.*;
-import org.eclipse.cdt.debug.core.cdi.*;
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the debug stuff. It currenly
- * uses the mi debugger.
- *
- */
-public class DebugTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- NullProgressMonitor monitor;
-
-
- /**
- * Constructor for DebugTests
- * @param name
- */
- public DebugTests(String name) {
- super(name);
- /***
- * The assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- CProjectHelper.delete(testProject);
- }
-
- public static TestSuite suite() {
- return new TestSuite(DebugTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
- /***
- * Can we setup a debug?
- * This is sort of a catch all sanity tests to make sure we can create a debug
- * session with a break point and start it without having any exceptions thrown.
- * It's not ment to be a real proper test.
- */
- public void testDebug() throws CoreException, MIException, IOException, CDIException {
- ICDISession session;
- ICDISourceManager source;
- ICDIBreakpointManager breaks;
- ICDILocation location;
-
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- source=session.getSourceManager();
- assertNotNull(source);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
- location=breaks.createLocation(null, "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
- session.getCurrentTarget().resume();
-
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java
deleted file mode 100644
index 58489783760..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.eclipse.cdt.debug.core.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.debug.testplugin.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.cdt.debug.mi.core.*;
-import org.eclipse.cdt.debug.core.cdi.*;
-import org.eclipse.cdt.debug.core.cdi.model.*;
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the CDI Location interfaces.
- * It will currenly use the mi implementation.
- *
- */
-public class LocationTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- NullProgressMonitor monitor;
-
-
- /**
- * Constructor for LocationTests
- * @param name
- */
- public LocationTests(String name) {
- super(name);
- /***
- * The assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- CProjectHelper.delete(testProject);
- }
-
- public static TestSuite suite() {
- return new TestSuite(LocationTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
- /***
- * A couple tests to make sure comparing Locations works as expected.
- */
- public void testIsEquals() throws CoreException, MIException, IOException, CDIException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- ICDILocation location, location2;
- ICDIBreakpoint[] breakpoints;
- ICDILocationBreakpoint curbreak;
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /**********************************************************************
- * Simple test.. this should work.
- **********************************************************************/
- location=breaks.createLocation("main.c", "func1", 0);
- location2=breaks.createLocation("main.c", "func1", 0);
- assertTrue(location.equals(location2));
- /**********************************************************************
- * Simple test.. this should work.
- **********************************************************************/
- location=breaks.createLocation("main.c", null, 10);
- location2=breaks.createLocation("main.c", null, 10);
- assertTrue(location.equals(location2));
-
- /**********************************************************************
- * make sure that the location returned from getLocation on the
- * ICDILocationBreakpoint.getLocation that is returned from
- * setLocationBreakpoint is the same as the breakpoint returned from
- * BreakpointManager.getBreakpoints.getLocation()
- **********************************************************************/
- location=breaks.createLocation("main.c", "func1", 0);
- assertNotNull(location);
- location2=breaks.setLocationBreakpoint(0, location, null, null).getLocation();
-
- breakpoints=breaks.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==1);
- if (breakpoints[0] instanceof ICDILocationBreakpoint) {
- curbreak=(ICDILocationBreakpoint) breakpoints[0];
- } else
- curbreak=null;
- assertNotNull(curbreak);
-
- assertTrue(curbreak.getLocation().equals(location2));
- breaks.deleteAllBreakpoints();
- /* Create a break point on a generic function with a file name that
- * gdb will change to the relitive path of the source file. This
- * should work, but at the time of writing (Sept 25, 2002) does not.
- */
- location=breaks.createLocation("main.c", "func1", 0);
- assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
-
- breakpoints=breaks.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==1);
- if (breakpoints[0] instanceof ICDILocationBreakpoint) {
- curbreak=(ICDILocationBreakpoint) breakpoints[0];
- } else
- curbreak=null;
- assertNotNull(curbreak);
-
- assertTrue("PR:23879",curbreak.getLocation().equals(location));
-
-
- /* clean up the session */
- session.terminate();
-
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java
deleted file mode 100644
index 0c489f55a0b..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.eclipse.cdt.debug.core.tests;
-
-/*
- * (c) Copyright QNX Software Systems Ltd. 2002.
- * All Rights Reserved.
- */
-
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.debug.testplugin.*;
-import org.eclipse.cdt.core.model.*;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.cdt.debug.mi.core.*;
-import org.eclipse.cdt.debug.core.cdi.*;
-
-/**
- * @author Peter Graves
- *
- * This file contains a set of generic tests for the CDI Target interfaces.
- * It will currenly use the mi implementation.
- *
- */
-public class TargetTests extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- ICProject testProject;
- NullProgressMonitor monitor;
-
-
- /**
- * Constructor for TargetTests
- * @param name
- */
- public TargetTests(String name) {
- super(name);
- /***
- * The assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
- * so we need to get them setup first.
- */
- workspace= ResourcesPlugin.getWorkspace();
- root= workspace.getRoot();
- monitor = new NullProgressMonitor();
- if (workspace==null)
- fail("Workspace was not setup");
- if (root==null)
- fail("Workspace root was not setup");
-
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() throws CoreException,FileNotFoundException {
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
- testProject=CProjectHelper.createCProject("filetest", "none");
- if (testProject==null)
- fail("Unable to create project");
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() throws CoreException {
- CProjectHelper.delete(testProject);
- }
-
- public static TestSuite suite() {
- return new TestSuite(TargetTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
-
- /***
- * A couple tests to make sure various evaluations work as expected
- */
- public void testEvaluate() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDISession session;
- ICDIBreakpointManager breaks;
- session=CDebugHelper.createSession("main");
- assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
-
- /***
- * Tests to come
- */
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/main.c b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/main.c
deleted file mode 100644
index 80405cedf32..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/main.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-
-void func1()
-{
- int x,y,z;
- x=1;
- y=2;
- z=3;
- printf("Hello world\n");
- printf("Hello world\n");
- printf("Hello world\n");
-}
-
-int main()
-{
- int a,b,c;
- a=b=c=10;
- a=12;
- b=124;
- c=1;
- func1();
- for (a=0;a<100;a++) {
- c++;
- }
- return(1);
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/Makefile b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/Makefile
deleted file mode 100644
index cedfb06fb2c..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-win:
- gcc -g -o main ../main.c
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/main.exe b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/main.exe
deleted file mode 100644
index ab54e4871e9..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/resources/win/main.exe
+++ /dev/null
Binary files differ
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/plugin.xml b/debug/org.eclipse.cdt.debug.ui.tests/plugin.xml
deleted file mode 100644
index 3ca1e3de2f5..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/plugin.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- id="org.eclipse.cdt.debug.ui.tests"
- name="org.eclipse.cdt.debug.ui.tests"
- version="1.0.0">
-
- <runtime>
- <library name="cdtdebugtests.jar"/>
- </runtime>
- <requires>
- <import plugin="org.apache.xerces"/>
- <import plugin="org.eclipse.core.boot"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.junit"/>
- <import plugin="org.eclipse.cdt.debug.core"/>
- <import plugin="org.eclipse.cdt.debug.mi.core"/>
- <import plugin="org.eclipse.cdt.core"/>
- <import plugin="org.eclipse.ui"/>
- </requires>
-
-
-</plugin>
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java
deleted file mode 100644
index 9e3f4ab17f6..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.cdt.debug.testplugin;
-
-import java.io.IOException;
-
-import org.eclipse.cdt.debug.core.cdi.*;
-import org.eclipse.cdt.debug.mi.core.*;
-import org.eclipse.core.runtime.Path;
-
-
-/**
- * Helper methods to set up a Debug session.
- */
-public class CDebugHelper {
-
-
-
- /**
- * Creates a ICDISession.
- */
- public static ICDISession createSession(String exe) throws IOException, MIException {
- MIPlugin mi;
- ICDISession session;
- String os = System.getProperty("os.name");
- String exename;
- mi=MIPlugin.getDefault();
-
- exename=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile();
- exename+="core/org/eclipse/cdt/debug/core/tests/resources/";
- os=os.toLowerCase();
- /* We need to get the correct executable to execute
- */
- if (os.indexOf("windows")!=-1)
- exename+="win/"+ exe +".exe";
- else if (os.indexOf("qnx")!=-1)
- exename+="qnx/" + exe;
- else if (os.indexOf("linux")!=-1)
- exename+="linux/"+exe;
- else if (os.indexOf("sol")!=-1)
- exename+="sol/" + exe;
- else
- return(null);
- session=mi.createCSession(null, exename);
- return(session);
- }
-
-
-}
-
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CElementDecorator.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CElementDecorator.java
deleted file mode 100644
index 5020091fa06..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CElementDecorator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin;
-
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.LabelProvider;
-
-/**
- * Allows to test decorators for Java elements
- */
-public class CElementDecorator extends LabelProvider implements ILabelDecorator {
-
- /*
- * @see ILabelDecorator#decorateImage(Image, Object)
- */
- public Image decorateImage(Image image, Object element) {
- return null;
- }
-
- /*
- * @see ILabelDecorator#decorateText(String, Object)
- */
- public String decorateText(String text, Object element) {
- return text + "*";
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java
deleted file mode 100644
index b976f0f2316..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java
+++ /dev/null
@@ -1,293 +0,0 @@
-package org.eclipse.cdt.debug.testplugin;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.zip.ZipFile;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CProjectNature;
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.IArchiveContainer;
-import org.eclipse.cdt.core.model.IBinaryContainer;
-import org.eclipse.cdt.core.model.ICFolder;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.IArchive;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.core.resources.IContainer;
-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.ResourcesPlugin;
-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.ui.dialogs.IOverwriteQuery;
-import org.eclipse.ui.wizards.datatransfer.ImportOperation;
-import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
-
-/**
- * Helper methods to set up a ICProject.
- */
-public class CProjectHelper {
-
- public static final IPath RT_STUBS= new Path("testresources/rtstubs.jar");
- public static final IPath JUNIT_SRC= new Path("testresources/junit37-noUI-src.zip");
-
- public static final IPath MYLIB= new Path("testresources/mylib.jar");
-
-
- /**
- * Creates a ICProject.
- */
- public static ICProject createCProject(String projectName, String binFolderName) throws CoreException {
- IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
- IProject project= root.getProject(projectName);
- if (!project.exists()) {
- project.create(null);
- } else {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- }
-
- if (!project.isOpen()) {
- project.open(null);
- }
-
-
- if (!project.hasNature(CProjectNature.C_NATURE_ID)) {
- addNatureToProject(project, CProjectNature.C_NATURE_ID, null);
- }
-
- ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project);
-
- return cproject;
- }
-
- /**
- * Removes a ICProject.
- */
- public static void delete(ICProject cproject) throws CoreException {
- performDummySearch();
- cproject.getProject().delete(true, true, null);
- }
-
- public static void performDummySearch() throws CModelException {
- /* SearchEngine().searchAllTypeNames(
- ResourcesPlugin.getWorkspace(),
- null,
- null,
- IJavaSearchConstants.EXACT_MATCH,
- IJavaSearchConstants.CASE_SENSITIVE,
- IJavaSearchConstants.CLASS,
- SearchEngine.createJavaSearchScope(new IJavaElement[0]),
- new Requestor(),
- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- null); */
- }
-
-
- /**
- * Adds a source container to a ICProject.
- */
- public static ICFolder addSourceContainer(ICProject cproject, String containerName) throws CoreException {
- IProject project= cproject.getProject();
- IContainer container= null;
- if (containerName == null || containerName.length() == 0) {
- container= project;
- } else {
- IFolder folder= project.getFolder(containerName);
- if (!folder.exists()) {
- folder.create(false, true, null);
- }
- container= folder;
- }
-
- return (ICFolder)container;
- }
-
- /**
- * Adds a source container to a ICProject and imports all files contained
- * in the given Zip file.
- */
- public static ICFolder addSourceContainerWithImport(ICProject cproject, String containerName, ZipFile zipFile) throws InvocationTargetException, CoreException {
- ICFolder root= addSourceContainer(cproject, containerName);
- importFilesFromZip(zipFile, root.getPath(), null);
- return root;
- }
-
- /**
- * Removes a source folder from a IJavaProject.
- */
- public static void removeSourceContainer(ICProject cproject, String containerName) throws CoreException {
- IFolder folder= cproject.getProject().getFolder(containerName);
- folder.delete(true, null);
- }
-
-
- /**
- * Adds a required project entry.
- */
- public static void addRequiredProject(ICProject cproject, ICProject required) throws CModelException {
- //IClasspathEntry cpe= JavaCore.newProjectEntry(required.getProject().getFullPath());
- //addToClasspath(cproject, cpe);
- }
-
- /**
- * Attempts to find an archive with the given name in the workspace
- */
- public static IArchive findArchive(ICProject testProject,String name) {
- int x;
- IArchive[] myArchives;
- IArchiveContainer archCont;
- archCont=testProject.getArchiveContainer();
- myArchives=archCont.getArchives();
- if (myArchives.length<1)
- return(null);
- for (x=0;x<myArchives.length;x++) {
- if (myArchives[x].getElementName().equals(name))
- return(myArchives[x]);
- }
- return(null);
- }
- /**
- * Attempts to find a binary with the given name in the workspace
- */
- public static IBinary findBinary(ICProject testProject,String name) {
- IBinaryContainer binCont;
- int x;
- IBinary[] myBinaries;
- binCont=testProject.getBinaryContainer();
- myBinaries=binCont.getBinaries();
- if (myBinaries.length<1)
- return(null);
- for (x=0;x<myBinaries.length;x++) {
- if (myBinaries[x].getElementName().equals(name))
- return(myBinaries[x]);
-
- }
- return(null);
- }
-
- /**
- * Attempts to find an object with the given name in the workspace
- */
- public static IBinary findObject(ICProject testProject,String name) {
- int x;
- ICElement[] myElements;
- myElements=testProject.getChildren();
- if (myElements.length<1)
- return(null);
- for (x=0;x<myElements.length;x++) {
- if (myElements[x].getElementName().equals(name))
- if (myElements[x] instanceof ICElement) {
- if (myElements[x] instanceof IBinary) {
- return((IBinary) myElements[x]);
- }
- }
- }
- return(null);
- }
- /**
- * Attempts to find a TranslationUnit with the given name in the workspace
- */
- public static ITranslationUnit findTranslationUnit(ICProject testProject,String name) {
- int x;
- ICElement[] myElements;
- myElements=testProject.getChildren();
- if (myElements.length<1)
- return(null);
- for (x=0;x<myElements.length;x++) {
- if (myElements[x].getElementName().equals(name))
- if (myElements[x] instanceof ICElement) {
- if (myElements[x] instanceof ITranslationUnit) {
- return((ITranslationUnit) myElements[x]);
- }
- }
- }
- return(null);
- }
-
-
-
- /**
- * Attempts to find an element with the given name in the workspace
- */
- public static ICElement findElement(ICProject testProject,String name) {
- int x;
- ICElement[] myElements;
- myElements=testProject.getChildren();
- if (myElements.length<1)
- return(null);
- for (x=0;x<myElements.length;x++) {
- if (myElements[x].getElementName().equals(name))
- if (myElements[x] instanceof ICElement) {
- return((ICElement) myElements[x]);
- }
-
-
- }
- return(null);
- }
-
-
- /**
- * Try to find rt.jar
- */
- public static IPath[] findRtJar() {
- File rtStubs= CTestPlugin.getDefault().getFileInPlugin(RT_STUBS);
- if (rtStubs != null && rtStubs.exists()) {
- return new IPath[] {
- new Path(rtStubs.getPath()),
- null,
- null
- };
- }
-
- /*
- IVMInstall vmInstall= JavaRuntime.getDefaultVMInstall();
- if (vmInstall != null) {
- LibraryLocation loc= vmInstall.getVMInstallType().getDefaultLibraryLocation(vmInstall.getInstallLocation());
- if (loc != null) {
- return new IPath[] {
- new Path(loc.getSystemLibrary().getPath()),
- new Path(loc.getSystemLibrarySource().getPath()),
- loc.getPackageRootPath()
- };
- }
- }*/
- return null;
- }
-
- private 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);
- }
-
- private static void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException {
- ZipFileStructureProvider structureProvider= new ZipFileStructureProvider(srcZipFile);
- try {
- ImportOperation op= new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, new ImportOverwriteQuery());
- op.run(monitor);
- } catch (InterruptedException e) {
- // should not happen
- }
- }
-
- private static class ImportOverwriteQuery implements IOverwriteQuery {
- public String queryOverwrite(String file) {
- return ALL;
- }
- }
-
-
-}
-
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java
deleted file mode 100644
index 3eceaecf6ea..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-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.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-
-
-public class CTestPlugin extends Plugin {
-
- private static CTestPlugin fgDefault;
-
- public CTestPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- fgDefault= this;
- }
-
- public static CTestPlugin 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);
- }
-
- public File getFileInPlugin(IPath path) {
- try {
- URL installURL= new URL(getDescriptor().getInstallURL(), path.toString());
- URL localURL= Platform.asLocalURL(installURL);
- return new File(localURL.getFile());
- } catch (IOException e) {
- return null;
- }
- }
-
-
-
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestSetup.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestSetup.java
deleted file mode 100644
index c9a8395525f..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestSetup.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-
-
-public class CTestSetup extends TestSetup {
-
- /**
- * @deprecated
- * Not needed anymore. No added value
- */
- public CTestSetup(Test test) {
- super(test);
- }
-
- protected void setUp() throws Exception {
- }
-
- protected void tearDown() throws Exception {
- }
-
-
-
-
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/Main.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/Main.java
deleted file mode 100644
index dffaf3d3af4..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/Main.java
+++ /dev/null
@@ -1,528 +0,0 @@
-package org.eclipse.cdt.debug.testplugin;
-
-// copied from startup.jar. planned to be removed soon
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.net.*;
-import java.lang.reflect.*;
-import java.io.*;
-import java.util.*;
-/**
- * Startup class for Eclipse. Creates a class loader using
- * supplied URL of platform installation, loads and calls
- * the Eclipse Boot Loader. The startup arguments are as follows:
- * <dl>
- * <dd>
- * -application &lt;id&gt;: the identifier of the application to run
- * </dd>
- * <dd>
- * -boot &lt;location&gt;: the location, expressed as a URL, of the platform's boot.jar
- * </dd>
- * <dd>
- * -consolelog : enables log to the console. Handy when combined with -debug
- * </dd>
- * <dd>
- * -data &lt;location&gt;: sets the workspace location and the default location for projects
- * </dd>
- * <dd>
- * -debug [options file]: turns on debug mode for the platform and optionally specifies a location
- * for the .options file. This file indicates what debug points are available for a
- * plug-in and whether or not they are enabled. If a location is not specified, the platform searches
- * for the .options file under the install directory
- * </dd>
- * <dd>
- * -dev [entries]: turns on dev mode and optionally specifies comma-separated class path entries
- * which are added to the class path of each plug-in
- * </dd>
- * <dd>
- * -keyring &lt;location&gt;: the location of the authorization database on disk. This argument
- * has to be used together with the -password argument
- * </dd>
- * <dd>
- * -password &lt;passwd&gt;: the password for the authorization database
- * </dd>
- * <dd>
- * -plugins &lt;location&gt;: The arg is a URL pointing to a file which specs the plugin
- * path for the platform. The file is in property file format where the keys are user-defined
- * names and the values are comma separated lists of either explicit paths to plugin.xml
- * files or directories containing plugins. (e.g., .../eclipse/plugins).
- * </dd>
- * <dd>
- * -ws &lt;window system&gt;: sets the window system value
- * </dd>
- * </dl>
- */
-public class Main {
- /**
- * Indicates whether this instance is running in debug mode.
- */
- protected boolean debug = false;
-
- /**
- * The location of the launcher to run.
- */
- protected String bootLocation = null;
-
- /**
- * The identifier of the application to run.
- */
- protected String application;
-
- /**
- * The path for finding find plugins.
- */
- protected URL pluginPathLocation;
-
- /**
- * The boot path location.
- */
- protected String location;
-
- /**
- * Indicates whether items for UNinstallation should be looked for.
- */
- protected boolean uninstall = false;
-
- /**
- * The item to be uninstalled.
- */
- protected String uninstallCookie;
-
- /**
- * The class path entries.
- */
- protected String devClassPath = null;
-
- /**
- * Indicates whether this instance is running in development mode.
- */
- protected boolean inDevelopmentMode = false;
-
- // static token describing how to take down the splash screen
- private static String endSplash = null;
-
- // constants
- private static final String APPLICATION = "-application";
- private static final String BOOT = "-boot";
- private static final String DEBUG = "-debug";
- private static final String DEV = "-dev";
- private static final String ENDSPLASH = "-endsplash";
- private static final String UNINSTALL = "-uninstall";
- private static final String PI_BOOT = "org.eclipse.core.boot";
- private static final String BOOTLOADER = "org.eclipse.core.boot.BootLoader";
- private static final String UPDATELOADER = "org.eclipse.core.internal.boot.LaunchInfo";
-
- // The project containing the boot loader code. This is used to construct
- // the correct class path for running in VAJ and VAME.
- private static final String PROJECT_NAME = "Eclipse Core Boot";
-
- private static boolean inVAJ;
- static {
- try {
- Class.forName("com.ibm.uvm.lang.ProjectClassLoader");
- inVAJ = true;
- } catch (Exception e) {
- inVAJ = false;
- }
- }
- private static boolean inVAME;
- static {
- try {
- Class.forName("com.ibm.eclipse.core.VAME");
- inVAME = true;
- } catch (Exception e) {
- inVAME = false;
- }
- }
-
-/**
- * Executes the launch.
- *
- * @return the result of performing the launch
- * @param args command-line arguments
- * @exception Exception thrown if a problem occurs during the launch
- */
-protected Object basicRun(String[] args) throws Exception {
- Class clazz = getBootLoader(bootLocation);
- Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, URL.class, String.class, String[].class });
- try {
- return method.invoke(clazz, new Object[] { application, pluginPathLocation, location, args });
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof Error)
- throw (Error) e.getTargetException();
- else
- throw e;
- }
-}
-
-/**
- * Returns the result of converting a list of comma-separated tokens into an array
- *
- * @return the array of string tokens
- * @param prop the initial comma-separated string
- */
-private String[] getArrayFromList(String prop) {
- if (prop == null || prop.trim().equals(""))
- return new String[0];
- Vector list = new Vector();
- StringTokenizer tokens = new StringTokenizer(prop, ",");
- while (tokens.hasMoreTokens()) {
- String token = tokens.nextToken().trim();
- if (!token.equals(""))
- list.addElement(token);
- }
- return list.isEmpty() ? new String[0] : (String[]) list.toArray(new String[0]);
-}
-/**
- * Creates and returns a platform <code>BootLoader</code> which can be used to start
- * up and run the platform. The given base, if not <code>null</code>,
- * is the location of the boot loader code. If the value is <code>null</code>
- * then the boot loader is located relative to this class.
- *
- * @return the new boot loader
- * @param base the location of the boot loader
- */
-public Class getBootLoader(String base) throws Exception {
- URLClassLoader loader = new URLClassLoader(getBootPath(base), null);
- return loader.loadClass(BOOTLOADER);
-}
-/**
- * Returns the <code>URL</code>-based class path describing where the boot classes
- * are located when running in development mode.
- *
- * @return the url-based class path
- * @param base the base location
- * @exception MalformedURLException if a problem occurs computing the class path
- */
-protected URL[] getDevPath(URL base) throws MalformedURLException {
- URL url;
- String devBase = base.toExternalForm();
- if (!inDevelopmentMode) {
- url = new URL(devBase + "boot.jar");
- return new URL[] {url};
- }
- String[] locations = getArrayFromList(devClassPath);
- ArrayList result = new ArrayList(locations.length);
- for (int i = 0; i < locations.length; i++) {
- String spec = devBase + locations[i];
- char lastChar = spec.charAt(spec.length() - 1);
- if ((spec.endsWith(".jar") || (lastChar == '/' || lastChar == '\\')))
- url = new URL (spec);
- else
- url = new URL(spec + "/");
- //make sure URL exists before adding to path
- if (new java.io.File(url.getFile()).exists())
- result.add(url);
- }
- url = new URL(devBase + "boot.jar");
- if (new java.io.File(url.getFile()).exists())
- result.add(url);
- return (URL[])result.toArray(new URL[result.size()]);
-}
-
-/**
- * Returns the <code>URL</code>-based class path describing where the boot classes are located.
- *
- * @return the url-based class path
- * @param base the base location
- * @exception MalformedURLException if a problem occurs computing the class path
- */
-protected URL[] getBootPath(String base) throws MalformedURLException {
- URL url = null;
- // if the given location is not null, assume it is correct and use it.
- if (base != null) {
- url = new URL(base);
- if (debug)
- System.out.println("Boot URL: " + url.toExternalForm());
- return new URL[] {url};
- }
- // Create a URL based on the location of this class' code.
- // strip off jar file and/or last directory to get
- // to the directory containing projects.
- URL[] result = null;
- url = getClass().getProtectionDomain().getCodeSource().getLocation();
- String path = url.getFile();
- if (path.endsWith(".jar"))
- path = path.substring(0, path.lastIndexOf("/"));
- else
- if (path.endsWith("/"))
- path = path.substring(0, path.length() - 1);
- if (inVAJ || inVAME) {
- int ix = path.lastIndexOf("/");
- path = path.substring(0, ix + 1);
- path = path + PROJECT_NAME + "/";
- url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
- result = new URL[] {url};
- } else {
- path = searchForPlugins(path);
- path = searchForBoot(path);
- // add on any dev path elements
- url = new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
- result = getDevPath(url);
- }
- if (debug) {
- System.out.println("Boot URL:");
- for (int i = 0; i < result.length; i++)
- System.out.println(" " + result[i].toExternalForm());
- }
- return result;
-}
-
-/**
- * Searches for a plugins root starting at a given location. If one is
- * found then this location is returned; otherwise an empty string is
- * returned.
- *
- * @return the location where plugins were found, or an empty string
- * @param start the location to begin searching at
- */
-protected String searchForPlugins(String start) {
- File path = new File(start);
- while (path != null) {
- File test = new File(path, "plugins");
- if (test.exists())
- return test.toString();
- path = path.getParentFile();
- path = (path == null || path.length() == 1) ? null : path;
- }
- return "";
-}
-/**
- * Searches for a boot directory starting at a given location. If one
- * is found then this location is returned; otherwise an empty string
- * is returned.
- *
- * @return the location where plugins were found, or an empty string
- * @param start the location to begin searching at
- */
-protected String searchForBoot(String start) {
- FileFilter filter = new FileFilter() {
- public boolean accept(File candidate) {
- return candidate.getName().startsWith(PI_BOOT);
- }
- };
- File[] boots = new File(start).listFiles(filter);
- String result = null;
- String maxVersion = null;
- for (int i = 0; i < boots.length; i++) {
- String name = boots[i].getName();
- int index = name.lastIndexOf('_');
- if (index == -1) {
- result = boots[i].getAbsolutePath();
- i = boots.length;
- } else {
- if (index > 0) {
- String version = name.substring(index + 1);
- if (maxVersion == null) {
- result = boots[i].getAbsolutePath();
- maxVersion = version;
- } else
- if (maxVersion.compareTo(version) == -1) {
- result = boots[i].getAbsolutePath();
- maxVersion = version;
- }
- }
- }
- }
- if (result == null)
- throw new RuntimeException("Could not find bootstrap code. Check location of boot plug-in or specify -boot.");
- return result.replace(File.separatorChar, '/') + "/";
-}
-/**
- * Returns the update loader for the given boot path.
- *
- * @return the update loader
- * @param base the boot path base
- * @exception Exception thrown is a problem occurs determining this loader
- */
-public Class getUpdateLoader(String base) throws Exception {
- URLClassLoader loader = new URLClassLoader(getBootPath(base), null);
- return loader.loadClass(UPDATELOADER);
-}
-/**
- * Runs the platform with the given arguments. The arguments must identify
- * an application to run (e.g., <code>-application com.example.application</code>).
- * After running the application <code>System.exit(N)</code> is executed.
- * The value of N is derived from the value returned from running the application.
- * If the application's return value is an <code>Integer</code>, N is this value.
- * In all other cases, N = 0.
- * <p>
- * Clients wishing to run the platform without a following <code>System.exit</code>
- * call should use <code>run()</code>.
- *
- * @see #run
- *
- * @param args the command line arguments
- */
-public static void main(String[] args) {
- Object result = null;
- try {
- result = new Main().run(args);
- } catch (Throwable e) {
- // try and take down the splash screen.
- endSplash();
- System.out.println("Exception launching the Eclipse Platform:");
- e.printStackTrace();
- }
- int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0;
- System.exit(exitCode);
-}
-/**
- * Tears down the currently-displayed splash screen.
- */
-public static void endSplash() {
- if (endSplash == null)
- return;
- try {
- Runtime.getRuntime().exec(endSplash);
- } catch (Exception e) {
- }
-}
-
-/**
- * Runs this launcher with the arguments specified in the given string.
- *
- * @param argString the arguments string
- * @exception Exception thrown if a problem occurs during launching
- */
-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()]));
-}
-
-/**
- * Processes the command line arguments
- *
- * @return the arguments to pass through to the launched application
- * @param args the command line arguments
- */
-protected String[] processCommandLine(String[] args) throws Exception {
- int[] configArgs = new int[100];
- configArgs[0] = -1; // need to initialize the first element to something that could not be an index.
- int configArgIndex = 0;
- for (int i = 0; i < args.length; i++) {
- boolean found = false;
- // check for args without parameters (i.e., a flag arg)
- // check if debug should be enabled for the entire platform
- if (args[i].equalsIgnoreCase(DEBUG)) {
- debug = true;
- // passed thru this arg (i.e., do not set found = true
- continue;
- }
-
- // check if development mode should be enabled for the entire platform
- // If this is the last arg or there is a following arg (i.e., arg+1 has a leading -),
- // simply enable development mode. Otherwise, assume that that the following arg is
- // actually some additional development time class path entries. This will be processed below.
- if (args[i].equalsIgnoreCase(DEV) && ((i + 1 == args.length) || ((i + 1 < args.length) && (args[i + 1].startsWith("-"))))) {
- inDevelopmentMode = true;
- // do not mark the arg as found so it will be passed through
- continue;
- }
-
- // done checking for args. Remember where an arg was found
- if (found) {
- configArgs[configArgIndex++] = i;
- continue;
- }
- // check for args with parameters. If we are at the last argument or if the next one
- // has a '-' as the first character, then we can't have an arg with a parm so continue.
- if (i == args.length - 1 || args[i + 1].startsWith("-"))
- continue;
- String arg = args[++i];
-
- // look for the laucher to run
- if (args[i - 1].equalsIgnoreCase(BOOT)) {
- bootLocation = arg;
- found = true;
- }
-
- // look for the development mode and class path entries.
- if (args[i - 1].equalsIgnoreCase(DEV)) {
- inDevelopmentMode = true;
- devClassPath = arg;
- continue;
- }
-
- // look for the application to run
- if (args[i - 1].equalsIgnoreCase(APPLICATION)) {
- application = arg;
- found = true;
- }
-
- // look for token to use to end the splash screen
- if (args[i - 1].equalsIgnoreCase(ENDSPLASH)) {
- endSplash = arg;
- continue;
- }
-
- // look for items to uninstall
- if (args[i - 1].equalsIgnoreCase(UNINSTALL)) {
- uninstall = true;
- uninstallCookie = arg;
- found = true;
- }
-
- // done checking for args. Remember where an arg was found
- if (found) {
- configArgs[configArgIndex++] = i - 1;
- configArgs[configArgIndex++] = i;
- }
- }
- // remove all the arguments consumed by this argument parsing
- if (configArgIndex == 0)
- return args;
- String[] passThruArgs = new String[args.length - configArgIndex];
- configArgIndex = 0;
- int j = 0;
- for (int i = 0; i < args.length; i++) {
- if (i == configArgs[configArgIndex])
- configArgIndex++;
- else
- passThruArgs[j++] = args[i];
- }
- return passThruArgs;
-}
-/**
- * Runs the application to be launched.
- *
- * @return the return value from the launched application
- * @param args the arguments to pass to the application
- * @exception thrown if a problem occurs during launching
- */
-public Object run(String[] args) throws Exception {
- String[] passThruArgs = processCommandLine(args);
- if (uninstall)
- return updateRun(UNINSTALL, uninstallCookie, passThruArgs);
- else
- return basicRun(passThruArgs);
-}
-/**
- * Performs an update run.
- *
- * @return the return value from the update loader
- * @param flag flag to give to the update loader
- * @param value value to give to the update loader
- * @param args arguments to give to the update loader.
- * @exception Exception thrown if a problem occurs during execution
- */
-protected Object updateRun(String flag, String value, String[] args) throws Exception {
- Class clazz = getUpdateLoader(bootLocation);
- Method method = clazz.getDeclaredMethod("run", new Class[] { String.class, String.class, String.class, String[].class });
- try {
- return method.invoke(clazz, new Object[] { flag, value, location, args });
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof Error)
- throw (Error) e.getTargetException();
- else
- throw e;
- }
-}
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/NewMain.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/NewMain.java
deleted file mode 100644
index db442c80e60..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/NewMain.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin;
-
-import java.io.File;
-import java.io.FileInputStream;
-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(getSettingsFile());
- properties.load(fis);
- return properties.getProperty(key);
- } catch (IOException e) {
- }
- return null;
- }
-
- private static File getSettingsFile() {
- String home= System.getProperty("user.home");
- if (home == null) {
- System.out.println("Home dir not defined");
- return null;
- }
- return new File(home, "eclipse-workspaces.properties");
- }
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestPluginLauncher.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestPluginLauncher.java
deleted file mode 100644
index ce3e74013d1..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestPluginLauncher.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin;
-
-import java.net.URL;
-
-/**
- * Helper class to launch a test
- */
-public class TestPluginLauncher {
-
- public static final String APP_NAME= "org.eclipse.jdt.ui.tests.app";
-
- public static void run(String location, Class testCase, String[] args) {
- run(APP_NAME, location, testCase, args);
- }
-
- public static void run(String application, String location, Class testCase, String[] args) {
- try {
- String bootLocation= getBootLocation();
- int nArgs= args.length;
- String[] newArgs= new String[4 + nArgs];
- newArgs[0]= testCase.getName();
- for (int i= 0; i < nArgs; i++) {
- newArgs[1 + i]= args[i];
- }
- newArgs[1 + nArgs]= "-dev";
- newArgs[1 + nArgs + 1]= "bin";
- newArgs[1 + nArgs + 2]= "-debug";
- NewMain newMain= new NewMain(application, location, null, bootLocation, false);
- newMain.run(newArgs);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public static String getLocationFromProperties(String key) {
- return NewMain.getLocationFromProperties(key);
- }
-
- public static String getLocationFromProperties() {
- return NewMain.getLocationFromProperties("tests");
- }
-
- public static String getBootLocation() {
- URL url= TestPluginLauncher.class.getResource("TestPluginLauncher.class");
- String s= url.toString();
- int index= s.indexOf("/org.eclipse.jdt.ui.tests");
- if (index == -1)
- throw new IllegalArgumentException();
- s= s.substring(0, index);
- s= s + "/org.eclipse.core.boot/boot.jar";
- return s;
- }
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java
deleted file mode 100644
index e5da8ce0c43..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.ui.internal.Workbench;
-
-public class TestWorkbench extends Workbench {
-
- /**
- * Run an event loop for the workbench.
- */
- protected void runEventLoop() {
- // Dispatch all events.
- Display display = Display.getCurrent();
- while (true) {
- try {
- if (!display.readAndDispatch())
- break;
- } catch (Throwable e) {
- break;
- }
- }
- IPath location= CTestPlugin.getDefault().getWorkspace().getRoot().getLocation();
- System.out.println("Workspace-location: " + location.toString());
-
-
- try {
- String[] args= getCommandLineArgs();
- if (args.length > 0) {
- Test test= getTest(args[0]);
- TestRunner.run(test);
- } else {
- System.out.println("TestWorkbench: Argument must be class name");
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
-
- // Close the workbench.
- close();
- }
-
- public Test getTest(String className) throws Exception {
- Class testClass= getClass().getClassLoader().loadClass(className);
-
- Method suiteMethod= null;
- try {
- suiteMethod= testClass.getMethod(TestRunner.SUITE_METHODNAME, new Class[0]);
- } catch (Exception e) {
- // try to extract a test suite automatically
- return new TestSuite(testClass);
- }
- try {
- return (Test) suiteMethod.invoke(null, new Class[0]); // static method
- } catch (InvocationTargetException e) {
- System.out.println("Failed to invoke suite():" + e.getTargetException().toString());
- } catch (IllegalAccessException e) {
- System.out.println("Failed to invoke suite():" + e.toString());
- }
- return null;
-
- }
-
-
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/test/HelloWorld.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/test/HelloWorld.java
deleted file mode 100644
index 1e9a2f05689..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/test/HelloWorld.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-package org.eclipse.cdt.debug.testplugin.test;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.testplugin.CProjectHelper;
-import org.eclipse.cdt.debug.testplugin.TestPluginLauncher;
-
-
-public class HelloWorld extends TestCase {
-
- private ICProject fCProject;
-
- public static void main(String[] args) {
- TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), HelloWorld.class, args);
- }
-
- public static Test suite() {
- TestSuite suite= new TestSuite();
- suite.addTest(new HelloWorld("test1"));
- return suite;
- }
-
- public HelloWorld(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- fCProject= CProjectHelper.createCProject("TestProject1", "bin");
- }
-
-
- protected void tearDown() throws Exception {
- CProjectHelper.delete(fCProject);
- }
-
- public void test1() throws Exception {
-
- assertTrue("Exception to test", 0 != 0);
-
- }
-
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/AccessibilityTestPass.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/AccessibilityTestPass.java
deleted file mode 100644
index 8bf67a4ad3a..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/AccessibilityTestPass.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-import java.util.ArrayList;
-
-
-public class AccessibilityTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 5;
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Accessibility";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the accessibility of the dialogs.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Accessibility";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) all widgets are accessible by tabbing.");
- list.add("&2) forwards and backwards tabbing is in a logical order");
- list.add("&3) all the widgets with labels have an appropriate mnemonic.");
- list.add("&4) there are no duplicate mnemonics.");
- list.add("&5) selectable widgets can be selected using the spacebar.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "Some widgets aren't accessible by tabbing.";
- failureText[1] = "Tabbing order is illogical.";
- failureText[2] = "Missing or inappropriate mnemonics.";
- failureText[3] = "Duplicate mnemonics.";
- failureText[4] = "Some widgets cannot be selected using the spacebar.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the accessibility of the dialog acceptable?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_ACCESS;
- }
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java
deleted file mode 100644
index 2fd5792c78e..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-
-import junit.framework.Assert;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-
-import org.eclipse.ui.internal.WorkbenchPlugin;
-
-
-/**
- * A <code>DialogCheck</code> is used test a dialog in
- * various ways.
- * <p>
- * For interactive tests use <code>assertDialog</code>.
- * For automated tests use <code>assert DialogTexts</code>.
- * </p>
- */
-public class DialogCheck {
- private DialogCheck() {
- }
- private static VerifyDialog _verifyDialog;
-
-
- /**
- * Asserts that a given dialog is not null and that it passes
- * certain visual tests. These tests will be verified manually
- * by the tester using an input dialog. Use this assert method
- * to verify a dialog's sizing, initial focus, or accessiblity.
- * To ensure that both the input dialog and the test dialog are
- * accessible by the tester, the getShell() method should be used
- * when creating the test dialog.
- *
- * Example usage:
- * <code>Dialog dialog = new AboutDialog( DialogCheck.getShell() );
- * DialogCheck.assertDialog(dialog, this);</code>
- *
- * @param dialog the test dialog to be verified.
- * @param assert this is the test case object, assertions will be
- * executed on this object.
- */
- public static void assertDialog(Dialog dialog, Assert assert) {
- assert.assertNotNull(dialog);
- if (_verifyDialog.getShell() == null) {
- //force the creation of the verify dialog
- getShell();
- }
- if (_verifyDialog.open(dialog) == IDialogConstants.NO_ID) {
- assert.assertTrue(_verifyDialog.getFailureText(), false);
- }
- }
-
-
- /**
- * Automated test that checks all the labels and buttons of a dialog
- * to make sure there is enough room to display all the text. Any
- * text that wraps is only approximated and is currently not accurate.
- *
- * @param dialog the test dialog to be verified.
- * @param assert this is the test case object, assertions will be
- * executed on this object.
- */
- public static void assertDialogTexts(Dialog dialog, Assert assert) {
- assert.assertNotNull(dialog);
- dialog.setBlockOnOpen(false);
- dialog.open();
- Shell shell = dialog.getShell();
- verifyCompositeText(shell, assert);
- dialog.close();
- }
-
-
- /**
- * This method should be called when creating dialogs to test. This
- * ensures that the dialog's parent shell will be that of the
- * verification dialog.
- *
- * @return Shell The shell of the verification dialog to be used as
- * the parent shell of the test dialog.
- */
- public static Shell getShell() {
- Shell shell =
- WorkbenchPlugin
- .getDefault()
- .getWorkbench()
- .getActiveWorkbenchWindow()
- .getShell();
- _verifyDialog = new VerifyDialog(shell);
- _verifyDialog.create();
- return _verifyDialog.getShell();
- }
-
-
- /*
- * Looks at all the child widgets of a given composite and
- * verifies the text on all labels and widgets.
- * @param composite The composite to look through
- * @param assert The object to invoke assertions on.
- */
- private static void verifyCompositeText(Composite composite, Assert assert) {
- Control children[] = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- try {
- //verify the text if the child is a button
- verifyButtonText((Button) children[i], assert);
- } catch (ClassCastException exNotButton) {
- try {
- //child is not a button, maybe a label
- verifyLabelText((Label) children[i], assert);
- } catch (ClassCastException exNotLabel) {
- try {
- //child is not a label, make a recursive call if it is a composite
- verifyCompositeText((Composite) children[i], assert);
- } catch (ClassCastException exNotComposite) {
- //the child is not a button, label, or composite - ignore it.
- }
- }
- }
- }
- }
-
- /*
- * Verifies that a given button is large enough to display its text.
- * @param button The button to verify,
- * @param assert The object to invoke assertions on.
- */
- private static void verifyButtonText(Button button, Assert assert) {
- String widget = button.toString();
- Point size = button.getSize();
-
-
- //compute the size with no line wrapping
- Point preferred = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //if (size.y/preferred.y) == X, then label spans X lines, so divide
- //the calculated value of preferred.x by X
- if (preferred.y * size.y > 0) {
- preferred.y /= countLines(button.getText()); //check for '\n\'
- if (size.y / preferred.y > 1) {
- preferred.x /= (size.y / preferred.y);
- }
- }
-
-
- String message =
- new StringBuffer("Warning: ")
- .append(widget)
- .append("\n\tActual Width -> ")
- .append(size.x)
- .append("\n\tRecommended Width -> ")
- .append(preferred.x)
- .toString();
- if (preferred.x > size.x) {
- //close the dialog
- button.getShell().dispose();
- assert.assertTrue(message.toString(), false);
- }
- }
-
- /*
- * Verifies that a given label is large enough to display its text.
- * @param label The label to verify,
- * @param assert The object to invoke assertions on.
- */
- private static void verifyLabelText(Label label, Assert assert) {
- String widget = label.toString();
- Point size = label.getSize();
-
-
- //compute the size with no line wrapping
- Point preferred = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- //if (size.y/preferred.y) == X, then label spans X lines, so divide
- //the calculated value of preferred.x by X
- if (preferred.y * size.y > 0) {
- preferred.y /= countLines(label.getText());
- if (size.y / preferred.y > 1) {
- preferred.x /= (size.y / preferred.y);
- }
- }
- String message =
- new StringBuffer("Warning: ")
- .append(widget)
- .append("\n\tActual Width -> ")
- .append(size.x)
- .append("\n\tRecommended Width -> ")
- .append(preferred.x)
- .toString();
- if (preferred.x > size.x) {
- //close the dialog
- label.getShell().dispose();
- assert.assertTrue(message.toString(), false);
- }
- }
-
- /*
- * Counts the number of lines in a given String.
- * For example, if a string contains one (1) newline character,
- * a value of two (2) would be returned.
- * @param text The string to look through.
- * @return int the number of lines in text.
- */
- private static int countLines(String text) {
- int newLines = 1;
- for (int i = 0; i < text.length(); i++) {
- if (text.charAt(i) == '\n') {
- newLines++;
- }
- }
- return newLines;
- }
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java
deleted file mode 100644
index e79254f0211..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-import java.util.Stack;
-/**
- * @author Peter Graves
- *
- * This utility class maintains a list of strings, and as a tests finds strings
- * in a structure/list, it will maintain a list of unfound/extra strings.
- */
-public class ExpectedStrings {
-
- public String [] expStrings;
- private boolean[] foundStrings;
- private Stack extraStrings; /* A stack of the unecpected strings we
- * recieved
- */
- private boolean extra;
-
- /**
- * Constructor for ExpectedStrings.
- */
- public ExpectedStrings() {
- }
- /**
- * Constructor for ExpectedStrings that accepts a list of strings that
- * we expect to get.
- */
- public ExpectedStrings(String[] values) {
- int x;
- expStrings=new String[values.length];
- for (x=0;x<values.length;x++) {
- expStrings[x]=new String(values[x]);
- }
- foundStrings=new boolean[values.length];
- for (x=0;x<values.length;x++) {
- foundStrings[x]=false;
- }
- extraStrings=new Stack();
- extra=false;
- }
-
- public int foundString(String current) {
- int x;
- for (x=0;x<expStrings.length;x++) {
- if (current.equals(expStrings[x])) {
- foundStrings[x]=true;
- return(0);
- }
- }
- /* If we arrive here, the strings was not found, so this is
- * and extra string
- */
-
- extraStrings.push(new String(current));
- extra=true;
- return(1);
- }
- public int getNum(String name) {
- int x;
- for (x=0;x<expStrings.length;x++) {
- if (name.equals(expStrings[x]))
- return(x);
- }
- return(-1);
- }
- public boolean gotAll() {
- int x;
- for (x=0;x<expStrings.length;x++) {
- if (foundStrings[x]==false)
- return(false);
- }
- return(true);
- }
- public boolean gotExtra() {
- return(extra);
- }
- public String getMissingString() {
- int x;
- String missing = new String("Missing elements: ");
- for (x=0;x<expStrings.length;x++) {
- if (foundStrings[x]==false)
- missing+=expStrings[x];
- missing+=" ";
- }
- return(missing);
- }
- public String getExtraString() {
- String extra= new String("Extra elements: ");
- while (!extraStrings.empty()) {
- extra+=extraStrings.pop();
- extra+=" ";
- }
- return(extra);
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java
deleted file mode 100644
index fdf7120dc4f..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * @author Peter Graves
- *
- *Some simple tests to make sure our ExtraStrings class seems to work.
- */
-public class ExpectedStringsTests extends TestCase {
-
- /**
- * Constructor for ExpectedStringsTests.
- * @param name
- */
- public ExpectedStringsTests(String name) {
- super(name);
- }
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- *
- * Example code test the packages in the project
- * "com.qnx.tools.ide.cdt.core"
- */
- protected void setUp() {
-
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void tearDown() {
- // release resources here and clean-up
- }
-
- public static TestSuite suite() {
- return new TestSuite(ExpectedStringsTests.class);
- }
-
- public static void main (String[] args){
- junit.textui.TestRunner.run(suite());
- }
-
- public void testGotAll() {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertTrue("No found strings", !myExp.gotAll());
- myExp.foundString("stringOne");
- assertTrue("1 found strings", !myExp.gotAll());
- myExp.foundString("stringTwo");
- assertTrue("2 found strings", !myExp.gotAll());
- myExp.foundString("stringThree");
- assertTrue("All found strings", myExp.gotAll());
-
-
- }
- public void testGotExtra () {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertTrue("No found strings", !myExp.gotExtra());
- myExp.foundString("stringOne");
- assertTrue("1 found strings", !myExp.gotExtra());
- myExp.foundString("stringTwo");
- assertTrue("2 found strings", !myExp.gotExtra());
- myExp.foundString("stringThree");
- assertTrue("All found strings", !myExp.gotExtra());
- myExp.foundString("Somerandomestring");
- assertTrue("Extra String", myExp.gotExtra());
-
- }
-
- public void testGetMissingString()
- {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringOne");
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringTwo");
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringThree");
- assertNotNull(myExp.getMissingString());
-
- }
-
- public void testGetExtraString()
- {
- ExpectedStrings myExp;
- String[] strings= {"stringOne", "stringTwo", "stringThree" };
-
- myExp=new ExpectedStrings(strings);
- assertNotNull(myExp.getExtraString());
- myExp.foundString("stringOnenot");
- assertNotNull(myExp.getMissingString());
- myExp.foundString("stringTwonot");
- assertNotNull(myExp.getMissingString());
-
- }
-
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FailureDialog.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FailureDialog.java
deleted file mode 100644
index 7f0f74a6509..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FailureDialog.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.JFaceResources;
-
-
-/*
- * A dialog for collecting notes from the tester regarding
- * the failure of a test.
- */
-public class FailureDialog extends Dialog {
- private Text _text;
- private String _log;
- private int SIZING_TEXT_WIDTH = 400;
- private int SIZING_TEXT_HEIGHT = 200;
-
- /**
- * Constructor for FailureDialog
- */
- public FailureDialog(Shell parentShell) {
- super(parentShell);
- }
- /* (non-Javadoc)
- * Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Dialog Test Failed");
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, "&OK", true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // page group
- Composite composite = (Composite)super.createDialogArea(parent);
- composite.setSize( composite.computeSize(SWT.DEFAULT, SWT.DEFAULT) );
-
- Label label = new Label(composite, SWT.WRAP);
- label.setText("&Enter a note regarding the failure:");
-
- _text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- _text.setFont( JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT) );
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = SIZING_TEXT_WIDTH;
- data.heightHint = SIZING_TEXT_HEIGHT;
- _text.setLayoutData(data);
-
- return composite;
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void okPressed() {
- _log = _text.getText();
- super.okPressed();
- }
- /*
- * @return String the text contained in the input area of
- * the dialog.
- */
- String getText() {
- if (_log == null) {
- return "Empty entry.";
- } else {
- return _log;
- }
- }
- /*
- * Sets the text of the input area. This should only be
- * called to set the initial text so only call before invoking
- * open().
- */
- void setText(String text) {
- _text.setText(text);
- }
- /*
- * Returns a string representation of this class which
- * the text contained in the input area of the dialog.
- */
- public String toString() {
- return getText();
- }
-}
-
-
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FocusTestPass.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FocusTestPass.java
deleted file mode 100644
index d2403b77eab..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/FocusTestPass.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-
-/*
- * This test pass verifies the initial focus of a dialog
- * when it is given focus.
- */
-public class FocusTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 1;
-
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Initial Focus";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the initial focus of the dialogs.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Initial Focus";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) the initial focus is appropriate.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "The initial focus is inappropriate.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the initial focus of the dialog correct?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_FOCUS;
- }
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/IDialogTestPass.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/IDialogTestPass.java
deleted file mode 100644
index 73007b04359..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/IDialogTestPass.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-import java.util.ArrayList;
-
-
-/*
- * Interface to describe a visual test pass for a dialog test.
- */
-public interface IDialogTestPass {
- /*
- * @return String The title of the test pass.
- */
- public String title();
- /*
- * @return String The description of the test pass.
- */
- public String description();
- /*
- * @return String The label of the test pass to be used
- * in a selection list. The return includes an '&'
- * if a mnemonic is desired.
- */
- public String label();
- /*
- * @return ArrayList A list of items to appear in a checklist.
- * The items in the list must be Strings and should include an
- * '&' if a mnemonic is desired.
- */
- public ArrayList checkListTexts();
- /*
- * @return String[] Associated failure messages that correspond
- * to the checklist items. The size of this array should be the
- * same size as the checklist.
- */
- public String[] failureTexts();
- /*
- * @return String The test that corresponds to the test pass to
- * which the tester will respond with a 'yes' or 'no'.
- */
- public String queryText();
- /*
- * @return int A unique number that identifies the test pass.
- */
- public int getID();
-}
-
-
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/SizingTestPass.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/SizingTestPass.java
deleted file mode 100644
index d91b63bca73..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/SizingTestPass.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-
-/*
- * This test pass verifies visually the sizing of the dialog and its
- * widgets.
- */
-class SizingTestPass implements IDialogTestPass {
- private static final int CHECKLIST_SIZE = 5;
-
-
- /**
- * @see IDialogTestPass#title()
- */
- public String title() {
- return "Test Pass: Sizing and Display";
- }
- /**
- * @see IDialogTestPass#description()
- */
- public String description() {
- return "Verify the sizing and display of the dialogs and widgets.";
- }
- /**
- * @see IDialogTestPass#label()
- */
- public String label() {
- return "&Sizing and Display";
- }
- /**
- * @see IDialogTestPass#checkListTexts()
- */
- public ArrayList checkListTexts() {
- ArrayList list = new ArrayList(CHECKLIST_SIZE);
- list.add("&1) the correct dialog displays.");
- list.add("&2) the dialog is an appropriate size for the required resolution (1024x768).");
- list.add("&3) the texts are correct and not cut off.");
- list.add("&4) all strings have been externalized properly.");
- list.add("&5) all the widgets are viewable and not cut off.");
- return list;
- }
- /**
- * @see IDialogTestPass#failureTexts()
- * Size of the return array must be the same size as the checkListTexts'
- * ArrayList.
- */
- public String[] failureTexts() {
- String[] failureText = new String[CHECKLIST_SIZE];
- failureText[0] = "The wrong dialog displayed.";
- failureText[1] = "The dialog is too large for the required resolution.";
- failureText[2] = "Text labels are wrong or cut off.";
- failureText[3] = "Some strings have not been externalized properly.";
- failureText[4] = "Some widgets are cut off.";
- return failureText;
- }
- /**
- * @see IDialogTestPass#queryText()
- */
- public String queryText() {
- return "Is the sizing and display of the dialog correct?";
- }
- /**
- * @see IDialogTestPass#getID()
- */
- public int getID() {
- return VerifyDialog.TEST_SIZING;
- }
-} \ No newline at end of file
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/VerifyDialog.java b/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/VerifyDialog.java
deleted file mode 100644
index 42361b65506..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/VerifyDialog.java
+++ /dev/null
@@ -1,305 +0,0 @@
-package org.eclipse.cdt.debug.testplugin.util;
-
-
-import java.util.Iterator;
-
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-/*
- * This dialog is intended to verify a dialogs in a testing
- * environment. The tester can test for sizing, initial focus,
- * or accessibility.
- */
-public class VerifyDialog extends TitleAreaDialog {
- private int SIZING_WIDTH = 400;
-
- private static int TEST_TYPE;
- public static final int TEST_SIZING = 0;
- public static final int TEST_FOCUS = 1;
- public static final int TEST_ACCESS = 2;
- private IDialogTestPass _dialogTests[] = new IDialogTestPass[3];
-
-
- private Dialog _testDialog; //the dialog to test
- private Point _testDialogSize;
-
- private Label _queryLabel;
- private Button _yesButton;
- private Button _noButton;
- private Button _checkList[];
- private String _failureText;
-
- /*
- * Create an instance of the verification dialog.
- */
- public VerifyDialog(Shell parent) {
- super(parent);
- if ( !(TEST_TYPE <= 2) && !(TEST_TYPE >= 0) ) {
- TEST_TYPE = TEST_SIZING;
- }
- _failureText = "";
- _dialogTests[0] = new SizingTestPass();
- _dialogTests[1] = new FocusTestPass();
- _dialogTests[2] = new AccessibilityTestPass();
- }
-
- /* (non-Javadoc)
- * Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText("Dialog Verification");
- setShellStyle(SWT.NONE);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- _yesButton = createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true);
- _noButton = createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void buttonPressed(int buttonId) {
- if (IDialogConstants.YES_ID == buttonId) {
- setReturnCode(IDialogConstants.YES_ID);
- if (_testDialog.getShell() != null) {
- _testDialog.close();
- }
- close();
- } else if (IDialogConstants.NO_ID == buttonId) {
- handleFailure();
- }
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- // top level composite
- Composite parentComposite = (Composite)super.createDialogArea(parent);
-
-
- // create a composite with standard margins and spacing
- Composite composite = new Composite(parentComposite, SWT.NONE);
- composite.setSize(SIZING_WIDTH, SWT.DEFAULT);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-
- createTestSelectionGroup(composite);
- createCheckListGroup(composite);
-
-
- _queryLabel = new Label(composite, SWT.NONE);
- _queryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- initializeTest();
- return composite;
- }
- /*
- * Group for selecting type of test.
- */
- private void createTestSelectionGroup(Composite parent) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Testing:");
- group.setLayout( new GridLayout() );
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- for (int i = 0; i < _dialogTests.length; i++) {
- Button radio = new Button(group, SWT.RADIO);
- radio.setText( _dialogTests[i].label() );
- final int testID = _dialogTests[i].getID();
- radio.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- TEST_TYPE = testID;
- initializeTest();
- _yesButton.setEnabled(true);
- }
- });
- if ( TEST_TYPE == _dialogTests[i].getID() ) {
- radio.setSelection(true);
- }
- }
- }
- /*
- * Initializes the checklist with empty checks.
- */
- private void createCheckListGroup(Composite parent) {
- Group group = new Group(parent, SWT.SHADOW_NONE);
- group.setText("Verify that:");
- group.setLayout( new GridLayout() );
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayoutData(data);
-
- int checkListSize = 0;
- for (int i = 0; i < _dialogTests.length; i++) {
- int size = _dialogTests[i].checkListTexts().size();
- if (size > checkListSize) {
- checkListSize = size;
- }
- }
- _checkList = new Button[checkListSize];
- SelectionAdapter selectionAdapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- checkYesEnable();
- }
- };
- for (int i = 0; i < checkListSize; i++) {
- _checkList[i] = new Button(group, SWT.CHECK);
- _checkList[i].addSelectionListener(selectionAdapter);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.grabExcessHorizontalSpace = true;
- _checkList[i].setLayoutData(data);
- }
- }
- /*
- * Disables the yes button if any of the items in the checklist
- * are unchecked. Enables the yes button otherwise.
- */
- private void checkYesEnable() {
- boolean enable = true;
- for (int i = 0; i < _checkList.length; i++) {
- if ( !_checkList[i].getSelection() ) {
- enable = false;
- }
- }
- _yesButton.setEnabled(enable);
- }
- /*
- * Initializes the checklist, banner texts, and query label
- */
- private void initializeTest() {
- IDialogTestPass test = _dialogTests[TEST_TYPE];
- setTitle( test.title() );
- setMessage( test.description() );
- Iterator iterator = test.checkListTexts().iterator();
- for (int i = 0; i < _checkList.length; i++) {
- if ( iterator.hasNext() ) {
- _checkList[i].setText( iterator.next().toString() );
- _checkList[i].setVisible(true);
- _checkList[i].update();
- } else {
- _checkList[i].setVisible(false);
- _checkList[i].update();
- }
- _checkList[i].setSelection(true);
- }
- _queryLabel.setText( test.queryText() );
- }
- public String getFailureText() {
- return _failureText;
- }
- /*
- * Can't open the verification dialog without a specified
- * test dialog, this simply returns a failure and prevents
- * opening. Should use open(Dialog) instead.
- *
- */
- public int open() {
- _failureText = "Testing dialog is required, use VerifyDialog::open(Dialog)";
- return IDialogConstants.NO_ID;
- }
- /*
- * Opens the verification dialog to test the specified dialog.
- */
- public int open(Dialog testDialog) {
- if (getShell() == null) {
- create();
- }
- getShell().setLocation(0, 0);
- getShell().setSize(Math.max(SIZING_WIDTH, getShell().getSize().x), getShell().getSize().y);
- _testDialog = testDialog;
- if (_testDialog.getShell() == null) {
- _testDialog.create();
- }
- _testDialogSize = _testDialog.getShell().getSize();
- openNewTestDialog();
-
- return super.open();
- }
- /*
- * Opens the dialog to be verified.
- */
- private void openNewTestDialog() {
- if (_testDialog.getShell() == null) {
- _testDialog.create();
- }
- _testDialog.setBlockOnOpen(false);
- _testDialog.getShell().setLocation(getShell().getSize().x + 1, 0);
- _testDialog.getShell().setSize(_testDialogSize);
- _testDialog.getShell().addShellListener(new ShellAdapter() {
- public void shellClosed(ShellEvent e) {
- e.doit = false;
- }
-
- });
- _testDialog.open();
- }
- /*
- * The test dialog failed, open the failure dialog.
- */
- private void handleFailure() {
- IDialogTestPass test = _dialogTests[TEST_TYPE];
- StringBuffer text = new StringBuffer();
- String label = test.label();
- label = label.substring(0, label.indexOf("&")) +
- label.substring(label.indexOf("&") + 1);
- text.append(label).
- append(" failed on the ").
- append(SWT.getPlatform()).
- append(" platform:\n");
-
- String failureMessages[] = test.failureTexts();
- for (int i = 0; i < test.checkListTexts().size(); i++) {
- if ( !_checkList[i].getSelection() ) {
- text.append("- ").append(failureMessages[i]).append("\n");
- }
- }
- FailureDialog dialog = new FailureDialog( getShell() );
- dialog.create();
-// String temp = text.toString();
- dialog.setText( text.toString() );
- if (dialog.open() == IDialogConstants.OK_ID) {
- _failureText = dialog.toString();
- setReturnCode(IDialogConstants.NO_ID);
- if (_testDialog.getShell() != null) {
- _testDialog.close();
- }
- close();
- }
- }
- /*
- * In case the shell was closed by a means other than
- * the NO button.
- */
- protected void handleShellCloseEvent() {
- handleFailure();
- }
-}
-
-
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/test.xml b/debug/org.eclipse.cdt.debug.ui.tests/test.xml
deleted file mode 100644
index 45036dab5c6..00000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/test.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.jdt.ui.tests"/>
- <property name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test/library.xml"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <property name="jdt-folder"
- value="${eclipse-home}/jdt_folder"/>
- <delete dir="${jdt-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jdt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.jdt.ui.tests.AutomatedSuite"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>

Back to the top