Package com.atlassian.jira.rest.client.api.domain

Examples of com.atlassian.jira.rest.client.api.domain.SearchResult


    jqlSearchWithAllFieldsImpl(generateVeryLongJql() + "and key=TST-2");
  }

  private void jqlSearchWithAllFieldsImpl(String jql) {
    final ImmutableSet<String> fields = ImmutableSet.of("*all");
    final SearchResult searchResult = client.getSearchClient().searchJql(jql, null, null, fields).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());

    assertEquals("TST-2", issue.getKey());
    assertEquals("Testing attachem2", issue.getSummary());
    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());
    assertThat(issue.getComponents(), NamedEntityMatchers.entitiesWithNames("Component A", "Component B"));
View Full Code Here


        "apache-tomcat-5.5.30.zip", "jira_logo.gif", "snipe.png", "transparent-png.png"));
  }

  @Test
  public void jqlSearchShouldReturnIssueWithLabelsAndDueDate() throws Exception {
    final SearchResult searchResult = client.getSearchClient().searchJql("key=TST-1").claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
    assertEquals("TST-1", issue.getKey());
    assertThat(issue.getLabels(), containsInAnyOrder("a", "bcds"));
    assertEquals(toDateTime("2010-07-05T00:00:00.000"), issue.getDueDate());
  }
View Full Code Here

  }

  @Test
  public void jqlSearchWithMinimalFieldSetShouldReturnParseableIssues() throws Exception {
    final SearchRestClient searchClient = client.getSearchClient();
    final SearchResult searchResult = searchClient.searchJql("key=TST-1", null, null, REQUIRED_ISSUE_FIELDS).claim();
    final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
    assertEquals("TST-1", issue.getKey());
    assertEquals("My sample test", issue.getSummary());
    assertEquals("Bug", issue.getIssueType().getName());
    assertEquals(toDateTime("2010-07-23T12:16:56.000"), issue.getCreationDate());
    assertEquals(toDateTime("2010-08-17T16:36:29.000"), issue.getUpdateDate());
View Full Code Here

  final SearchResultJsonParser parser = new SearchResultJsonParser();

  @Test
  public void testParse() throws Exception {
    final SearchResult searchResult = parser.parse(getJsonObjectFromResource("/json/search/issues1.json"));

    assertThat(searchResult, searchResultWithParamsAndIssueCount(0, 50, 1, 1));

    final Issue foundIssue = Iterables.getLast(searchResult.getIssues());
    assertIssueIsTST7(foundIssue);
  }
View Full Code Here

    assertIssueIsTST7(foundIssue);
  }

  @Test
  public void testParseMany() throws Exception {
    final SearchResult searchResult = parser.parse(getJsonObjectFromResource("/json/search/many-issues.json"));

    assertThat(searchResult, searchResultWithParamsAndIssueCount(0, 8, 15, 8));

    final Issue issue = findEntityById(searchResult.getIssues(), 10040L);
    assertIssueIsTST7(issue);

    final String[] expectedIssuesKeys = {"TST-13", "TST-12", "TST-11", "TST-10", "TST-9", "TST-8", "TST-7", "TST-6"};
    assertThat(searchResult.getIssues(), issuesWithKeys(expectedIssuesKeys));
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.SearchResult

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.