diff options
author | David Gageot <david@gageot.net> | 2012-10-18 17:47:19 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-23 11:48:21 +0200 |
commit | a505a98b4d1ad33c80b939ae6fed12043e635ded (patch) | |
tree | 939b5de8fce6a3f5e3ad150c3ca814c429d462b6 /sonar-batch/src/test | |
parent | 9f509a9600f0dafb62d8c9787d94a910762de385 (diff) | |
download | sonarqube-a505a98b4d1ad33c80b939ae6fed12043e635ded.tar.gz sonarqube-a505a98b4d1ad33c80b939ae6fed12043e635ded.zip |
SONAR-3895 Local mode
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/bootstrap/LocalModeTest.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/LocalModeTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/LocalModeTest.java new file mode 100644 index 00000000000..e409d67c9e5 --- /dev/null +++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/LocalModeTest.java @@ -0,0 +1,47 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2012 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.batch.bootstrap; + +import org.junit.Test; +import org.sonar.api.config.Settings; + +import static org.fest.assertions.Assertions.assertThat; + +public class LocalModeTest { + Settings settings = new Settings(); + + @Test + public void should_be_disabled() { + LocalMode localMode = new LocalMode(settings); + localMode.start(); + + assertThat(localMode.isEnabled()).isFalse(); + } + + @Test + public void should_enable() { + settings.setProperty("sonar.local", "true"); + + LocalMode localMode = new LocalMode(settings); + localMode.start(); + + assertThat(localMode.isEnabled()).isTrue(); + } +} |