Package com.atlassian.jira.rest.client

Examples of com.atlassian.jira.rest.client.NullProgressMonitor


    assertTrue(Iterables.contains(transitions, new Transition("Start Progress", IntegrationTestUtil.START_PROGRESS_TRANSITION_ID, Collections.<Transition.Field>emptyList())));
  }

  @Test
  public void testTransition() throws Exception {
    final Issue issue = client.getIssueClient().getIssue("TST-1", new NullProgressMonitor());
    final Iterable<Transition> transitions = client.getIssueClient().getTransitions(issue, pm);
    assertEquals(4, Iterables.size(transitions));
    final Transition startProgressTransition = new Transition("Start Progress", IntegrationTestUtil.START_PROGRESS_TRANSITION_ID, Collections.<Transition.Field>emptyList());
    assertTrue(Iterables.contains(transitions, startProgressTransition));

    client.getIssueClient().transition(issue, new TransitionInput(IntegrationTestUtil.START_PROGRESS_TRANSITION_ID,
        Collections.<FieldInput>emptyList(), Comment.valueOf("My test comment")), new NullProgressMonitor()) ;
    final Issue transitionedIssue = client.getIssueClient().getIssue("TST-1", new NullProgressMonitor());
    assertEquals("In Progress", transitionedIssue.getStatus().getName());
    final Iterable<Transition> transitionsAfterTransition = client.getIssueClient().getTransitions(issue, pm);
    assertFalse(Iterables.contains(transitionsAfterTransition, startProgressTransition));
    final Transition stopProgressTransition = new Transition("Stop Progress", IntegrationTestUtil.STOP_PROGRESS_TRANSITION_ID, Collections.<Transition.Field>emptyList());
    assertTrue(Iterables.contains(transitionsAfterTransition, stopProgressTransition));
View Full Code Here


  public static void main(String[] args) throws URISyntaxException, JSONException {
    parseArgs(args);

    final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
    final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");
    final NullProgressMonitor pm = new NullProgressMonitor();
    final int buildNumber = restClient.getMetadataClient().getServerInfo(pm).getBuildNumber();

    // first let's get and print all visible projects (only jira4.3+)
    if (buildNumber >= ServerVersionConstants.BN_JIRA_4_3) {
      final Iterable<BasicProject> allProjects = restClient.getProjectClient().getAllProjects(pm);
View Full Code Here

    this.factory = new JerseyJiraRestClientFactory();
    this.restClient = factory.createWithBasicHttpAuthentication(new URI(
        prop.getProperty("url").trim()),
        prop.getProperty("username").trim(),
        prop.getProperty("password").trim());
    this.pm = new NullProgressMonitor();
  }
View Full Code Here

  }


  private void assertTransitionWithNumericCustomField(FieldInput fieldInput, Double expectedValue) {
    final Issue issue = client.getIssueClient().getIssue("TST-1", new NullProgressMonitor());
    assertNull(issue.getField(NUMERIC_CUSTOMFIELD_ID).getValue());
    final Iterable<Transition> transitions = client.getIssueClient().getTransitions(issue, pm);

    final Transition transitionFound = TestUtil.getTransitionByName(transitions, "Estimate");
    assertNotNull(transitionFound);
    assertTrue(Iterables.contains(transitionFound.getFields(),
        new Transition.Field(NUMERIC_CUSTOMFIELD_ID, false, IntegrationTestUtil.TESTING_JIRA_5_OR_NEWER ? NUMERIC_CUSTOMFIELD_TYPE_V5 : NUMERIC_CUSTOMFIELD_TYPE)));
    client.getIssueClient().transition(issue, new TransitionInput(transitionFound.getId(), Arrays.asList(fieldInput),
        Comment.valueOf("My test comment")), new NullProgressMonitor());
    final Issue changedIssue = client.getIssueClient().getIssue("TST-1", pm);
    assertTrue(changedIssue.getField(NUMERIC_CUSTOMFIELD_ID).getValue().equals(expectedValue));
  }
View Full Code Here

public class Example1 {
  public static void main(String[] args) throws URISyntaxException {
    final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory();
    final URI jiraServerUri = new URI("http://localhost:8090/jira");
    final JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "admin");
    final NullProgressMonitor pm = new NullProgressMonitor();

    // first let's get and print all visible projects
    final Iterable<BasicProject> allProjects = restClient.getProjectClient().getAllProjects(pm);
    for (BasicProject project : allProjects) {
      System.out.println(project);
View Full Code Here

  // no timezone here, as JIRA does not store timezone information in its dump file
  private final DateTime dateTime = ISODateTimeFormat.dateTimeParser().parseDateTime("2010-08-04T17:46:45.454");

  @Test
  public void testGetWatchers() throws Exception {
    final Issue issue = client.getIssueClient().getIssue("TST-1", new NullProgressMonitor());
    final Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf(), new NullProgressMonitor());
    assertEquals(1, watchers.getNumWatchers());
    assertFalse(watchers.isWatching());
    assertThat(watchers.getUsers(), containsInAnyOrder(USER1));
  }
View Full Code Here

  }

  @Test
  public void testGetWatcherForAnonymouslyAccessibleIssue() {
    setAnonymousMode();
    final Issue issue = client.getIssueClient().getIssue("ANNON-1", new NullProgressMonitor());
    final Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf(), pm);
    assertEquals(1, watchers.getNumWatchers());
    assertFalse(watchers.isWatching());
    assertTrue("JRADEV-3594 bug!!!", Iterables.isEmpty(watchers.getUsers()));
    // to save time
View Full Code Here

  }

  @Test
  public void testGetIssueWithAnonymouslyCreatedAttachment() {
    setAnonymousMode();
    final Issue issue = client.getIssueClient().getIssue("ANONEDIT-1", new NullProgressMonitor());
    final Iterator<Attachment> attachmentIterator = issue.getAttachments().iterator();
    assertTrue(attachmentIterator.hasNext());
    assertNull(attachmentIterator.next().getAuthor());
  }
View Full Code Here

  }

  @Test
  public void testGetIssueWithAnonymouslyCreatedWorklogEntry() {
    setAnonymousMode();
    final Issue issue = client.getIssueClient().getIssue("ANONEDIT-2", new NullProgressMonitor());
    final Iterator<Worklog> worklogIterator = issue.getWorklogs().iterator();
    assertTrue(worklogIterator.hasNext());
    assertNull(worklogIterator.next().getAuthor());
  }
View Full Code Here

  }


  @Test
  public void testGetTransitions() throws Exception {
    final Issue issue = client.getIssueClient().getIssue("TST-1", new NullProgressMonitor());
    final Iterable<Transition> transitions = client.getIssueClient().getTransitions(issue, pm);
    assertEquals(4, Iterables.size(transitions));
    assertTrue(Iterables.contains(transitions, new Transition("Start Progress", IntegrationTestUtil.START_PROGRESS_TRANSITION_ID, Collections.<Transition.Field>emptyList())));
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.NullProgressMonitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.