Package com.taskadapter.redmineapi.bean

Examples of com.taskadapter.redmineapi.bean.Issue


  }

  @SuppressWarnings("unused")
  private static void getIssueWithRelations(IssueManager issueManager)
      throws RedmineException {
    Issue issue = issueManager.getIssueById(22751, Include.relations);
    Collection<IssueRelation> r = issue.getRelations();
    logger.debug("Retrieved relations " + r);
  }
View Full Code Here


  }

  @SuppressWarnings("unused")
  private static void tryCreateIssue(IssueManager issueManager)
      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

    }
  }

  @Test
  public void testIssueDefaults() throws RedmineException {
    final Issue template = IssueFactory.createWithSubject("This is a subject");
    final Issue result = issueManager.createIssue(projectKey, template);
   
    try {
      Assert.assertNotNull(result.getId());
      Assert.assertEquals("This is a subject", result.getSubject());
      Assert.assertNull(result.getParentId());
      Assert.assertNull(result.getEstimatedHours());
      Assert.assertEquals(Float.valueOf(0), result.getSpentHours());
      Assert.assertNull(result.getAssignee());
      Assert.assertNotNull(result.getPriorityText());
      Assert.assertNotNull(result.getPriorityId());
      Assert.assertEquals(Integer.valueOf(0), result.getDoneRatio());
      Assert.assertNotNull(result.getProject());
      Assert.assertNotNull(result.getAuthor());
      Assert.assertNull(result.getStartDate());
      Assert.assertNull(result.getDueDate());
      Assert.assertNotNull(result.getTracker());
      Assert.assertEquals("", result.getDescription());
      Assert.assertNotNull(result.getCreatedOn());
      Assert.assertNotNull(result.getUpdatedOn());
      Assert.assertNotNull(result.getStatusId());
      Assert.assertNotNull(result.getStatusName());
      Assert.assertNull(result.getTargetVersion());
      Assert.assertNull(result.getCategory());
      Assert.assertNull(result.getNotes());
      Assert.assertNotNull(result.getCustomFields());
      Assert.assertNotNull(result.getJournals());
      Assert.assertNotNull(result.getRelations());
      Assert.assertNotNull(result.getAttachments());
    } finally {
            issueManager.deleteIssue(result.getId());
    }
  }
View Full Code Here

  @Test
  public void testTimeEntryDefaults() throws RedmineException {
    final TimeEntry template = TimeEntryFactory.create();

    final Issue tmp = IssueFactory.createWithSubject("aaabbbccc");
    final Issue tmpIssue = issueManager.createIssue(projectKey, tmp);
    try {
      template.setHours(123.f);
      template.setActivityId(ACTIVITY_ID);
      template.setIssueId(tmpIssue.getId());
      final TimeEntry result = issueManager.createTimeEntry(template);
      try {
        Assert.assertNotNull(result.getId());
        Assert.assertNotNull(result.getIssueId());
        Assert.assertNotNull(result.getProjectId());
        Assert.assertNotNull(result.getProjectName());
        Assert.assertNotNull(result.getUserName());
        Assert.assertNotNull(result.getUserId());
        Assert.assertNotNull(result.getActivityName());
        Assert.assertNotNull(result.getActivityId());
        Assert.assertEquals(Float.valueOf(123.0f), result.getHours());
        Assert.assertEquals("", result.getComment());
        Assert.assertNotNull(result.getSpentOn());
        Assert.assertNotNull(result.getCreatedOn());
        Assert.assertNotNull(result.getUpdatedOn());
      } finally {
        issueManager.deleteTimeEntry(result.getId());
      }
    } finally {
            issueManager.deleteIssue(tmpIssue.getId());
    }
  }
View Full Code Here

    }
  }

  @Test
  public void testRelationDefaults() throws RedmineException {
    final Issue tmp = IssueFactory.createWithSubject("this is a test");
    final Issue issue1 = issueManager.createIssue(projectKey, tmp);
    try {
      final Issue issue2 = issueManager.createIssue(projectKey, tmp);
      try {
        final IssueRelation relation = issueManager.createRelation(
            issue1.getId(), issue2.getId(), "blocks");
        Assert.assertNotNull(relation.getId());
        Assert.assertEquals(issue1.getId(), relation.getIssueId());
        Assert.assertEquals(issue2.getId(), relation.getIssueToId());
        Assert.assertEquals("blocks", relation.getType());
        Assert.assertEquals(Integer.valueOf(0), relation.getDelay());
      } finally {
        issueManager.deleteIssue(issue2.getId());
      }
    } finally {
      issueManager.deleteIssue(issue1.getId());
    }
  }
View Full Code Here

  }

  @Test
  public void testIssueDefaults() throws JSONException {
    final String MINIMAL_ISSUE = "{\"issue\":{\"status\":{\"name\":\"New\",\"id\":1},\"author\":{\"name\":\"Redmine Admin\",\"id\":1},\"created_on\":\"2012/05/16 01:25:27 -0700\",\"tracker\":{\"name\":\"Bug\",\"id\":1},\"project\":{\"name\":\"test project\",\"id\":1063},\"spent_hours\":0.0,\"updated_on\":\"2012/05/16 01:25:27 -0700\",\"done_ratio\":0,\"subject\":\"This is a subject\",\"id\":1926,\"custom_fields\":[{\"value\":\"\",\"name\":\"my_custom_1\",\"id\":1},{\"value\":\"on\",\"name\":\"custom_boolean_1\",\"id\":2}],\"priority\":{\"name\":\"Normal\",\"id\":4}}}";
    final Issue issue = parse(MINIMAL_ISSUE, "issue",
        RedmineJSONParser.ISSUE_PARSER);
    Assert.assertEquals("", issue.getDescription());
  }
View Full Code Here

TOP

Related Classes of com.taskadapter.redmineapi.bean.Issue

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.