Tabnine Logo
Dialect.supportsMigration
Code IndexAdd Tabnine to your IDE (free)

How to use
supportsMigration
method
in
org.sonar.db.dialect.Dialect

Best Java code snippets using org.sonar.db.dialect.Dialect.supportsMigration (Showing top 18 results out of 315)

origin: SonarSource/sonarqube

@Test
public void verify_example() throws Exception {
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(RUNNING);
 when(migrationState.getStartedAt()).thenReturn(DateUtils.parseDateTime("2015-02-23T18:54:23+0100"));
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(getClass().getResource("example-migrate_db.json"));
}
origin: SonarSource/sonarqube

@Test
public void verify_example() throws Exception {
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(RUNNING);
 when(migrationState.getStartedAt()).thenReturn(DateUtils.parseDateTime("2015-02-23T18:54:23+0100"));
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(getClass().getResource("example-migrate_db.json"));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_and_msg_includes_error_when_dbmigration_status_is_FAILED(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(FAILED);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 when(migrationState.getError()).thenReturn(new UnsupportedOperationException(SOME_THROWABLE_MSG));
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_FAILED, failedMsg(SOME_THROWABLE_MSG), SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_and_msg_has_default_msg_when_dbmigration_status_is_SUCCEEDED(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(SUCCEEDED);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_SUCCEEDED, MESSAGE_STATUS_SUCCEEDED, SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_and_msg_has_default_msg_when_dbmigration_status_is_FAILED(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(FAILED);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 when(migrationState.getError()).thenReturn(null); // no failure throwable caught
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_FAILED, failedMsg(DEFAULT_ERROR_MSG), SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_when_dbmigration_status_is_RUNNING(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(RUNNING);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_RUNNING, MESSAGE_STATUS_RUNNING, SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_and_msg_includes_error_when_dbmigration_status_is_FAILED(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(FAILED);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 when(migrationState.getError()).thenReturn(new UnsupportedOperationException(SOME_THROWABLE_MSG));
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_FAILED, failedMsg(SOME_THROWABLE_MSG), SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void start_migration_and_return_state_from_databasemigration_when_dbmigration_status_is_NONE(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(NONE);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_REQUIRED, MESSAGE_MIGRATION_REQUIRED));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_when_dbmigration_status_is_RUNNING(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(RUNNING);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_RUNNING, MESSAGE_STATUS_RUNNING, SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_and_msg_has_default_msg_when_dbmigration_status_is_SUCCEEDED(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(SUCCEEDED);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_SUCCEEDED, MESSAGE_STATUS_SUCCEEDED, SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void start_migration_and_return_state_from_databasemigration_when_dbmigration_status_is_NONE(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(NONE);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 underTest.handle(request, response);
 verify(databaseMigration).startIt();
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_RUNNING, MESSAGE_STATUS_RUNNING, SOME_DATE));
}
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_from_database_migration_and_msg_has_default_msg_when_dbmigration_status_is_FAILED(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(true);
 when(migrationState.getStatus()).thenReturn(FAILED);
 when(migrationState.getStartedAt()).thenReturn(SOME_DATE);
 when(migrationState.getError()).thenReturn(null); // no failure throwable caught
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_MIGRATION_FAILED, failedMsg(DEFAULT_ERROR_MSG), SOME_DATE));
}
origin: SonarSource/sonarqube

if (status == DatabaseVersion.Status.UP_TO_DATE || status == DatabaseVersion.Status.REQUIRES_DOWNGRADE) {
 write(json, databaseMigrationState);
} else if (!database.getDialect().supportsMigration()) {
 writeNotSupportedResponse(json);
} else {
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_is_NONE_with_specific_msg_when_db_requires_upgrade_but_dialect_does_not_support_migration(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(false);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_NOT_SUPPORTED, MESSAGE_NO_MIGRATION_ON_EMBEDDED_DATABASE));
}
origin: SonarSource/sonarqube

if (status == DatabaseVersion.Status.UP_TO_DATE || status == DatabaseVersion.Status.REQUIRES_DOWNGRADE) {
 write(json, migrationState);
} else if (!database.getDialect().supportsMigration()) {
 writeNotSupportedResponse(json);
} else {
origin: SonarSource/sonarqube

@Test
@UseDataProvider("statusRequiringDbMigration")
public void state_is_NONE_with_specific_msg_when_db_requires_upgrade_but_dialect_does_not_support_migration(DatabaseVersion.Status status) throws Exception {
 when(databaseVersion.getStatus()).thenReturn(status);
 when(dialect.supportsMigration()).thenReturn(false);
 underTest.handle(request, response);
 assertJson(response.outputAsString()).isSimilarTo(expectedResponse(STATUS_NOT_SUPPORTED, MESSAGE_NO_MIGRATION_ON_EMBEDDED_DATABASE));
}
origin: org.sonarsource.sonarqube/sonar-server

if (status == DatabaseVersion.Status.UP_TO_DATE || status == DatabaseVersion.Status.REQUIRES_DOWNGRADE) {
 write(json, databaseMigrationState);
} else if (!database.getDialect().supportsMigration()) {
 writeNotSupportedResponse(json);
} else {
origin: org.sonarsource.sonarqube/sonar-server

if (status == DatabaseVersion.Status.UP_TO_DATE || status == DatabaseVersion.Status.REQUIRES_DOWNGRADE) {
 write(json, migrationState);
} else if (!database.getDialect().supportsMigration()) {
 writeNotSupportedResponse(json);
} else {
org.sonar.db.dialectDialectsupportsMigration

Javadoc

Indicates whether DB migration can be perform on the DB vendor implementation associated with the current dialect.

Popular methods of Dialect

  • getId
  • getFalseSqlValue
  • getScrollDefaultFetchSize
    Fetch size to be used when scrolling large result sets.
  • getTrueSqlValue
  • getConnectionInitStatements
  • getDefaultDriverClassName
  • getValidationQuery
    Query used to validate the jdbc connection.
  • getScrollSingleRowFetchSize
    Fetch size to scroll one row at a time. It sounds strange because obviously value is 1 in most cases
  • init
    This method is called when connecting for the first time to the database.
  • matchesJdbcUrl
    Used to autodetect dialect from connection URL
  • supportsUpsert
  • getSqlFromDual
  • supportsUpsert,
  • getSqlFromDual,
  • matchesJdbcURL

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now