Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui.tests')
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.classpath8
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.cvsignore1
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.project28
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/.settings/org.eclipse.jdt.core.prefs57
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/Changelog69
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/META-INF/MANIFEST.MF22
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/about.html24
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/build.properties18
-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/AbstractDebugTest.java240
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java41
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java616
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java144
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/EventBreakpointTests.java94
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java119
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java40
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/ProjectWithSpaceTests.java103
-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/pom.xml35
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/resources/debugCxxTest.zipbin3550 -> 0 bytes
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zipbin1578 -> 0 bytes
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java87
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java238
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java64
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java106
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java126
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/test.xml51
27 files changed, 0 insertions, 2442 deletions
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 008f088c0b..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="core"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <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 ba077a4031..0000000000
--- 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 05c3409f88..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.cdt.debug.ui.tests</name>
- <comment></comment>
- <projects>
- </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/.settings/org.eclipse.jdt.core.prefs b/debug/org.eclipse.cdt.debug.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f1a5b0952d..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,57 +0,0 @@
-#Mon Jan 28 09:57:10 CST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.7
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 89f305af7c..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/Changelog
+++ /dev/null
@@ -1,69 +0,0 @@
-2005-07-22 Alain Magloire
- Fix to Copyright.
-
-2004-10-17 Alain Magloire
- Remove deprecated method in CDI adjust the implementation.
- * core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
- * core/org/eclipse/cdt/debug/core/tests/DebugTests.java
- * core/org/eclipse/cdt/debug/core/tests/LocationTests.java
-
-2004-10-15 Alain Magloire
- Adjust to the change in the CDI
- * core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
- * core/org/eclipse/cdt/debug/core/tests/DebugTests.java
- * core/org/eclipse/cdt/debug/core/tests/LocationTests.java
-
-2004-09-07 Mikhail Khodjaiants
- Moved to the new breakpoint management API.
- * core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
- * core/org/eclipse/cdt/debug/core/tests/DebugTests.java
- * core/org/eclipse/cdt/debug/core/tests/LocationTests.java
-
-2003-07-03 Peter Graves
-
- Major cleanup. Pulled all resouces out of the source tree, and fixed the
- tests to get them from the new location.
- Made sure the debug sessions were all terminated before we try to delete the
- the projects (if the tests failed, the session would not be terminated, and
- then we would not be able to remove the projects.)
- Also updated the breakpoint tests to only create and build the test project
- once per run, not once per test method.
-
-2003-04-04 Alain Magloire
-
- * src/org/eclipse/cdt/debug/testplugin/util/VeryfyDialog.java:
- Get rig of some warnings.
-
-2003-03-27 Alain Magloire
-
- Adjust the code because of refactoring.
- ICFolder and ICResource are removed.
-
-2003-01-29 Peter Graves
-
- Fixed warnings when accessing static methods
- * src/org/eclipse/cdt/debug/testplugin/util/DialogCheck.java:
- * src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java:
- * src/org/eclipse/cdt/debug/testplugin/TestWorkbench.java:
- * ChangeLog: Make all the entries have the same formatting
-
-2003-01-22 Judy N. Green
-
- * /home/tools/org.eclipse.cdt.debug.ui.tests/.project
- * /home/tools/org.eclipse.cdt.debug.ui.tests/.classpath
- updated classpath and .project to reflect classpath changes.
-
-2003-01-21 Peter Graves
-
- * src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java: Updated to use new parameters to
- ICDISession.createCSession
-
-2002-12-17 Peter Graves
-
- * plugin.xml,test.xml: Some simple cleanups to remove refrences to the jdt and
- to move closer to automated running.
-
-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/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 822f187211..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: org.eclipse.cdt.debug.ui.tests
-Bundle-SymbolicName: org.eclipse.cdt.debug.ui.tests;singleton:=true
-Bundle-Version: 6.0.0.qualifier
-Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
-Export-Package: org.eclipse.cdt.debug.core.tests,
- org.eclipse.cdt.debug.testplugin,
- org.eclipse.cdt.debug.testplugin.util
-Require-Bundle: org.eclipse.ui.ide,
- org.eclipse.core.resources,
- org.junit,
- org.eclipse.cdt.debug.core,
- org.eclipse.cdt.debug.mi.core,
- org.eclipse.cdt.core,
- org.eclipse.ui,
- org.eclipse.core.runtime.compatibility,
- org.eclipse.cdt.gdb;bundle-version="7.0.0"
-Bundle-ActivationPolicy: lazy
-Plugin-Class: org.eclipse.cdt.debug.testplugin.CTestPlugin
-Bundle-Vendor: Eclipse CDT
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
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 9c7ba0a57b..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/about.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
-
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>May 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</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 643f886aac..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2008 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-source.. = src/,\
- core/
-bin.includes = about.html,\
- plugin.xml,\
- resources/,\
- .,\
- test.xml,\
- META-INF/
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 e69de29bb2..0000000000
--- 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/AbstractDebugTest.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AbstractDebugTest.java
deleted file mode 100644
index d2117d8784..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AbstractDebugTest.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-import junit.extensions.TestSetup;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDILocation;
-import org.eclipse.cdt.debug.core.cdi.ICDILocator;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.core.model.ICBreakpointType;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.cdt.debug.testplugin.CDebugHelper;
-import org.eclipse.cdt.debug.testplugin.CProjectHelper;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-
-public abstract class AbstractDebugTest extends TestCase {
- IWorkspace workspace;
- IWorkspaceRoot root;
- NullProgressMonitor monitor;
- static ICProject testProject = null;
- static ICDISession session = null;
- static ICDITarget targets[] = null;
- ICDITarget currentTarget;
- static boolean oneTimeSetupDone = false;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- if (oneTimeSetupDone == false) {
- oneTimeSetUp(); // this can happened when run junit failed test from UI, without invoking suite()
- oneTimeSetupDone = false; // re-set it back so tarDownOnes will run
- }
- /***********************************************************************
- * 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"); //$NON-NLS-1$
- if (root == null)
- fail("Workspace root was not setup"); //$NON-NLS-1$
- }
-
- void createDebugSession() throws IOException, MIException, CModelException {
- session = CDebugHelper.createSession(getProjectBinary(), testProject);
- assertNotNull(session);
- targets = session.getTargets();
- assertNotNull(targets);
- assertTrue(targets.length > 0);
- currentTarget = targets[0];
- }
-
- /**
- * 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 oneTimeSetUp() throws CoreException, InvocationTargetException, IOException {
- ResourcesPlugin.getWorkspace().getDescription().setAutoBuilding(false);
- /***********************************************************************
- * Create a new project and import the test source.
- */
- Path imputFile = new Path(getProjectZip());
- testProject = CProjectHelper.createCProjectWithImport(getProjectName(), imputFile);
- if (testProject == null)
- fail("Unable to create project"); //$NON-NLS-1$
- /* Build the test project.. */
-
- testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
- oneTimeSetupDone = true;
- }
-
- protected String getProjectName() {
- return "filetest";
- }
-
- protected String getProjectZip() {
- return "resources/debugTest.zip";
- }
-
- protected String getProjectBinary() {
- return "main";
- }
-
-
- public static Display getDisplay() {
- return PlatformUI.getWorkbench().getDisplay();
- }
- /**
- * Dispatch ui events for at least msec - milliseconds
- *
- * @param msec -
- * milliseconds delay
- */
- public static void uimsleep(int msec) {
- long cur = System.currentTimeMillis();
- long pass = 0;
- Display display = getDisplay();
- while (pass < msec) {
- if (!display.readAndDispatch())
- display.sleep();
- pass = System.currentTimeMillis() - cur;
- }
- }
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- protected void oneTimeTearDown() throws CoreException {
- if (targets != null) {
- try {
- targets[0].terminate();
- } catch (CDIException e) {
- }
- }
- if (session != null) {
- try {
- session.terminate();
- } catch (CDIException e) {
- }
- }
- CProjectHelper.delete(testProject);
- if (oneTimeSetupDone == false) {
- oneTimeTearDown(); // this can happened when run junit failed test from UI, without invoking suite()
- }
-
- }
-
- static class DebugTestWrapper extends TestSetup {
- private AbstractDebugTest newInstance;
-
- public DebugTestWrapper(Class clazz) {
- super(new TestSuite(clazz));
- /***********************************************************************
- * Create a wrapper suite around the test suite we created above to
- * allow us to only do the general setup once for all the tests. This is
- * needed because the creation of the source and target projects takes a
- * long time and we really only need to do it once. We could do the
- * setup in the constructor, but we need to be able to remove everything
- * when we are done.
- */
- try {
- newInstance = (AbstractDebugTest) clazz.newInstance();
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- @Override
- protected void setUp() throws FileNotFoundException, IOException, InterruptedException,
- InvocationTargetException, CoreException {
- newInstance.oneTimeSetUp();
- }
-
- @Override
- protected void tearDown() throws FileNotFoundException, IOException, CoreException {
- newInstance.oneTimeTearDown();
- }
- }
-
- void pause() {
- uimsleep(200);
- }
-
- public ICDILocator getCurrentLocator() throws CDIException {
- return getCurrentFrame().getLocator();
- }
-
- public ICDIStackFrame getCurrentFrame() throws CDIException {
- return currentTarget.getCurrentThread().getStackFrames()[0];
- }
-
- void waitSuspend(ICDITarget currentTarget) {
- int loop;
- loop = 0;
- while ((currentTarget.isSuspended() == false) && (currentTarget.isTerminated() == false) && (loop < 20)) {
- uimsleep(500);
- loop++;
- }
- assertFalse("Target should be suspended, but it is terminated " + currentTarget.isTerminated(), currentTarget
- .isTerminated());
- assertTrue("Target should be suspended but it is not", currentTarget.isSuspended());
-
- }
-
- public void resumeCurrentTarget() throws CDIException{
- currentTarget.resume(false);
- }
-
- void setBreakOnMain() throws CDIException {
- ICDILocation location = null;
- location = currentTarget.createFunctionLocation("", "main"); //$NON-NLS-1$
- currentTarget.setFunctionBreakpoint(ICBreakpointType.TEMPORARY, (ICDIFunctionLocation) location, null, false);
- }
-
- @Override
- protected void tearDown() throws Exception {
- /* clean up the session */
- if (session == null) {
- session.terminate();
- session = null;
- }
- super.tearDown();
- }
-}
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 b6e11c8592..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/AllDebugTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-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 extends TestSuite {
-
- public static Test suite() {
- TestSuite suite = new AllDebugTests();
-
- // 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(EventBreakpointTests.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 d7acdc6bde..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
+++ /dev/null
@@ -1,616 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-import junit.framework.Test;
-
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIAddressLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDICondition;
-import org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDILineLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDILocator;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
-import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * @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 AbstractDebugTest {
-
-
- public static Test suite() {
- return new DebugTestWrapper(BreakpointTests.class) {};
- }
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- createDebugSession();
- assertNotNull(currentTarget);
- currentTarget.deleteAllBreakpoints();
- pause();
- }
- @Override
- protected void tearDown() throws Exception {
- /* clean up the session */
- targets[0].terminate();
- int x = 0;
- while ((!targets[0].isTerminated()) && (x < 30)) {
- Thread.sleep(100);
- }
- if (!targets[0].isTerminated())
- targets[0].terminate();
- super.tearDown();
- }
-
-
- /***************************************************************************
- * A couple tests to make sure setting breakpoints on functions works as
- * expected.
- */
- public void testFunctionBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
-
- ICDITarget cdiTarget = currentTarget;
- ICDIFunctionLocation location;
- boolean caught = false;
-
-
- /***********************************************************************
- * Create a break point on a generic function
- **********************************************************************/
-
- location = cdiTarget.createFunctionLocation(null, "func1"); //$NON-NLS-1$
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
-
- /***********************************************************************
- * Create a break point on main
- **********************************************************************/
-
- location = cdiTarget.createFunctionLocation(null, "main"); //$NON-NLS-1$
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
-
- /***********************************************************************
- * 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 = cdiTarget.createFunctionLocation(null, "badname"); //$NON-NLS-1$
- assertNotNull(location);
- try {
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
- } catch (CDIException e) {
- caught = true;
- }
- assertTrue(caught);
-
- cdiTarget.deleteAllBreakpoints();
-
- /***********************************************************************
- * Create a break point on a generic function and see if it will get hit
- * and stop program execution.
- **********************************************************************/
-
- location = cdiTarget.createFunctionLocation(null, "func1"); //$NON-NLS-1$
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
- 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
- */
- resumeCurrentTarget();
- /**
- * 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
- */
- waitSuspend(cdiTarget);
- ICDILocator locator = getCurrentLocator();
- assertTrue(locator.getLineNumber() == 6);
- assertTrue(locator.getFunction().equals("func1")); //$NON-NLS-1$
- assertTrue(locator.getFile().endsWith("main.c")); //$NON-NLS-1$
- }
-
- /***************************************************************************
- * A couple tests to make sure setting breakpoints on line numbers works as
- * expected.
- */
- public void testLineBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDITarget cdiTarget = currentTarget;
- ICDILineLocation location;
- boolean caught = false;
-
-
- /***********************************************************************
- * Create a break point in a generic function
- **********************************************************************/
- location = cdiTarget.createLineLocation("main.c", 7);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location, null, false);
-
- /***********************************************************************
- * Create a break point in main
- **********************************************************************/
- location = cdiTarget.createLineLocation("main.c", 18);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location, null, false);
-
- /***********************************************************************
- * 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 = cdiTarget.createLineLocation("main.c", 30);
- assertNotNull(location);
- try {
- cdiTarget.setLineBreakpoint(0, location, null, false);
- } 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 = cdiTarget.createLineLocation("main.c", 11);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location, null, false);
-
- /***********************************************************************
- * 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 = cdiTarget.createLineLocation(null, 7);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location, null, false);
- caught = false;
- location = cdiTarget.createLineLocation(null, 30);
- assertNotNull(location);
- try {
- cdiTarget.setLineBreakpoint(0, location, null, false);
- } catch (CDIException e) {
- caught = true;
- }
- assertTrue("Ignoring line numbers with no file specified?", caught);
-
- cdiTarget.deleteAllBreakpoints();
-
- /***********************************************************************
- * Create a break point on a line number and see if it will get hit and
- * stop program execution.
- **********************************************************************/
-
- location = cdiTarget.createLineLocation(null, 7);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location, null, false);
- 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());
- ICDILocator locator = getCurrentLocator();
- assertTrue(locator.getLineNumber() == 7);
- assertTrue(locator.getFunction().equals("func1"));
- assertTrue(locator.getFile().endsWith("main.c"));
-
- }
-
- /***************************************************************************
- * A couple tests to make sure getting breakpoints works as expected
- */
- public void testGetBreak() throws CoreException, MIException, IOException, CDIException {
- ICDITarget cdiTarget = currentTarget;
- ICDIFunctionLocation location;
- ICDIBreakpoint[] breakpoints;
- ICDILocationBreakpoint curbreak;
-
-
- /***********************************************************************
- * Make sure initially we don't have any breakpoints
- **********************************************************************/
- breakpoints = cdiTarget.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 = cdiTarget.createFunctionLocation("main.c", "func1");
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
-
- breakpoints = cdiTarget.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length == 1);
- if (breakpoints[0] instanceof ICDILocationBreakpoint) {
- curbreak = (ICDILocationBreakpoint) breakpoints[0];
- } else
- curbreak = null;
- assertNotNull(curbreak);
-
- //assertTrue(curbreak.getLocator().equals(location));
- {
- ICDILocator locator = curbreak.getLocator();
- String file = locator.getFile();
- String function = locator.getFunction();
- assertTrue("main.c".equals(file));
- assertTrue("func1".equals(function));
- }
-
- /***********************************************************************
- * 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 = cdiTarget.createFunctionLocation("main.c", "main");
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
-
- breakpoints = cdiTarget.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));
- {
- ICDILocator locator = curbreak.getLocator();
- String file = locator.getFile();
- String function = locator.getFunction();
- assertTrue("main.c".equals(file));
- assertTrue("main".equals(function));
- }
-
- cdiTarget.deleteAllBreakpoints();
-
-
- }
-
- /***************************************************************************
- * A couple tests to make sure deleting breakpoints works as expected
- */
- public void testDelBreak() throws CoreException, MIException, IOException, CDIException {
- ICDITarget cdiTarget = currentTarget;
- ICDIFunctionLocation location;
- ICDILocator savedLocation;
- ICDIBreakpoint[] breakpoints, savedbreakpoints;
- ICDILocationBreakpoint curbreak;
-
- /* Make sure initially we don't have any breakpoints */
- breakpoints = cdiTarget.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 = cdiTarget.createFunctionLocation("main.c", "func1");
- assertNotNull(location);
- curbreak = cdiTarget.setFunctionBreakpoint(0, location, null, false);
- cdiTarget.deleteBreakpoints( new ICDIBreakpoint[] { curbreak } );
- pause();
- /**
- * we should not have any breakpoints left.
- */
- breakpoints = cdiTarget.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 = cdiTarget.createFunctionLocation("main.c", "func1");
- assertNotNull(location);
- curbreak = cdiTarget.setFunctionBreakpoint(0, location, null, false);
- savedLocation = curbreak.getLocator();
-
- location = cdiTarget.createFunctionLocation("main.c", "main");
- assertNotNull(location);
- curbreak = cdiTarget.setFunctionBreakpoint(0, location, null, false);
- cdiTarget.deleteBreakpoints( new ICDIBreakpoint[] { curbreak } );
- pause();
- breakpoints = cdiTarget.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.getLocator().equals(savedLocation));
- /***********************************************************************
- * Then delete the other breakpoint.
- */
- cdiTarget.deleteBreakpoints( new ICDIBreakpoint[] { curbreak } );
- pause();
- breakpoints = cdiTarget.getBreakpoints();
- assertTrue(breakpoints.length == 0);
-
- /***********************************************************************
- * Make sure deleteBreakpoints works when given 1 breakpoint to delete
- **********************************************************************/
- savedbreakpoints = new ICDIBreakpoint[1];
- int lineStart = 6;
- int maxBreakpoints = 5;
- for (int x = 0; x < maxBreakpoints; x++) {
- ICDILineLocation lineLocation = cdiTarget.createLineLocation("main.c", x + lineStart);
- ICDILocationBreakpoint bp = cdiTarget.setLineBreakpoint(0, lineLocation, null, false);
- assertNotNull(bp);
- assertEquals(x + lineStart, (bp.getLocator().getLineNumber()));
- savedbreakpoints[0] = bp;
- }
- cdiTarget.deleteBreakpoints(savedbreakpoints);
- pause();
- /* We should now have N-1 breakpoints left. */
- breakpoints = cdiTarget.getBreakpoints();
- assertTrue(breakpoints.length == maxBreakpoints-1);
- /* Make sure we have the correct N-1 breakpoints left, we deleted one at line N */
- for (int x = 0; x < breakpoints.length; x++) {
- curbreak = (ICDILocationBreakpoint) breakpoints[x];
- assertNotEquals(((ICDILocationBreakpoint)savedbreakpoints[0]).getLocator().getLineNumber(), curbreak.getLocator().getLineNumber());
- }
- cdiTarget.deleteAllBreakpoints();
- pause();
- assertTrue(cdiTarget.getBreakpoints().length == 0);
-
- /***********************************************************************
- * Make sure deleteBreakpoints works when given more then 1 but less
- * then all breakpoints to delete
- **********************************************************************/
- savedbreakpoints = new ICDIBreakpoint[2];
- for (int x = 0; x < maxBreakpoints; x++) {
- ICDILineLocation lineLocation = cdiTarget.createLineLocation("main.c", x + lineStart);
- savedbreakpoints[x % 2] = cdiTarget.setLineBreakpoint(0, lineLocation, null, false);
- assertNotNull(savedbreakpoints[x % 2]);
- }
- cdiTarget.deleteBreakpoints(savedbreakpoints);
- pause();
-
- /* We should now have maxBreakpoints-2 breakpoints left. */
- breakpoints = cdiTarget.getBreakpoints();
- assertEquals(maxBreakpoints-2, breakpoints.length );
- /* Make sure we have the correct 6 breakpoints left */
- for (int x = 0; x < breakpoints.length; x++) {
- curbreak = (ICDILocationBreakpoint) breakpoints[x];
- assertEquals(x+lineStart, curbreak.getLocator().getLineNumber());
- }
- cdiTarget.deleteAllBreakpoints();
- pause();
- assertTrue(cdiTarget.getBreakpoints().length == 0);
-
- /***********************************************************************
- * Make sure deleteBreakpoints works when given all the breakpoints
- **********************************************************************/
- savedbreakpoints = new ICDIBreakpoint[maxBreakpoints];
- for (int x = 0; x < maxBreakpoints; x++) {
- ICDILineLocation lineLocation = cdiTarget.createLineLocation("main.c", x + lineStart);
- savedbreakpoints[x] = cdiTarget.setLineBreakpoint(0, lineLocation, null, false);
- assertNotNull(savedbreakpoints[x]);
- }
- cdiTarget.deleteBreakpoints(savedbreakpoints);
- pause();
- /* We should now have 0 breakpoints left. */
- breakpoints = cdiTarget.getBreakpoints();
- assertTrue(breakpoints.length == 0);
-
- /***********************************************************************
- * Make sure deleteAllBreakpoints works
- **********************************************************************/
-
- for (int x = 0; x < maxBreakpoints; x++) {
- ICDILineLocation lineLocation = cdiTarget.createLineLocation("main.c", x + lineStart);
- curbreak = cdiTarget.setLineBreakpoint(0, lineLocation, null, false);
- assertNotNull(curbreak);
- }
- cdiTarget.deleteAllBreakpoints();
- pause();
- /* We should now have 0 breakpoints left. */
- breakpoints = cdiTarget.getBreakpoints();
- assertTrue(breakpoints.length == 0);
-
- }
-
- private void assertNotEquals(int notExpected, int actual) {
- if (notExpected==actual)
- fail("not expected:<"+actual+">");
-
- }
- /***************************************************************************
- * A couple tests to make sure setting breakpoints with conditions seems to
- * work as expected.
- */
- public void testCondBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- boolean caught = false;
- ICDITarget cdiTarget = currentTarget;
- ICDICondition cond;
-
- /***********************************************************************
- * 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
- **********************************************************************/
- cdiTarget.deleteAllBreakpoints();
- pause();
- ICDILineLocation lineLocation = cdiTarget.createLineLocation(null, 23);
- assertNotNull(lineLocation);
- cond = cdiTarget.createCondition(0, "a>10");
- cdiTarget.setLineBreakpoint(0, lineLocation, cond, false);
- pause();
- resumeCurrentTarget();
- /**
- * 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
- */
- waitSuspend(cdiTarget);
- ICDIStackFrame frame = getCurrentFrame();
- ICDILocator locator = getCurrentLocator();
- assertTrue(locator.getLineNumber() == 23);
- assertTrue(locator.getFunction().equals("main"));
- assertTrue(locator.getFile().endsWith("main.c"));
- /* Get the value of a and and make sure it is 11 */
- assertTrue(targets[0].evaluateExpressionToString(frame, "a"), targets[0].evaluateExpressionToString(frame, "a").equals("11"));
-
- }
- public void testCondBreak2() throws CoreException, MIException, IOException, CDIException, InterruptedException {
-
- ICDITarget cdiTarget = currentTarget;
-
- /***********************************************************************
- * Create a break point on a generic function with an empty condition
- **********************************************************************/
- ICDICondition cond = cdiTarget.createCondition(0, "");
- ICDIFunctionLocation location = cdiTarget.createFunctionLocation(null, "func1");
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, cond, false);
-
- /***********************************************************************
- * Create a break point on a generic function with an valid condition
- **********************************************************************/
- cond = cdiTarget.createCondition(0, "x<10");
- ICDILineLocation location2 = cdiTarget.createLineLocation("main.c", 9);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location2, cond, false);
- }
-
- public void testCondBreakError() {
- ICDITarget cdiTarget = currentTarget;
- ICDICondition cond;
- ICDIFunctionLocation location;
- /***********************************************************************
- * 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.
- **********************************************************************/
- boolean caught = false;
- cond = cdiTarget.createCondition(0, "nonexist<10");
- location = cdiTarget.createFunctionLocation(null, "func1");
- assertNotNull(location);
- try {
- cdiTarget.setFunctionBreakpoint(0, location, cond, false);
- } catch (CDIException e) {
- caught = true;
- }
- assertTrue("Setting wrong condition should fail",caught);
- }
-
- public void testHitCond() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- setBreakOnMain();
- testCondBreak2();
- resumeCurrentTarget();
- waitSuspend(currentTarget);
- }
- public void xfail_testHitCondWithError() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- // this currently fails sometimes - after set bad breakpoint it does not hit any
- // only reproducible when setting invalid condition breakpoint, reason unknown
- setBreakOnMain();
- testCondBreak2();
- testCondBreakError();
- pause();
- /* We should now have 3 breakpoints left. */
- ICDIBreakpoint[] breakpoints = currentTarget.getBreakpoints();
- assertTrue(breakpoints.length == 3);
- resumeCurrentTarget();
- waitSuspend(currentTarget);
- }
- /***************************************************************************
- * A test to make sure setting address breakpoints works as
- * expected.
- */
- public void testAddressBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
-
-
- ICDIAddressLocation location;
- boolean caught = false;
-
- setBreakOnMain();
- currentTarget.resume(false);
- waitSuspend(currentTarget);
- currentTarget.stepOver(1);
- pause();
- BigInteger address = getCurrentLocator().getAddress();
- /***********************************************************************
- * Create a break point on first instruction
- **********************************************************************/
-
- location = currentTarget.createAddressLocation(address);
- assertNotNull(location);
- currentTarget.setAddressBreakpoint(0, location, null, false);
-
- // restart
- currentTarget.restart();
- pause();
- waitSuspend(currentTarget);
-
- ICDILocator locator = getCurrentLocator();
- assertTrue(locator.getLineNumber() == 18);
- assertTrue(locator.getFunction().equals("main")); //$NON-NLS-1$
- assertTrue(locator.getFile().endsWith("main.c")); //$NON-NLS-1$
- }
-
-} \ No newline at end of file
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 793bcdf43a..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.cdt.debug.testplugin.CDebugHelper;
-import org.eclipse.cdt.debug.testplugin.CProjectHelper;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-/**
- * @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;
- ICDISession session;
-
-
- /**
- * 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"
- */
- @Override
- protected void setUp() throws CoreException, InvocationTargetException, IOException {
- ResourcesPlugin.getWorkspace().getDescription().setAutoBuilding(false);
- /***
- * Create a new project and import the test source.
- */
- IPath importFile = new Path("resources/debugTest.zip");
- testProject=CProjectHelper.createCProjectWithImport("filetest", importFile);
- if (testProject==null)
- fail("Unable to create project");
- /* Build the test project.. */
-
- testProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @Override
- protected void tearDown() throws CoreException, CDIException {
- if (session!=null) {
- session.terminate();
- session=null;
- }
- 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 {
- ICDITarget cdiTarget;
- ICDIFunctionLocation location;
-
- session=CDebugHelper.createSession("main",testProject);
- assertNotNull(session);
- ICDITarget[] targets = session.getTargets();
- assertNotNull(targets);
- assertTrue(targets.length > 0);
- cdiTarget = targets[0];
- assertNotNull(cdiTarget);
- location=cdiTarget.createFunctionLocation(null, "func1");
- assertNotNull(location);
- cdiTarget.setFunctionBreakpoint(0, location, null, false);
- cdiTarget.resume();
- session.terminate();
- session=null;
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/EventBreakpointTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/EventBreakpointTests.java
deleted file mode 100644
index 1c6120b4ee..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/EventBreakpointTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDILocator;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIEventBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICBreakpointType;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.cdt.gdb.eventbkpts.IEventBreakpointConstants;
-
-public class EventBreakpointTests extends AbstractDebugTest {
- public static Test suite() {
- return new DebugTestWrapper(EventBreakpointTests.class){};
- }
-
- @Override
- protected String getProjectName() {
- return "catchpoints";
- }
-
- @Override
- protected String getProjectZip() {
- return "resources/debugCxxTest.zip";
- }
-
- @Override
- protected String getProjectBinary() {
- return "catchpoints.exe";
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- createDebugSession();
- assertNotNull(currentTarget);
- currentTarget.deleteAllBreakpoints();
- pause();
- }
-
-
- public void testCatch() throws CModelException, IOException, MIException, CDIException {
- eventbreakpoints(IEventBreakpointConstants.EVENT_TYPE_CATCH, "");
- }
-
- public void testThrow() throws CModelException, IOException, MIException, CDIException {
- eventbreakpoints(IEventBreakpointConstants.EVENT_TYPE_THROW, "");
- }
-
- private void eventbreakpoints(String type, String arg) throws CModelException, IOException, MIException, CDIException {
- ICDIBreakpoint[] breakpoints;
- ICDIEventBreakpoint curbreak;
-
- setBreakOnMain();
- currentTarget.restart();
- waitSuspend(currentTarget);
- ICDILocator locator = getCurrentLocator();
- assertEquals("Debug should be stopped in function 'main' but it is stopped in: " + locator.getFunction(),
- "main", locator.getFunction());
-
- currentTarget.deleteAllBreakpoints();
- pause();
- assertTrue(currentTarget instanceof ICDIBreakpointManagement3);
- ((ICDIBreakpointManagement3) currentTarget).setEventBreakpoint(type, arg, ICBreakpointType.REGULAR, null, false, true);
- pause();
- breakpoints = currentTarget.getBreakpoints();
- assertNotNull(breakpoints);
- assertEquals(1, breakpoints.length);
- if (breakpoints[0] instanceof ICDIEventBreakpoint) {
- curbreak = (ICDIEventBreakpoint) breakpoints[0];
- } else
- curbreak = null;
- assertNotNull("Found breakpoint is not an event breakpoint",curbreak);
- currentTarget.resume(false);
- waitSuspend(currentTarget);
- // it is stopped we are fine, it did hit breakpoint
- }
-
-}
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 5eb3fa0d70..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDILineLocation;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
-import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * @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 AbstractDebugTest {
- public static Test suite() {
- return new DebugTestWrapper(LocationTests.class){};
- }
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- createDebugSession();
- assertNotNull(currentTarget);
- currentTarget.deleteAllBreakpoints();
- pause();
- }
-
- /***
- * A couple tests to make sure comparing Locations works as expected.
- */
- public void testIsEquals() throws CoreException, MIException, IOException, CDIException {
- ICDITarget cdiTarget = currentTarget;
- ICDILineLocation lineLocation, lineLocation2;
- ICDIFunctionLocation functionLocation, functionLocation2;
- ICDIBreakpoint[] breakpoints;
- ICDILocationBreakpoint curbreak;
-
-
- /**********************************************************************
- * Simple test.. this should work.
- **********************************************************************/
- functionLocation=cdiTarget.createFunctionLocation("main.c", "func1");
- functionLocation2=cdiTarget.createFunctionLocation("main.c", "func1");
- assertTrue(functionLocation.equals(functionLocation2));
- /**********************************************************************
- * Simple test.. this should work.
- **********************************************************************/
- lineLocation=cdiTarget.createLineLocation("main.c", 10);
- lineLocation2=cdiTarget.createLineLocation("main.c", 10);
- assertTrue(lineLocation.equals(lineLocation2));
-
- /**********************************************************************
- * 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()
- **********************************************************************/
- functionLocation=cdiTarget.createFunctionLocation("main.c", "func1");
- assertNotNull(functionLocation);
- functionLocation2=cdiTarget.setFunctionBreakpoint(0, functionLocation, null, false).getLocator();
-
- breakpoints=cdiTarget.getBreakpoints();
- assertNotNull(breakpoints);
- assertTrue(breakpoints.length==1);
- if (breakpoints[0] instanceof ICDILocationBreakpoint) {
- curbreak=(ICDILocationBreakpoint) breakpoints[0];
- } else
- curbreak=null;
- assertNotNull(curbreak);
-
- assertTrue(curbreak.getLocator().equals(functionLocation2));
- cdiTarget.deleteAllBreakpoints();
- pause();
- /* 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.
- */
- functionLocation=cdiTarget.createFunctionLocation("main.c", "func1");
- assertNotNull(functionLocation);
- cdiTarget.setFunctionBreakpoint(0, functionLocation, null, false);
-
- breakpoints=cdiTarget.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.getLocator().equals(functionLocation));
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java
deleted file mode 100644
index 10144aa170..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.cdt.debug.internal.core.sourcelookup.MapEntrySourceContainer;
-import org.eclipse.core.runtime.IPath;
-
-@SuppressWarnings("restriction")
-public class MapEntrySourceContainerTests extends TestCase {
-
- public static Test suite() {
- return new TestSuite(MapEntrySourceContainerTests.class);
- }
-
- public MapEntrySourceContainerTests(String name) {
- super(name);
- }
-
- public void testUNCPath() {
- String uncPath = "//server/path/on/server";
- IPath path = MapEntrySourceContainer.createPath(uncPath);
- assertEquals(uncPath, path.toString());
-
- uncPath = "\\\\server\\path\\on\\server";
- path = MapEntrySourceContainer.createPath(uncPath);
- assertEquals(uncPath, path.toOSString());
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/ProjectWithSpaceTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/ProjectWithSpaceTests.java
deleted file mode 100644
index 8db0d548a5..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/ProjectWithSpaceTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-import java.io.IOException;
-
-import junit.framework.Test;
-
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDILineLocation;
-import org.eclipse.cdt.debug.core.cdi.ICDILocator;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Create a project with space and do sanity test for debugger
- */
-public class ProjectWithSpaceTests extends AbstractDebugTest {
- public static Test suite() {
- return new DebugTestWrapper(ProjectWithSpaceTests.class) {
- };
- }
-
- @Override
- protected String getProjectName() {
- return "with space";
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- createDebugSession();
- assertNotNull(currentTarget);
- currentTarget.deleteAllBreakpoints();
- pause();
- }
-
- @Override
- protected void tearDown() throws Exception {
- /* clean up the session */
- targets[0].terminate();
- int x = 0;
- while ((!targets[0].isTerminated()) && (x < 30)) {
- Thread.sleep(100);
- }
- if (!targets[0].isTerminated())
- targets[0].terminate();
- super.tearDown();
- }
-
- /**
- * Basic sanity test
- */
- public void testLineBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDITarget cdiTarget = currentTarget;
- ICDILineLocation location;
- boolean caught = false;
- /***********************************************************************
- * Create a break point in a generic function
- **********************************************************************/
- location = cdiTarget.createLineLocation("main.c", 7);
- assertNotNull(location);
- cdiTarget.setLineBreakpoint(0, location, null, false);
-
- 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
- */
- ICDITarget target = targets[0];
- target.resume(false);
- /**
- * 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 (target.isSuspended() || target.isTerminated())
- break;
- Thread.sleep(100);
- }
- assertTrue("Suspended: " + target.isSuspended() + " Terminated: " + target.isTerminated(),
- target.isSuspended());
- ICDILocator locator = getCurrentLocator();
- assertTrue(locator.getLineNumber() == 7);
- assertTrue(locator.getFunction().equals("func1"));
- assertTrue(locator.getFile().endsWith("main.c"));
- }
-} \ No newline at end of file
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 a18ecb7731..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/TargetTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.core.tests;
-
-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"
- */
- @Override
- protected void setUp() throws CoreException,FileNotFoundException {
-
- /***
- * Setup the various files, paths and projects that are needed by the
- * tests
- */
- testProject=CProjectHelper.createCProject("filetest");
- if (testProject==null)
- fail("Unable to create project");
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @Override
- 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 {
-
- /***
- * Tests to come
- */
-
- }
-
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/pom.xml b/debug/org.eclipse.cdt.debug.ui.tests/pom.xml
deleted file mode 100644
index 2c49f49cca..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/pom.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.eclipse.cdt</groupId>
- <artifactId>cdt-parent</artifactId>
- <version>9.0.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <version>6.0.0-SNAPSHOT</version>
- <artifactId>org.eclipse.cdt.debug.ui.tests</artifactId>
- <packaging>eclipse-test-plugin</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-surefire-plugin</artifactId>
- <version>${tycho-version}</version>
- <configuration>
- <useUIHarness>true</useUIHarness>
- <argLine>${tycho.testArgLine} ${base.ui.test.vmargs}</argLine>
- <includes>
- <include>**/AllDebugTests.*</include>
- </includes>
- <testFailureIgnore>true</testFailureIgnore>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/resources/debugCxxTest.zip b/debug/org.eclipse.cdt.debug.ui.tests/resources/debugCxxTest.zip
deleted file mode 100644
index d29256144f..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/resources/debugCxxTest.zip
+++ /dev/null
Binary files differ
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip b/debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip
deleted file mode 100644
index 9d1bdf012f..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/resources/debugTest.zip
+++ /dev/null
Binary files differ
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 8a64105c34..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CDebugHelper.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.testplugin;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
-import org.eclipse.cdt.debug.mi.core.MIException;
-import org.eclipse.cdt.debug.mi.core.MIPlugin;
-import org.eclipse.cdt.debug.mi.core.command.MIVersion;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-
-/**
- * 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, MIVersion.MI1, new File(exename), new File("."), null, null);
- return(session);
- }
- /**
- * Creates a ICDISession.
- */
- public static ICDISession createSession(String exe, ICProject project) throws IOException, MIException, CModelException {
- MIPlugin mi;
- String workspacePath= Platform.getLocation().toOSString();
- ICDISession session;
- mi=MIPlugin.getDefault();
-
- try {
- project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (Exception exc) {}
- IBinary bins[] = project.getBinaryContainer().getBinaries();
- if (bins.length!=1) {
- //SHOULD NOT HAPPEN
- return(null);
- }
-
- session=mi.createCSession(null, MIVersion.MI1, new File(workspacePath +bins[0].getPath().toOSString()), new File("."), null, null);
- return(session);
- }
-
-
-}
-
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 2f3e5a8d5e..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CProjectHelper.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.testplugin;
-
-import java.io.File;
-import java.io.IOException;
-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.ICDescriptor;
-import org.eclipse.cdt.core.ICDescriptorOperation;
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.IArchive;
-import org.eclipse.cdt.core.model.IArchiveContainer;
-import org.eclipse.cdt.core.model.IBinary;
-import org.eclipse.cdt.core.model.IBinaryContainer;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-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 createCProjectWithImport(String projectName, IPath zipFile) throws CoreException, InvocationTargetException, IOException {
- 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);
- }
- File zip = CTestPlugin.getDefault().getFileInPlugin(zipFile);
- importFilesFromZip(new ZipFile(zip),project.getFullPath(),null);
-
- if (!project.hasNature(CProjectNature.C_NATURE_ID)) {
- addNatureToProject(project, CProjectNature.C_NATURE_ID, null);
- }
-
- ICProject cproject = CCorePlugin.getDefault().getCoreModel().create(project);
- /* Try to guess at the correct binary parser.. elf or pe at this point.. */
- ICDescriptorOperation op = new ICDescriptorOperation() {
-
- @Override
- public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
- descriptor.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
- String os = System.getProperty("os.name");
- boolean pe=(os.toLowerCase().indexOf("windows")!=-1);
- descriptor.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, pe?"org.eclipse.cdt.core.PE":"org.eclipse.cdt.core.ELF");
- }
- };
- CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(project, op, null);
- return cproject;
- }
-
-
- /**
- * Creates a ICProject.
- */
- public static ICProject createCProject(String projectName) 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);
- }
-
-
-
- /**
- * Attempts to find an archive with the given name in the workspace
- */
- public static IArchive findArchive(ICProject testProject,String name) throws CModelException {
- 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) throws CModelException {
- 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) throws CModelException {
- 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 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) throws CModelException {
- 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 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) throws CModelException {
- 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))
- return 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 {
- @Override
- 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 cf0510874e..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/CTestPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-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= CTestPlugin.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/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 4388c5d0dd..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStrings.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-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 00485d44e1..0000000000
--- a/debug/org.eclipse.cdt.debug.ui.tests/src/org/eclipse/cdt/debug/testplugin/util/ExpectedStringsTests.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - initial API and implementation
- *******************************************************************************/
-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"
- */
- @Override
- protected void setUp() {
-
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @Override
- 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/test.xml b/debug/org.eclipse.cdt.debug.ui.tests/test.xml
deleted file mode 100644
index 41075b0e15..0000000000
--- 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.cdt.debug.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="cdt-folder"
- value="${eclipse-home}/cdt_folder"/>
- <delete dir="${cdt-folder}" quiet="true"/>
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${cdt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname"
- value="org.eclipse.cdt.debug.core.tests.AllDebugTests"/>
- </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