Author: vpakan(a)redhat.com
Date: 2011-05-30 07:34:35 -0400 (Mon, 30 May 2011)
New Revision: 31628
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
Log:
Log exception stacktrace when test failed
Modified:
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2011-05-30
10:44:50 UTC (rev 31627)
+++
trunk/jst/tests/org.jboss.tools.jst.ui.bot.test/src/org/jboss/tools/ui/bot/test/JBTSWTBotTestCase.java 2011-05-30
11:34:35 UTC (rev 31628)
@@ -5,6 +5,8 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+
+import org.apache.log4j.Logger;
import org.eclipse.core.runtime.ILogListener;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
@@ -31,7 +33,7 @@
public static final String PATH_TO_SWT_BOT_PROPERTIES = "SWTBot.properties";
//$NON-NLS-1$
protected SWTJBTBot bot = new SWTJBTBot();
private static int sleepTime = 1000;
-
+ private Logger log = Logger.getLogger(JBTSWTBotTestCase.class);
/*
* (non-Javadoc) This static block read properties from
* org.jboss.tools.ui.bot.test/resources/SWTBot.properties file and set up
@@ -161,8 +163,13 @@
protected void tearDown() throws Exception {
Platform.removeLogListener(this);
deleteLog();
- if (getException() != null) {
- throw new Exception(getException());
+ Throwable e = getException();
+ if (e != null) {
+ log.error(e.getMessage(),e);
+ if (e.getCause() != null){
+ log.error(e.getCause().getMessage(),e.getCause());
+ }
+ throw new Exception(e);
}
}