From: Eric Hartmann Date: Fri, 7 Jul 2017 08:30:36 +0000 (+0200) Subject: Fix ClusterSettingsLoopbackTest when no local network card X-Git-Tag: 6.5-RC1~54 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f6a0f6bb86f7d244bec0b6781020e2ea066124c6;p=sonarqube.git Fix ClusterSettingsLoopbackTest when no local network card --- diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/application/config/ClusterSettingsLoopbackTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/application/config/ClusterSettingsLoopbackTest.java index 0fd78038405..de28db4592c 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/application/config/ClusterSettingsLoopbackTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/application/config/ClusterSettingsLoopbackTest.java @@ -134,6 +134,10 @@ public class ClusterSettingsLoopbackTest { @FromDataPoints("key") Key propertyKey, @FromDataPoints("parameter") ValueAndResult valueAndResult) { // Skip the test if the value is a list and if the key is not accepting a list + if (settings == null) { + System.out.println("No network found, skipping the test"); + return; + } if ((valueAndResult.isList() && propertyKey.acceptList) || !valueAndResult.isList()) { settings.set(propertyKey.getKey(), valueAndResult.getValue()); @@ -157,11 +161,11 @@ public class ClusterSettingsLoopbackTest { } } if (localAddress == null) { - throw new RuntimeException("Cannot find a non loopback card required for tests"); + return null; } } catch (SocketException e) { - throw new RuntimeException("Cannot find a non loopback card required for tests"); + return null; } TestAppSettings testAppSettings = new TestAppSettings()