Examples of IssueCategory


Examples of com.taskadapter.redmineapi.bean.IssueCategory

     * @throws NotFoundException              thrown in case the objects requested for could not be found
     */
    @Test
    public void testCreateAndDeleteIssueCategory() throws RedmineException {
        Project project = projectManager.getProjectByKey(projectKey);
        IssueCategory category = IssueCategoryFactory.create(project, "Category" + new Date().getTime());
        category.setAssignee(IntegrationTestHelper.getOurUser());
        IssueCategory newIssueCategory = issueManager.createCategory(category);
        assertNotNull("Expected new category not to be null", newIssueCategory);
        assertNotNull("Expected project of new category not to be null", newIssueCategory.getProject());
        assertNotNull("Expected assignee of new category not to be null",
                newIssueCategory.getAssignee());
        // now delete category
        issueManager.deleteCategory(newIssueCategory);
        // assert that the category is gone
        List<IssueCategory> categories = issueManager.getCategories(project.getId());
        assertTrue(
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

     */
    @Test
    public void testGetIssueCategories() throws RedmineException {
        Project project = projectManager.getProjectByKey(projectKey);
        // create some categories
        IssueCategory testIssueCategory1 = IssueCategoryFactory.create(project,
                "Category" + new Date().getTime());
        testIssueCategory1.setAssignee(IntegrationTestHelper.getOurUser());
        IssueCategory newIssueCategory1 = issueManager.createCategory(testIssueCategory1);
        IssueCategory testIssueCategory2 = IssueCategoryFactory.create(project,
                "Category" + new Date().getTime());
        testIssueCategory2.setAssignee(IntegrationTestHelper.getOurUser());
        IssueCategory newIssueCategory2 = issueManager.createCategory(testIssueCategory2);
        try {
            List<IssueCategory> categories = issueManager.getCategories(project.getId());
            assertEquals("Wrong number of categories for project "
                            + project.getName() + " delivered by Redmine Java API", 2,
                    categories.size());
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

     * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login
     * @throws NotFoundException              thrown in case the objects requested for could not be found
     */
    @Test(expected = IllegalArgumentException.class)
    public void testCreateInvalidIssueCategory() throws RedmineException {
        IssueCategory category = IssueCategoryFactory.create(null, "InvalidCategory"
                + new Date().getTime());
        issueManager.createCategory(category);
    }
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

     * @throws NotFoundException              thrown in case the objects requested for could not be found
     */
    @Test(expected = NotFoundException.class)
    public void testDeleteInvalidIssueCategory() throws RedmineException {
        // create new test category
        IssueCategory category = IssueCategoryFactory.create(-1);
        category.setName("InvalidCategory" + new Date().getTime());
        // now try deleting the category
        issueManager.deleteCategory(category);
    }
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

     * @throws RedmineAuthenticationException thrown in case something went wrong while trying to login
     * @throws NotFoundException              thrown in case the objects requested for could not be found
     */
    @Test
    public void testCreateAndGetIssueWithCategory() throws RedmineException {
        IssueCategory newIssueCategory = null;
        Issue newIssue = null;
        try {
            Project project = projectManager.getProjectByKey(projectKey);
            // create an issue category
            IssueCategory category = IssueCategoryFactory.create(project, "Category_"
                    + new Date().getTime());
            category.setAssignee(IntegrationTestHelper.getOurUser());
            newIssueCategory = issueManager.createCategory(category);
            // create an issue
            Issue issueToCreate = IssueFactory.createWithSubject("getIssueWithCategory_" + UUID.randomUUID());
            issueToCreate.setCategory(newIssueCategory);
            newIssue = issueManager.createIssue(projectKey, issueToCreate);
            // retrieve issue
            Issue retrievedIssue = issueManager.getIssueById(newIssue.getId());
            // assert retrieved category of issue
            IssueCategory retrievedCategory = retrievedIssue.getCategory();
            assertNotNull("Category retrieved for issue " + newIssue.getId()
                    + " should not be null", retrievedCategory);
            assertEquals("ID of category retrieved for issue "
                            + newIssue.getId() + " is wrong", newIssueCategory.getId(),
                    retrievedCategory.getId());
            assertEquals("Name of category retrieved for issue "
                            + newIssue.getId() + " is wrong",
                    newIssueCategory.getName(), retrievedCategory.getName());
        } finally {
            if (newIssue != null) {
                issueManager.deleteIssue(newIssue.getId());
            }
            if (newIssueCategory != null) {
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

    return result;
  }

  public static IssueCategory parseCategory(JSONObject content)
      throws JSONException {
    final IssueCategory result = IssueCategoryFactory.create(JsonInput.getInt(content, "id"));
    result.setName(JsonInput.getStringOrNull(content, "name"));
    result.setProject(JsonInput.getObjectOrNull(content, "project",
        MINIMAL_PROJECT_PARSER));
    result.setAssignee(JsonInput.getObjectOrNull(content, "assigned_to",
        USER_PARSER));
    return result;
  }
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

      throws RedmineException {
    Issue issue = new Issue();
    issue.setSubject("test123");
    final Version ver = VersionFactory.create(512);
    issue.setTargetVersion(ver);
    final IssueCategory cat = IssueCategoryFactory.create(673);
    issue.setCategory(cat);
    issueManager.createIssue(projectKey, issue);
  }
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.IssueCategory

    }
  }

  @Test
  public void testCategoryDefaults() throws RedmineException {
    final IssueCategory template = IssueCategoryFactory.create(projectManager.getProjectByKey(projectKey), "test name");
    final IssueCategory category = issueManager.createCategory(template);
    try {
      Assert.assertNotNull(category.getId());
      Assert.assertEquals("test name", category.getName());
      Assert.assertNotNull(category.getProject());
      Assert.assertNull(category.getAssignee());
    } finally {
      issueManager.deleteCategory(category);
    }
  }
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.