Search in sources :

Example 11 with MySql

use of org.sonar.db.dialect.MySql in project sonarqube by SonarSource.

the class GlobalActionTest method test_example_response.

@Test
public void test_example_response() throws Exception {
    init(createPages(), new ResourceTypeTree[] { ResourceTypeTree.builder().addType(ResourceType.builder("POL").build()).addType(ResourceType.builder("LOP").build()).addRelations("POL", "LOP").build(), ResourceTypeTree.builder().addType(ResourceType.builder("PAL").build()).addType(ResourceType.builder("LAP").build()).addRelations("PAL", "LAP").build() });
    settings.setProperty("sonar.lf.logoUrl", "http://example.com/my-custom-logo.png");
    settings.setProperty("sonar.lf.logoWidthPx", 135);
    settings.setProperty("sonar.lf.gravatarServerUrl", "http://some-server.tld/logo.png");
    settings.setProperty("sonar.lf.enableGravatar", true);
    settings.setProperty("sonar.updatecenter.activate", false);
    settings.setProperty("sonar.technicalDebt.ratingGrid", "0.05,0.1,0.2,0.5");
    when(server.getVersion()).thenReturn("6.2");
    when(dbClient.getDatabase().getDialect()).thenReturn(new MySql());
    String result = call();
    assertJson(ws.getDef().responseExampleAsString()).isSimilarTo(result);
}
Also used : MySql(org.sonar.db.dialect.MySql) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Example 12 with MySql

use of org.sonar.db.dialect.MySql in project sonarqube by SonarSource.

the class GlobalActionTest method return_if_production_database_or_not.

@Test
public void return_if_production_database_or_not() throws Exception {
    init();
    when(dbClient.getDatabase().getDialect()).thenReturn(new MySql());
    executeAndVerify("production_database.json");
}
Also used : MySql(org.sonar.db.dialect.MySql) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 MySql (org.sonar.db.dialect.MySql)12 H2 (org.sonar.db.dialect.H2)7 MsSql (org.sonar.db.dialect.MsSql)7 Oracle (org.sonar.db.dialect.Oracle)7 PostgreSql (org.sonar.db.dialect.PostgreSql)7 SQLException (java.sql.SQLException)1 Matchers.anyString (org.mockito.Matchers.anyString)1