use of org.sonar.server.qualityprofile.index.ActiveRuleIndexer in project sonarqube by SonarSource.
the class QProfileBackuperMediumTest method before.
@Before
public void before() {
tester.clearDbAndIndexes();
db = tester.get(DbClient.class);
dbSession = db.openSession(false);
ruleIndexer = tester.get(RuleIndexer.class);
activeRuleIndexer = tester.get(ActiveRuleIndexer.class);
// create pre-defined rules
RuleDto xooRule1 = newXooX1().setSeverity("MINOR").setLanguage("xoo");
RuleDto xooRule2 = newXooX2().setSeverity("MAJOR").setLanguage("xoo");
db.ruleDao().insert(dbSession, xooRule1);
db.ruleDao().insert(dbSession, xooRule2);
db.ruleDao().insertRuleParam(dbSession, xooRule1, RuleParamDto.createFor(xooRule1).setName("max").setDefaultValue("10").setType(RuleParamType.INTEGER.type()));
dbSession.commit();
dbSession.clearCache();
ruleIndexer.index();
}
use of org.sonar.server.qualityprofile.index.ActiveRuleIndexer in project sonarqube by SonarSource.
the class InheritanceActionMediumTest method setUp.
@Before
public void setUp() {
tester.clearDbAndIndexes();
db = tester.get(DbClient.class);
session = db.openSession(false);
ruleIndexer = tester.get(RuleIndexer.class);
activeRuleIndexer = tester.get(ActiveRuleIndexer.class);
wsTester = new WsTester(tester.get(QProfilesWs.class));
}
use of org.sonar.server.qualityprofile.index.ActiveRuleIndexer in project sonarqube by SonarSource.
the class RegisterRulesTest method before.
@Before
public void before() {
ruleIndexer = new RuleIndexer(es.client(), dbClient);
ruleIndex = new RuleIndex(es.client(), system);
activeRuleIndexer = new ActiveRuleIndexer(dbClient, es.client());
}
use of org.sonar.server.qualityprofile.index.ActiveRuleIndexer in project sonarqube by SonarSource.
the class ChangeParentActionTest method setUp.
@Before
public void setUp() {
dbClient = db.getDbClient();
dbSession = db.getSession();
EsClient esClient = es.client();
ruleIndex = new RuleIndex(esClient, System2.INSTANCE);
ruleIndexer = new RuleIndexer(esClient, dbClient);
activeRuleIndexer = new ActiveRuleIndexer(dbClient, esClient);
TypeValidations typeValidations = new TypeValidations(Collections.emptyList());
RuleActivator ruleActivator = new RuleActivator(System2.INSTANCE, dbClient, typeValidations, userSession);
qProfileTree = new QProfileTreeImpl(dbClient, ruleActivator, System2.INSTANCE, activeRuleIndexer, mock(QualityProfileChangeEventService.class));
ChangeParentAction underTest = new ChangeParentAction(dbClient, qProfileTree, new Languages(), new QProfileWsSupport(dbClient, userSession), userSession);
ws = new WsActionTester(underTest);
userSession.logIn().addPermission(ADMINISTER_QUALITY_PROFILES);
}
Aggregations