Package org.sonar.core.persistence

Examples of org.sonar.core.persistence.Database


public class DatabaseCheckerTest {

  @Test
  public void require_oracle_11_2() throws Exception {
    Database db = mockDb(new Oracle(), "11.2.0.0.1");
    new DatabaseChecker(db).start();
    // no error

    db = mockDb(new Oracle(), "11.3.1");
    new DatabaseChecker(db).start();
View Full Code Here


    }
  }

  @Test
  public void log_warning_if_h2() throws Exception {
    Database db = mockDb(new H2(), "13.4");
    DatabaseChecker checker = new DatabaseChecker(db);
    checker.start();
    checker.stop();
    // TODO test log
  }
View Full Code Here

    // TODO test log
  }

  @Test
  public void do_not_fail_if_mysql() throws Exception {
    Database db = mockDb(new MySql(), "5.7");
    new DatabaseChecker(db).start();
    // no error
  }
View Full Code Here

    new DatabaseChecker(db).start();
    // no error
  }

  private Database mockDb(Dialect dialect, String driverVersion) throws SQLException {
    Database db = mock(Database.class, Mockito.RETURNS_DEEP_STUBS);
    when(db.getDialect()).thenReturn(dialect);
    when(db.getDataSource().getConnection().getMetaData().getDriverVersion()).thenReturn(driverVersion);
    return db;
  }
View Full Code Here

TOP

Related Classes of org.sonar.core.persistence.Database

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.