aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-05-19 18:39:59 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-05-20 08:58:19 +0200
commitf4dce455f68336247653f0a19b346dde105bce37 (patch)
tree81034e1d2d54c9b357b1471e1048d931bffc2eb2 /server/sonar-process
parenta115581c92934811bebe109b390f19bb819c2ac0 (diff)
downloadsonarqube-f4dce455f68336247653f0a19b346dde105bce37.tar.gz
sonarqube-f4dce455f68336247653f0a19b346dde105bce37.zip
fix quality flaws
Diffstat (limited to 'server/sonar-process')
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/DefaultProcessCommandsTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/DefaultProcessCommandsTest.java b/server/sonar-process/src/test/java/org/sonar/process/DefaultProcessCommandsTest.java
index 80d510be988..42679895aad 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/DefaultProcessCommandsTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/DefaultProcessCommandsTest.java
@@ -20,6 +20,7 @@
package org.sonar.process;
import java.io.File;
+import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.junit.Rule;
import org.junit.Test;
@@ -64,6 +65,25 @@ public class DefaultProcessCommandsTest {
}
@Test
+ public void reset_clears_only_the_memory_space_of_specified_process_number() throws IOException {
+ File dir = temp.newFolder();
+
+ AllProcessesCommands commands = new AllProcessesCommands(dir);
+ for (int i = 0; i < MAX_PROCESSES; i++) {
+ commands.setOperational(i);
+ commands.setUp(i);
+ }
+
+ int resetProcess = 3;
+ DefaultProcessCommands.reset(dir, resetProcess);
+ for (int i = 0; i < MAX_PROCESSES; i++) {
+ assertThat(commands.isOperational(i)).isEqualTo(i != resetProcess);
+ assertThat(commands.isUp(i)).isEqualTo(i != resetProcess);
+ }
+ commands.close();
+ }
+
+ @Test
public void ask_for_stop() throws Exception {
File dir = temp.newFolder();