From 0cc7aa3e7a4f3e8a3838bbbfb970aeb4775c4e9d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 29 May 2015 11:25:01 +0200 Subject: Extract an interface from org.sonar.process.ProcessCommands Try to stabilize StopWatcherTest when machine is slow or under pressure. More than 1 second could be spent in the creation of ProcessCommands mock. --- sonar-application/src/main/java/org/sonar/application/App.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sonar-application') diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index 26130401dac..9547d505895 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -21,6 +21,7 @@ package org.sonar.application; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; +import org.sonar.process.DefaultProcessCommands; import org.sonar.process.MinimumViableSystem; import org.sonar.process.ProcessCommands; import org.sonar.process.ProcessProperties; @@ -54,7 +55,7 @@ public class App implements Stoppable { public void start(Props props) { if (props.valueAsBoolean(ProcessProperties.ENABLE_STOP_COMMAND, false)) { File tempDir = props.nonNullValueAsFile(ProcessProperties.PATH_TEMP); - ProcessCommands commands = new ProcessCommands(tempDir, 0); + ProcessCommands commands = new DefaultProcessCommands(tempDir, 0); stopWatcher = new StopWatcher(commands, this); stopWatcher.start(); } -- cgit v1.2.3