Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Marchi2014-12-24 14:17:41 +0000
committerMarc Khouzam2014-12-24 18:41:10 +0000
commit8741098869a2b0372c6d58e558d8dbb496a5df14 (patch)
tree74cd3085b082ec0f28e5124c9a1fd65913a316ed
parentf11fcce2ee2e6c74e5d3a2c3517f9f1e5ad3e63a (diff)
downloadorg.eclipse.cdt-8741098869a2b0372c6d58e558d8dbb496a5df14.tar.gz
org.eclipse.cdt-8741098869a2b0372c6d58e558d8dbb496a5df14.tar.xz
org.eclipse.cdt-8741098869a2b0372c6d58e558d8dbb496a5df14.zip
debug tests: Don't catch exception in LaunchConfigurationAndRestartTest.doLaunch
When catching the exception and failing the test manually, the root cause exception is hidden. If we let the exception propagate, JUnit will fail the test automatically, and will provide a detailed stack trace. Change-Id: Ife099d4598109dd0901b14d482b89545cfd01d68 Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/38765 Tested-by: Hudson CI Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java6
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java9
2 files changed, 6 insertions, 9 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java
index 8654fdd47a..4372b3a6cc 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java
@@ -8,6 +8,7 @@
* Contributors:
* Ericsson AB - Initial implementation of Test cases
* Alvaro Sanchez-Leon (Ericsson) - Bug 437562 - Split the dsf-gdb tests to a plug-in and fragment pair
+ * Simon Marchi (Ericsson) - Make canRestart and restart throw Exception instead of Throwable.
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.framework;
@@ -720,7 +721,7 @@ public class SyncUtil {
/**
* Check if the restart operation is supported
*/
- public static boolean canRestart() throws Throwable {
+ public static boolean canRestart() throws Exception {
final IContainerDMContext containerDmc = getContainerContext();
// Check if restart is allowed
@@ -748,7 +749,7 @@ public class SyncUtil {
/**
* Restart the program.
*/
- public static MIStoppedEvent restart(final GdbLaunch launch) throws Throwable {
+ public static MIStoppedEvent restart(final GdbLaunch launch) throws Exception {
final IContainerDMContext containerDmc = getContainerContext();
// If we are calling this method, the restart operation should be allowed
@@ -764,7 +765,6 @@ public class SyncUtil {
// Perform the restart
Query<IContainerDMContext> query2 = new Query<IContainerDMContext>() {
- @SuppressWarnings("unchecked")
@Override
protected void execute(final DataRequestMonitor<IContainerDMContext> rm) {
Map<String, Object> attributes = null;
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java
index 485396437a..d618328c95 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Ericsson and others.
+ * Copyright (c) 2011, 2014 Ericsson 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson - Initial Implementation
+ * Simon Marchi (Ericsson) - Remove a catch that just fails a test.
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests;
@@ -109,11 +110,7 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase {
wait(1000);
}
fRestart = false;
- try {
- SyncUtil.restart(getGDBLaunch());
- } catch (Throwable e) {
- fail("Restart failed: " + e.getMessage());
- }
+ SyncUtil.restart(getGDBLaunch());
}
}

Back to the top