@Before
  public void before() {
    tester.clearDbAndIndexes();
    db = tester.get(DbClient.class);
    dbSession = db.openSession(false);
    ruleActivator = tester.get(RuleActivator.class);
    index = tester.get(ActiveRuleIndex.class);
    copier = tester.get(QProfileCopier.class);

    // create pre-defined rules
    RuleDto xooRule1 = RuleTesting.newXooX1().setSeverity("MINOR");
    RuleDto xooRule2 = RuleTesting.newXooX2().setSeverity("MAJOR");
    db.deprecatedRuleDao().insert(dbSession, xooRule1, xooRule2);
    db.deprecatedRuleDao()
        .insertRuleParam(
            dbSession,
            xooRule1,
            RuleParamDto.createFor(xooRule1)
                .setName("max")
                .setDefaultValue("10")
                .setType(RuleParamType.INTEGER.type()));

    // create pre-defined profile
    db.qualityProfileDao().insert(dbSession, QProfileTesting.newXooP1());
    dbSession.commit();
    dbSession.clearCache();
  }
 @Before
 public void before() {
   tester.clearDbAndIndexes();
   db = tester.get(DbClient.class);
   dbSession = db.openSession(false);
   index = tester.get(IndexClient.class);
   factory = tester.get(QProfileFactory.class);
 }
 @Before
 public void setUp() {
   tester.clearDbAndIndexes();
   wsTester = tester.get(WsTester.class);
   ruleService = tester.get(RuleService.class);
   ruleDao = tester.get(RuleDao.class);
   session = tester.get(DbClient.class).openSession(false);
 }
  @Before
  public void setUp() {
    tester.clearDbAndIndexes();
    db = tester.get(DbClient.class);
    ws = tester.get(QProfilesWs.class);
    wsTester = tester.get(WsTester.class);
    session = db.openSession(false);

    ruIndexer = tester.get(RuleIndexer.class);
    ruIndexer.setEnabled(true);
    activeRuIndexer = tester.get(ActiveRuleIndexer.class);
    activeRuIndexer.setEnabled(true);
  }
  @Before
  public void before() {
    tester.clearDbAndIndexes();
    rulesDefinition.includeX1 = true;
    rulesDefinition.includeX1bis = false;
    rulesDefinition.includeX2 = true;
    rulesDefinition.includeTemplate1 = true;
    rulesDefinition.includeRuleLinkedToRootCharacteristic = false;
    tester.get(Platform.class).executeStartupTasks();
    db = tester.get(DbClient.class);
    dbSession = tester.get(DbClient.class).openSession(false);
    dbSession.clearCache();

    index = tester.get(RuleIndex.class);
  }
  @Before
  public void before() {
    tester.clearDbAndIndexes();
    db = tester.get(DbClient.class);
    dbSession = db.openSession(false);
    service = tester.get(QProfileService.class);
    loader = tester.get(QProfileLoader.class);
    activator = tester.get(RuleActivator.class);

    // create pre-defined rules
    RuleDto xooRule1 = RuleTesting.newXooX1().setSeverity("MINOR");
    db.ruleDao().insert(dbSession, xooRule1);

    // create pre-defined profiles P1 and P2
    db.qualityProfileDao()
        .insert(dbSession, QProfileTesting.newXooP1(), QProfileTesting.newXooP2());
    dbSession.commit();
    dbSession.clearCache();
  }
 @Before
 public void setUp() {
   tester.clearDbAndIndexes();
   ws = tester.get(ActivitiesWs.class);
   service = tester.get(ActivityService.class);
 }
예제 #8
0
 @Before
 public void before() {
   tester.clearDbAndIndexes();
   db = tester.get(DbClient.class);
   dbSession = db.openSession(false);
 }
예제 #9
0
 @Before
 public void before() {
   tester.clearDbAndIndexes();
   dbSession = db.openSession(false);
 }
 @Before
 public void setUp() {
   tester.clearDbAndIndexes();
   sut = tester.get(HistoryAction.class);
   activityService = tester.get(ActivityService.class);
 }