1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

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>
This commit is contained in:
Simon Marchi 2014-12-24 09:17:41 -05:00 committed by Marc Khouzam
parent f11fcce2ee
commit 8741098869
2 changed files with 6 additions and 9 deletions

View file

@ -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;

View file

@ -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());
}
}