use of org.sonar.server.issue.index.IssueIndexer in project sonarqube by SonarSource.
the class SearchActionMediumTest method paging_with_page_size_to_minus_one.
@Test
public void paging_with_page_size_to_minus_one() throws Exception {
RuleDto rule = newRule();
ComponentDto project = insertComponent(ComponentTesting.newProjectDto(otherOrganization2, "PROJECT_ID").setKey("PROJECT_KEY"));
setDefaultProjectPermission(project);
ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, null, "FILE_ID").setKey("FILE_KEY"));
for (int i = 0; i < 12; i++) {
IssueDto issue = IssueTesting.newDto(rule, file, project);
tester.get(IssueDao.class).insert(session, issue);
}
session.commit();
IssueIndexer r = tester.get(IssueIndexer.class);
r.indexOnStartup(r.getIndexTypes());
WsTester.TestRequest request = wsTester.newGetRequest(CONTROLLER_ISSUES, ACTION_SEARCH);
request.setParam(WebService.Param.PAGE, "1");
request.setParam(WebService.Param.PAGE_SIZE, "-1");
WsTester.Result result = request.execute();
result.assertJson(this.getClass(), "paging_with_page_size_to_minus_one.json");
}
use of org.sonar.server.issue.index.IssueIndexer in project sonarqube by SonarSource.
the class SearchActionMediumTest method display_facets.
@Test
public void display_facets() throws Exception {
ComponentDto project = insertComponent(ComponentTesting.newProjectDto(otherOrganization1, "PROJECT_ID").setKey("PROJECT_KEY"));
setDefaultProjectPermission(project);
ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, null, "FILE_ID").setKey("FILE_KEY"));
IssueDto issue = IssueTesting.newDto(newRule(), file, project).setIssueCreationDate(DateUtils.parseDate("2014-09-04")).setIssueUpdateDate(DateUtils.parseDate("2017-12-04")).setEffort(10L).setStatus("OPEN").setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2").setSeverity("MAJOR");
db.issueDao().insert(session, issue);
session.commit();
IssueIndexer r = tester.get(IssueIndexer.class);
r.indexOnStartup(r.getIndexTypes());
userSessionRule.logIn("john");
WsTester.Result result = wsTester.newGetRequest(CONTROLLER_ISSUES, ACTION_SEARCH).setParam("resolved", "false").setParam(WebService.Param.FACETS, "statuses,severities,resolutions,projectUuids,rules,fileUuids,assignees,languages,actionPlans,types").execute();
result.assertJson(this.getClass(), "display_facets.json");
}
use of org.sonar.server.issue.index.IssueIndexer in project sonarqube by SonarSource.
the class SearchActionMediumTest method display_facets_in_effort_mode.
@Test
public void display_facets_in_effort_mode() throws Exception {
ComponentDto project = insertComponent(ComponentTesting.newProjectDto(otherOrganization2, "PROJECT_ID").setKey("PROJECT_KEY"));
setDefaultProjectPermission(project);
ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, null, "FILE_ID").setKey("FILE_KEY"));
IssueDto issue = IssueTesting.newDto(newRule(), file, project).setIssueCreationDate(DateUtils.parseDate("2014-09-04")).setIssueUpdateDate(DateUtils.parseDate("2017-12-04")).setEffort(10L).setStatus("OPEN").setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2").setSeverity("MAJOR");
db.issueDao().insert(session, issue);
session.commit();
IssueIndexer r = tester.get(IssueIndexer.class);
r.indexOnStartup(r.getIndexTypes());
userSessionRule.logIn("john");
WsTester.Result result = wsTester.newGetRequest(CONTROLLER_ISSUES, ACTION_SEARCH).setParam("resolved", "false").setParam(WebService.Param.FACETS, "statuses,severities,resolutions,projectUuids,rules,fileUuids,assignees,languages,actionPlans").setParam("facetMode", FACET_MODE_EFFORT).execute();
result.assertJson(this.getClass(), "display_facets_effort.json");
}
use of org.sonar.server.issue.index.IssueIndexer in project sonarqube by SonarSource.
the class SearchActionMediumTest method filter_by_assigned_to_me_unauthenticated.
@Test
public void filter_by_assigned_to_me_unauthenticated() throws Exception {
userSessionRule.logIn();
ComponentDto project = insertComponent(ComponentTesting.newProjectDto(otherOrganization1, "PROJECT_ID").setKey("PROJECT_KEY"));
setDefaultProjectPermission(project);
ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, null, "FILE_ID").setKey("FILE_KEY"));
RuleDto rule = newRule();
IssueDto issue1 = IssueTesting.newDto(rule, file, project).setStatus("OPEN").setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2").setAssignee("john");
IssueDto issue2 = IssueTesting.newDto(rule, file, project).setStatus("OPEN").setKee("7b112bd4-b650-4037-80bc-82fd47d4eac2").setAssignee("alice");
IssueDto issue3 = IssueTesting.newDto(rule, file, project).setStatus("OPEN").setKee("82fd47d4-4037-b650-80bc-7b112bd4eac2");
db.issueDao().insert(session, issue1, issue2, issue3);
session.commit();
IssueIndexer r = tester.get(IssueIndexer.class);
r.indexOnStartup(r.getIndexTypes());
wsTester.newGetRequest(CONTROLLER_ISSUES, ACTION_SEARCH).setParam("resolved", "false").setParam("assignees", "__me__").execute().assertJson(this.getClass(), "empty_result.json");
}
use of org.sonar.server.issue.index.IssueIndexer in project sonarqube by SonarSource.
the class SearchActionMediumTest method display_deprecated_debt_fields.
@Test
public void display_deprecated_debt_fields() throws Exception {
ComponentDto project = insertComponent(ComponentTesting.newProjectDto(otherOrganization1, "PROJECT_ID").setKey("PROJECT_KEY"));
setDefaultProjectPermission(project);
ComponentDto file = insertComponent(ComponentTesting.newFileDto(project, null, "FILE_ID").setKey("FILE_KEY"));
IssueDto issue = IssueTesting.newDto(newRule(), file, project).setIssueCreationDate(DateUtils.parseDate("2014-09-04")).setIssueUpdateDate(DateUtils.parseDate("2017-12-04")).setEffort(10L).setStatus("OPEN").setKee("82fd47d4-b650-4037-80bc-7b112bd4eac2").setSeverity("MAJOR");
db.issueDao().insert(session, issue);
session.commit();
IssueIndexer r = tester.get(IssueIndexer.class);
r.indexOnStartup(r.getIndexTypes());
userSessionRule.logIn("john");
WsTester.Result result = wsTester.newGetRequest(CONTROLLER_ISSUES, ACTION_SEARCH).setParam("resolved", "false").setParam(WebService.Param.FACETS, "severities").setParam("facetMode", DEPRECATED_FACET_MODE_DEBT).execute();
result.assertJson(this.getClass(), "display_deprecated_debt_fields.json");
}
Aggregations