Examples of IssueType


Examples of com.atlassian.jira.rest.client.domain.IssueType

  public IssueType parse(JSONObject json) throws JSONException {
    final BasicIssueType basicIssueType = basicIssueTypeJsonParser.parse(json);
    final String iconUrl = JsonParseUtil.getOptionalString(json, "iconUrl");
    final URI iconUri = iconUrl == null ? null : JsonParseUtil.parseURI(iconUrl);
    final String description = JsonParseUtil.getOptionalString(json, "description");
    return new IssueType(basicIssueType.getSelf(), basicIssueType.getId(), basicIssueType.getName(), basicIssueType.isSubtask(), description, iconUri);
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

  final IssueTypeJsonParser issueTypeJsonParser = new IssueTypeJsonParser();
  final CimFieldsInfoMapJsonParser fieldsParser = new CimFieldsInfoMapJsonParser();

  @Override
  public CimIssueType parse(final JSONObject json) throws JSONException {
    final IssueType issueType = issueTypeJsonParser.parse(json);
    final JSONObject jsonFieldsMap = json.optJSONObject("fields");
   
    final Map<String, CimFieldInfo> fields = (jsonFieldsMap == null) ?
        Collections.<String, CimFieldInfo>emptyMap() : fieldsParser.parse(jsonFieldsMap);

    return new CimIssueType(issueType.getSelf(), issueType.getId(), issueType.getName(),
        issueType.isSubtask(), issueType.getDescription(), issueType.getIconUri(), fields);
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

public class IssueTypeJsonParserTest {
  @Test
  public void testParse() throws JSONException {
    IssueTypeJsonParser parser = new IssueTypeJsonParser();
    final IssueType issueType = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/issueType/complete.json"));
    assertEquals(new IssueType(toUri("http://localhost:8090/jira/rest/api/latest/issueType/1"), 1L, "Bug", true,
        "A problem which impairs or prevents the functions of the product.",
        TestUtil.toUri("http://localhost:8090/jira/images/icons/bug.gif")), issueType);
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

    assertEquals(new DateMidnight(2010, 8, 25).toInstant(), Iterables.getLast(project.getVersions()).getReleaseDate().toInstant());
        assertEquals("Test Project", project.getName());
    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    assertTrue(issueTypes.isSupported());
    assertThat(issueTypes, containsInAnyOrder(
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issueType/1"), null, "Bug", false, null, null),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issueType/2"), null, "New Feature", false, null, null),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issueType/3"), null, "Task", false, null, null),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issueType/4"), null, "Improvement", false, null, null),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issueType/5"), null, "Sub-task", true, null, null)
    ));
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

    assertEquals(new DateMidnight(2010, 8, 25).toInstant(), Iterables.getLast(project.getVersions()).getReleaseDate().toInstant());
    assertEquals("Test Project", project.getName());
    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    assertTrue(issueTypes.isSupported());
    assertThat(issueTypes, containsInAnyOrder(
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issuetype/1"), 1L, "Bug", false, "A problem which impairs or prevents the functions of the product.", TestUtil.toUri("http://localhost:2990/jira/images/icons/bug.gif")),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issuetype/2"), 2L, "New Feature", false, "A new feature of the product, which has yet to be developed.", TestUtil.toUri("http://localhost:2990/jira/images/icons/newfeature.gif")),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issuetype/3"), 3L, "Task", false, "A task that needs to be done.", TestUtil.toUri("http://localhost:2990/jira/images/icons/task.gif")),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issuetype/4"), 4L, "Improvement", false, "An improvement or enhancement to an existing feature or task.", TestUtil.toUri("http://localhost:2990/jira/images/icons/improvement.gif")),
        new IssueType(TestUtil.toUri("http://localhost:2990/jira/rest/api/latest/issuetype/5"), 5L, "Sub-task", true, "The sub-task of the issue", TestUtil.toUri("http://localhost:2990/jira/images/icons/issue_subtask.gif"))
    ));
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

  }

  @Test
  public void testGetIssueType() {
    final BasicIssueType basicIssueType = client.getIssueClient().getIssue("TST-1", pm).getIssueType();
    final IssueType issueType = client.getMetadataClient().getIssueType(basicIssueType.getSelf(), pm);
    assertEquals("Bug", issueType.getName());
    assertEquals("A problem which impairs or prevents the functions of the product.", issueType.getDescription());
    Long expectedId = isJira5xOrNewer() ? 1L : null;
    assertEquals(expectedId, issueType.getId());
//    assertTrue(issueType.getIconUri().toString().startsWith(jiraUri.toString()));
    assertThat(issueType.getIconUri().toString(), anyOf(
        endsWith("bug.gif"),
        endsWith("issuetypes/bug.png")
    ));
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

    final OptionalIterable<IssueType> issueTypes = project.getIssueTypes();
    if (isJira4x4OrNewer()) {
      assertTrue(issueTypes.isSupported());
      final Iterator<IssueType> issueTypesIterator = issueTypes.iterator();
      assertTrue(issueTypesIterator.hasNext());
      final IssueType it = issueTypesIterator.next();
      if (isJira5xOrNewer()) {
        assertEquals(Long.valueOf(1), it.getId());
      }
      else {
        assertNull(it.getId());
      }
      assertEquals(it.getName(), "Bug");
    }
    else {
      assertFalse(issueTypes.isSupported());
    }
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

  @JiraBuildNumberDependent(BN_JIRA_5)
  public void testGetIssueTypes() {
    final Iterable<IssueType> issueTypes = client.getMetadataClient().getIssueTypes(pm);
    assertEquals(5, Iterables.size(issueTypes));

    final IssueType issueType = findEntityBySelfAddressSuffix(issueTypes, "/5");
    assertEquals("Sub-task", issueType.getName());
    assertEquals("The sub-task of the issue", issueType.getDescription());
    assertEquals(Long.valueOf(5), issueType.getId());
    assertTrue(issueType.isSubtask());
    assertNotNull(issueType.getSelf());
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

  }

  @Test
  public void testGetIssueType() {
    final BasicIssueType basicIssueType = client.getIssueClient().getIssue("TST-1", pm).getIssueType();
    final IssueType issueType = client.getMetadataClient().getIssueType(basicIssueType.getSelf(), pm);
    assertEquals("Bug", issueType.getName());
    assertEquals("A problem which impairs or prevents the functions of the product.", issueType.getDescription());
    Long expectedId = isJira5xOrNewer() ? 1L : null;
    assertEquals(expectedId, issueType.getId());
    assertTrue(issueType.getIconUri().toString().endsWith("bug.gif"));
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.IssueType

    final Project project = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/project/project-jira-4-4.json"));
    assertEquals("TST", project.getKey()); //2010-08-25
    assertEquals(new DateMidnight(2010, 8, 25).toInstant(), Iterables.getLast(project.getVersions()).getReleaseDate().toInstant());
        assertEquals("Test Project", project.getName());
    assertThat(project.getIssueTypes(), containsInAnyOrder(
        new IssueType(new URI("http://localhost:2990/jira/rest/api/latest/issueType/1"), null, "Bug", false, null, null),
        new IssueType(new URI("http://localhost:2990/jira/rest/api/latest/issueType/2"), null, "New Feature", false, null, null),
        new IssueType(new URI("http://localhost:2990/jira/rest/api/latest/issueType/3"), null, "Task", false, null, null),
        new IssueType(new URI("http://localhost:2990/jira/rest/api/latest/issueType/4"), null, "Improvement", false, null, null),
        new IssueType(new URI("http://localhost:2990/jira/rest/api/latest/issueType/5"), null, "Sub-task", true, null, null)
    ));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.