Search in sources :

Example 1 with GlobalMode

use of org.sonar.scanner.bootstrap.GlobalMode in project sonarqube by SonarSource.

the class GlobalModeTest method testDefault.

@Test
public void testDefault() {
    GlobalMode mode = createMode(null, null);
    assertThat(mode.isPreview()).isFalse();
    assertThat(mode.isIssues()).isFalse();
    assertThat(mode.isPublish()).isTrue();
}
Also used : GlobalMode(org.sonar.scanner.bootstrap.GlobalMode) Test(org.junit.Test)

Example 2 with GlobalMode

use of org.sonar.scanner.bootstrap.GlobalMode in project sonarqube by SonarSource.

the class GlobalModeTest method testIssuesMode.

@Test
public void testIssuesMode() {
    GlobalMode mode = createMode(CoreProperties.ANALYSIS_MODE, CoreProperties.ANALYSIS_MODE_ISSUES);
    assertThat(mode.isPreview()).isFalse();
    assertThat(mode.isIssues()).isTrue();
    assertThat(mode.isPublish()).isFalse();
}
Also used : GlobalMode(org.sonar.scanner.bootstrap.GlobalMode) Test(org.junit.Test)

Example 3 with GlobalMode

use of org.sonar.scanner.bootstrap.GlobalMode in project sonarqube by SonarSource.

the class GlobalModeTest method testOtherProperty.

@Test
public void testOtherProperty() {
    GlobalMode mode = createMode(CoreProperties.ANALYSIS_MODE, CoreProperties.ANALYSIS_MODE_PUBLISH);
    assertThat(mode.isPreview()).isFalse();
    assertThat(mode.isIssues()).isFalse();
    assertThat(mode.isPublish()).isTrue();
}
Also used : GlobalMode(org.sonar.scanner.bootstrap.GlobalMode) Test(org.junit.Test)

Example 4 with GlobalMode

use of org.sonar.scanner.bootstrap.GlobalMode in project sonarqube by SonarSource.

the class GlobalModeTest method createMode.

private GlobalMode createMode(String key, String value) {
    Map<String, String> map = new HashMap<>();
    if (key != null) {
        map.put(key, value);
    }
    GlobalProperties props = new GlobalProperties(map);
    return new GlobalMode(props);
}
Also used : GlobalProperties(org.sonar.scanner.bootstrap.GlobalProperties) HashMap(java.util.HashMap) GlobalMode(org.sonar.scanner.bootstrap.GlobalMode)

Example 5 with GlobalMode

use of org.sonar.scanner.bootstrap.GlobalMode in project sonarqube by SonarSource.

the class ProjectSettingsTest method prepare.

@Before
public void prepare() {
    emptyFileData = ImmutableTable.of();
    emptySettings = ImmutableTable.of();
    project = ProjectDefinition.create().setKey("struts");
    globalMode = mock(GlobalMode.class);
    mode = mock(DefaultAnalysisMode.class);
    bootstrapProps = new GlobalSettings(new GlobalProperties(Collections.<String, String>emptyMap()), new PropertyDefinitions(), mock(SettingsLoader.class), globalMode);
}
Also used : GlobalProperties(org.sonar.scanner.bootstrap.GlobalProperties) PropertyDefinitions(org.sonar.api.config.PropertyDefinitions) GlobalMode(org.sonar.scanner.bootstrap.GlobalMode) GlobalSettings(org.sonar.scanner.bootstrap.GlobalSettings) DefaultAnalysisMode(org.sonar.scanner.analysis.DefaultAnalysisMode) Before(org.junit.Before)

Aggregations

GlobalMode (org.sonar.scanner.bootstrap.GlobalMode)6 Test (org.junit.Test)4 GlobalProperties (org.sonar.scanner.bootstrap.GlobalProperties)2 HashMap (java.util.HashMap)1 Before (org.junit.Before)1 PropertyDefinitions (org.sonar.api.config.PropertyDefinitions)1 DefaultAnalysisMode (org.sonar.scanner.analysis.DefaultAnalysisMode)1 GlobalSettings (org.sonar.scanner.bootstrap.GlobalSettings)1