Search in sources :

Example 16 with H2

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

the class DropIndexBuilderTest method throw_NPE_if_table_name_is_missing.

@Test
public void throw_NPE_if_table_name_is_missing() {
    expectedException.expect(NullPointerException.class);
    expectedException.expectMessage("Table name cannot be null");
    new DropIndexBuilder(new H2()).setName("issues_key").build();
}
Also used : H2(org.sonar.db.dialect.H2) Test(org.junit.Test)

Example 17 with H2

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

the class DropIndexBuilderTest method throw_NPE_if_index_name_is_missing.

@Test
public void throw_NPE_if_index_name_is_missing() {
    expectedException.expect(NullPointerException.class);
    expectedException.expectMessage("Index name cannot be null");
    new DropIndexBuilder(new H2()).setTable("issues").build();
}
Also used : H2(org.sonar.db.dialect.H2) Test(org.junit.Test)

Example 18 with H2

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

the class AddUniqueIndexOnUuidOfSnapshotsTest method create_unique_index.

@Test
public void create_unique_index() throws Exception {
    when(db.getDialect()).thenReturn(new H2());
    AddUniqueIndexOnUuidOfSnapshots underTest = new AddUniqueIndexOnUuidOfSnapshots(db);
    underTest.execute(context);
    verify(context).execute(asList("CREATE UNIQUE INDEX analyses_uuid ON snapshots (uuid)"));
    verifyNoMoreInteractions(context);
}
Also used : H2(org.sonar.db.dialect.H2) Test(org.junit.Test)

Aggregations

H2 (org.sonar.db.dialect.H2)18 Test (org.junit.Test)17 MsSql (org.sonar.db.dialect.MsSql)7 MySql (org.sonar.db.dialect.MySql)7 Oracle (org.sonar.db.dialect.Oracle)7 PostgreSql (org.sonar.db.dialect.PostgreSql)7 ResourceTypes (org.sonar.api.resources.ResourceTypes)1 Page (org.sonar.api.web.page.Page)1 PluginRepository (org.sonar.core.platform.PluginRepository)1 BooleanColumnDef (org.sonar.server.platform.db.migration.def.BooleanColumnDef)1 PageRepository (org.sonar.server.ui.PageRepository)1 WsActionTester (org.sonar.server.ws.WsActionTester)1