本文整理匯總了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);
}