summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-11-29 10:38:20 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-11-29 10:38:20 +0100
commit10c1a2fbbe0d35c49db2c96ca4e9c9fde6068e45 (patch)
tree91fac0f3e514f3e9ad652b728e56a06b0ef89604 /server
parentdc9c48fdc62fba5ca6d1f92e31c4b592611e1982 (diff)
downloadsonarqube-10c1a2fbbe0d35c49db2c96ca4e9c9fde6068e45.tar.gz
sonarqube-10c1a2fbbe0d35c49db2c96ca4e9c9fde6068e45.zip
CI error investigations - add logs to ServerTester
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java b/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java
index e7805b504a7..b9c3ae77f98 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java
@@ -20,10 +20,13 @@
package org.sonar.server.tester;
import com.google.common.base.Preconditions;
+import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.junit.rules.ExternalResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonar.api.database.DatabaseProperties;
import org.sonar.api.resources.Language;
import org.sonar.process.NetworkUtils;
@@ -52,6 +55,7 @@ import java.util.Properties;
*/
public class ServerTester extends ExternalResource {
+ private static final Logger LOG = LoggerFactory.getLogger(ServerTester.class);
private static final String PROP_PREFIX = "mediumTests.";
private final String clusterName;
@@ -113,9 +117,10 @@ public class ServerTester extends ExternalResource {
platform.init(properties);
platform.addComponents(components);
platform.doStart();
- } catch (RuntimeException e) {
+ } catch (Exception e) {
+ LOG.error("Fail to start ServerTester", e);
stop();
- throw e;
+ Throwables.propagate(e);
}
if (!platform.isStarted()) {
throw new IllegalStateException("Server not started. You should check that db migrations " +
@@ -152,7 +157,7 @@ public class ServerTester extends ExternalResource {
platform.doStop();
}
} catch (Exception e) {
- e.printStackTrace();
+ LOG.error("Fail to stop web server", e);
}
platform = null;
try {
@@ -160,7 +165,7 @@ public class ServerTester extends ExternalResource {
searchServer.stop();
}
} catch (Exception e) {
- e.printStackTrace();
+ LOG.error("Fail to stop elasticsearch server", e);
}
searchServer = null;
FileUtils.deleteQuietly(homeDir);