Package com.taskadapter.redmineapi.bean

Examples of com.taskadapter.redmineapi.bean.TimeEntry


    }
  }

  @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 testTimeEntryDefaults() throws JSONException {
    final String MINIMAL_TIME_ENTRY = "{\"time_entry\":{\"issue\":{\"id\":1931},\"created_on\":\"2012/05/16 01:40:29 -0700\",\"project\":{\"name\":\"test project\",\"id\":1072},\"updated_on\":\"2012/05/16 01:40:29 -0700\",\"user\":{\"name\":\"Redmine Admin\",\"id\":1},\"hours\":123.0,\"id\":166,\"spent_on\":\"2012/05/16\",\"activity\":{\"name\":\"Design\",\"id\":8}}}";
    final TimeEntry entry = parse(MINIMAL_TIME_ENTRY, "time_entry",
        RedmineJSONParser.TIME_ENTRY_PARSER);
    Assert.assertEquals("", entry.getComment());
  }
View Full Code Here

TOP

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

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.