コード例 #1
0
 @SuppressWarnings("ConstantConditions")
 private void changeStateAndCheck(String url, String key) throws Exception {
   myRepository.setUrl(url);
   Task task = myRepository.findTask(key);
   try {
     myRepository.setTaskState(task, TaskState.IN_PROGRESS);
     task = myRepository.findTask(key);
     assertEquals(task.getState(), TaskState.IN_PROGRESS);
     myRepository.setTaskState(task, TaskState.RESOLVED);
     task = myRepository.findTask(key);
     assertEquals(task.getState(), TaskState.RESOLVED);
     myRepository.setTaskState(task, TaskState.REOPENED);
     assertEquals(myRepository.findTask(key).getState(), TaskState.REOPENED);
   } catch (Exception e) {
     // always attempt to restore original state of the issue
     try {
       // transition to Resolved state usually is possible from any other
       myRepository.setTaskState(task, TaskState.RESOLVED);
     } catch (Exception ignored) {
     }
     try {
       myRepository.setTaskState(task, TaskState.REOPENED);
     } catch (Exception ignored) {
     }
     throw e;
   }
 }
コード例 #2
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   TaskSettings.getInstance().CONNECTION_TIMEOUT = 10000;
   myRepository = new JiraRepository(new JiraRepositoryType());
   myRepository.setUrl(JIRA_5_TEST_SERVER_URL);
   myRepository.setUsername("buildtest");
   myRepository.setPassword("buildtest");
 }
コード例 #3
0
 public void testVersionDiscovery() throws Exception {
   myRepository.setUrl(JIRA_5_TEST_SERVER_URL);
   assertEquals("2.0", myRepository.discoverRestApiVersion().getVersionName());
   myRepository.setUrl(JIRA_4_TEST_SERVER_URL);
   assertEquals("2.0.alpha1", myRepository.discoverRestApiVersion().getVersionName());
 }