Package org.sonar.server.db

Examples of org.sonar.server.db.DbClient


  @Before
  public void setUp() throws Exception {
    when(system2.now()).thenReturn(DateUtils.parseDate("2014-03-13").getTime());
    dao = new ActivityDao(system2);
    dbClient = new DbClient(db.database(), db.myBatis(), dao);
    migration = new ChangeLogMigration(dao, dbClient);
    session = dbClient.openSession(false);
  }
View Full Code Here


  @Before
  public void setUp() throws Exception {
    db.executeUpdateSql("truncate table active_rule_changes");
    db.executeUpdateSql("truncate table active_rule_param_changes");
    DbClient dbClient = new DbClient(db.database(), db.myBatis());
    System2 system = mock(System2.class);
    when(system.now()).thenReturn(UtcDateUtils.parseDateTime("2014-07-03T12:00:00+0000").getTime());
    migration = new FeedQProfileDatesMigration(dbClient, system);
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    db.executeUpdateSql("truncate table rules");
    db.executeUpdateSql("truncate table rules_parameters");
    DbClient dbClient = new DbClient(db.database(), db.myBatis());
    migration = new AddMissingCustomRuleParametersMigration(dbClient, system);
    when(system.now()).thenReturn(DateUtils.parseDate("2014-10-09").getTime());
  }
View Full Code Here

  DatabaseMigration migration;

  @Before
  public void setUp() throws Exception {
    DbClient dbClient = new DbClient(db.database(), db.myBatis());
    migration = new DeleteMeasuresOnDeletedProfilesMigration(dbClient);
  }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    db.executeUpdateSql("truncate table projects");
    db.executeUpdateSql("truncate table snapshots");
    dbClient = new DbClient(db.database(), db.myBatis());
    session = dbClient.openSession(false);
    mapper = session.getMapper(Migration50Mapper.class);
    migration = new PopulateProjectsUuidColumnsMigration(dbClient);
  }
View Full Code Here

  ConvertProfileMeasuresMigration migration;

  @Before
  public void setUp() throws Exception {
    DbClient dbClient = new DbClient(db.database(), db.myBatis());
    migration = new ConvertProfileMeasuresMigration(dbClient);
  }
View Full Code Here

  ComponentDto project;

  @Before
  public void setUp() throws Exception {
    DbClient dbClient = mock(DbClient.class);
    when(dbClient.openSession(false)).thenReturn(session);
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.resourceDao()).thenReturn(resourceDao);
    when(dbClient.propertiesDao()).thenReturn(propertiesDao);
    when(dbClient.measureDao()).thenReturn(measureDao);

    project = ComponentTesting.newProjectDto()
      .setId(1L)
      .setName("SonarQube")
      .setLongName("SonarQube")
View Full Code Here

  public void before() {
    system = mock(System2.class);
    when(system.now()).thenReturn(DATE1.getTime());
    RuleDao ruleDao = new RuleDao(system);
    ActiveRuleDao activeRuleDao = new ActiveRuleDao(new QualityProfileDao(getMyBatis(), system), ruleDao, system);
    dbClient = new DbClient(getDatabase(), getMyBatis(), ruleDao, activeRuleDao,
      new QualityProfileDao(getMyBatis(), system), new CharacteristicDao(getMyBatis()));
    dbSession = dbClient.openSession(false);
  }
View Full Code Here

  CopyRequirementsFromCharacteristicsToRules service;

  @Before
  public void setUp() throws Exception {
    when(system2.now()).thenReturn(DateUtils.parseDate("2014-03-13").getTime());
    dbClient = new DbClient(db.database(), db.myBatis(), new RuleDao(system2), new LoadedTemplateDao(db.myBatis()));
    service = new CopyRequirementsFromCharacteristicsToRules(dbClient, null);
  }
View Full Code Here

  WsTester tester;

  @Before
  public void setUp() throws Exception {
    DbClient dbClient = mock(DbClient.class);
    when(dbClient.openSession(false)).thenReturn(session);
    when(dbClient.metricDao()).thenReturn(metricDao);

    tester = new WsTester(new BatchWs(mock(BatchIndex.class), new GlobalReferentialsAction(dbClient, propertiesDao), mock(ProjectReferentialsAction.class), mock(UploadReportAction.class)));
  }
View Full Code Here

TOP

Related Classes of org.sonar.server.db.DbClient

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.