use of com.intellij.tasks.mantis.MantisProject in project intellij-community by JetBrains.
the class MantisIntegrationTest method testMantis12.
public void testMantis12() throws Exception {
assertTrue(myRepository.getProjects().size() >= 2);
final MantisProject mantisProject = myRepository.getProjects().get(1);
assertEquals(mantisProject.getName(), "Mantis 1.2 project 1");
myRepository.setCurrentProject(mantisProject);
assertTrue(mantisProject.getFilters().size() >= 2);
MantisFilter mantisFilter = null;
for (MantisFilter filter : mantisProject.getFilters()) {
if (filter.getName().equals("Mantis 1.2 Filter 1")) {
mantisFilter = filter;
}
}
assertNotNull(mantisFilter);
myRepository.setCurrentFilter(mantisFilter);
final Task[] issues = myRepository.getIssues("", 0, 1, true, new EmptyProgressIndicator());
assertTrue(issues.length >= 1);
final Task task = issues[0];
assertEquals("1", task.getId());
// not available here, but is defined in practice, after task has been activated and thus updated from server
//assertEquals("Mantis 1.2 project 1", task.getProject());
assertEquals("1", task.getNumber());
assertEquals("M12P1I1", task.getSummary());
final Task task1 = myRepository.findTask("1");
assertNotNull(task1);
assertEquals("1", task1.getId());
assertEquals("Mantis 1.2 project 1", task1.getProject());
assertEquals("1", task1.getNumber());
assertEquals("M12P1I1", task1.getSummary());
assertEquals(".", task1.getDescription());
HttpClient client = new HttpClient();
final GetMethod method = new GetMethod(task1.getIssueUrl());
client.executeMethod(method);
assertEquals(method.getStatusCode(), 200);
}
Aggregations