From 50ce6beede8919f6e5780f2259e2012ac90392f9 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Sun, 5 Jun 2016 19:42:57 -0400 Subject: [PATCH] Add logging to Stand-alone debugger test This will help give a clue where is hangs when running on Hudson Change-Id: If72db5e9d4ac387328074071ab3eacf33d81ca9c Signed-off-by: Marc-Andre Laperle --- .../debug/application/tests/StandaloneTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java index 989efd27b96..cdd51e7b456 100644 --- a/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java +++ b/debug/org.eclipse.cdt.debug.application.tests/src/org/eclipse/cdt/debug/application/tests/StandaloneTest.java @@ -10,6 +10,9 @@ *******************************************************************************/ package org.eclipse.cdt.debug.application.tests; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; import org.eclipse.core.runtime.IPath; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView; import org.eclipse.swtbot.swt.finder.SWTBot; @@ -18,6 +21,7 @@ import org.eclipse.swtbot.swt.finder.waits.Conditions; import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.junit.After; +import org.junit.AfterClass; public abstract class StandaloneTest { @@ -27,11 +31,15 @@ public abstract class StandaloneTest { protected static String projectName; protected static SWTBotShell mainShell; protected static SWTBotView projectExplorer; + private static final Logger fLogger = Logger.getRootLogger(); public static void init(String projectName) throws Exception { SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US"; SWTBotPreferences.TIMEOUT = 20000; + fLogger.removeAllAppenders(); + fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); + bot = new SWTBot(); Utilities.getDefault().buildProject(projectName); final IPath executablePath = Utilities.getDefault().getProjectPath(projectName).append("a.out"); //$NON-NLS-1$ @@ -71,6 +79,14 @@ public abstract class StandaloneTest { // mainShell.activate(); } + /** + * Test class tear down method. + */ + @AfterClass + public static void tearDown() { + fLogger.removeAllAppenders(); + } + private static final class WaitForFileCondition extends DefaultCondition { private final IPath executablePath;