use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class NewIndexTest method five_shards_and_one_replica_by_default_on_cluster.
@Test
public void five_shards_and_one_replica_by_default_on_cluster() {
NewIndex index = new NewIndex("issues");
MapSettings settings = new MapSettings();
settings.setProperty(ProcessProperties.CLUSTER_ENABLED, "true");
index.configureShards(settings, 5);
assertThat(index.getSettings().get(IndexMetaData.SETTING_NUMBER_OF_SHARDS)).isEqualTo("5");
assertThat(index.getSettings().get(IndexMetaData.SETTING_NUMBER_OF_REPLICAS)).isEqualTo("1");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class IssueIndexDefinitionTest method define.
@Test
public void define() {
IssueIndexDefinition def = new IssueIndexDefinition(new MapSettings());
def.define(underTest);
assertThat(underTest.getIndices()).hasSize(1);
NewIndex issuesIndex = underTest.getIndices().get("issues");
assertThat(issuesIndex).isNotNull();
assertThat(issuesIndex.getTypes().keySet()).containsOnly("issue", "authorization");
// no cluster by default
assertThat(issuesIndex.getSettings().get("index.number_of_shards")).isEqualTo("5");
assertThat(issuesIndex.getSettings().get("index.number_of_replicas")).isEqualTo("0");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class EmbeddedDatabaseTest method start_creates_db_with_specified_user_and_password.
@Test
public void start_creates_db_with_specified_user_and_password() throws IOException {
int port = NetworkUtils.freePort();
underTest = new EmbeddedDatabase(new MapSettings().setProperty(PATH_DATA, temporaryFolder.newFolder().getAbsolutePath()).setProperty(PROP_URL, "jdbc url").setProperty(PROP_EMBEDDED_PORT, "" + port).setProperty(PROP_USER, "foo").setProperty(PROP_PASSWORD, "bar"));
underTest.start();
checkDbIsUp(port, "foo", "bar");
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class FakeAuthenticatorTest method setUp.
@Before
public void setUp() {
settings = new MapSettings();
authenticator = new FakeAuthenticator(settings);
authenticator.init();
}
use of org.sonar.api.config.MapSettings in project sonarqube by SonarSource.
the class XooTokenizerTest method prepare.
@Before
public void prepare() throws IOException {
baseDir = temp.newFolder();
fileSystem = new DefaultFileSystem(baseDir.toPath());
when(context.fileSystem()).thenReturn(fileSystem);
settings = new MapSettings();
when(context.settings()).thenReturn(settings);
}
Aggregations