当前位置: 首页>>代码示例>>Java>>正文


Java MantisProject类代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:MantisIntegrationTest.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:43,代码来源:MantisIntegrationTest.java


注:本文中的com.intellij.tasks.mantis.MantisProject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。