本文整理汇总了Java中com.intellij.tasks.mantis.MantisProject类的典型用法代码示例。如果您正苦于以下问题:Java MantisProject类的具体用法?Java MantisProject怎么用?Java MantisProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MantisProject类属于com.intellij.tasks.mantis包,在下文中一共展示了MantisProject类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMantis12
import com.intellij.tasks.mantis.MantisProject; //导入依赖的package包/类
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);
}
示例2: testMantis12
import com.intellij.tasks.mantis.MantisProject; //导入依赖的package包/类
public void testMantis12() throws Exception {
MantisRepository mantisRepository = new MantisRepository(new MantisRepositoryType());
mantisRepository.setUrl("http://trackers-tests.labs.intellij.net:8142/");
mantisRepository.setUsername("deva");
mantisRepository.setPassword("deva");
assertTrue(mantisRepository.getProjects().size() >= 2);
final MantisProject mantisProject = mantisRepository.getProjects().get(1);
assertEquals(mantisProject.getName(), "Mantis 1.2 project 1");
mantisRepository.setProject(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);
mantisRepository.setFilter(mantisFilter);
final Task[] issues = mantisRepository.getIssues("", 1, 0);
assertTrue(issues.length >= 1);
final Task task = issues[0];
assertEquals(task.getId(), "1");
assertEquals(task.getProject(), "Mantis 1.2 project 1");
assertEquals(task.getNumber(), "1");
assertEquals(task.getSummary(), "M12P1I1");
final Task task1 = mantisRepository.findTask("1");
assertNotNull(task1);
assertEquals(task1.getId(), "1");
assertEquals(task1.getProject(), "Mantis 1.2 project 1");
assertEquals(task1.getNumber(), "1");
assertEquals(task1.getSummary(), "M12P1I1");
assertEquals(task1.getDescription(), ".");
HttpClient client = new HttpClient();
final GetMethod method = new GetMethod(task1.getIssueUrl());
client.executeMethod(method);
assertEquals(method.getStatusCode(), 200);
}