Package com.taskadapter.redmineapi.bean

Examples of com.taskadapter.redmineapi.bean.Project


        assertEquals(Version.SHARING_HIERARCHY, version2ById.getSharing());
    }

    private Project createProject() throws RedmineException {
        long id = new Date().getTime();
        Project mainProject = ProjectFactory.create("project" + id, "project" + id);
        return projectManager.createProject(mainProject);
    }
View Full Code Here


        return projectManager.createProject(mainProject);
    }

    private Project createSubProject(Project parent) throws RedmineException {
        long id = new Date().getTime();
        Project project = ProjectFactory.create("sub_pr" + id, "subpr" + id);
        project.setParentId(parent.getId());
        return projectManager.createProject(project);
    }
View Full Code Here

     * @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 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(
                "List of categories of test project must be empty now but is "
                        + categories, categories.isEmpty());
    }
View Full Code Here

     * @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 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());
            for (IssueCategory category : categories) {
                // assert category
                assertNotNull("ID of category must not be null",
                        category.getId());
View Full Code Here

    @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);
View Full Code Here

     *                                 requires authorization. Check the constructor arguments.
     * @throws NotFoundException       the project with the given projectKey is not found
     * @throws RedmineException
     */
    public Issue createIssue(String projectKey, Issue issue) throws RedmineException {
        final Project oldProject = issue.getProject();
        final Project newProject = ProjectFactory.create();
        newProject.setIdentifier(projectKey);
        issue.setProject(newProject);
        try {
            return transport.addObject(issue, new BasicNameValuePair("include",
                    Include.attachments.toString()));
        } finally {
View Full Code Here

    final Attachment attach1 = attachmentManager.uploadAttachment("test.bin",
        "application/ternary", content);
    final Issue testIssue = new Issue();
    testIssue.setSubject("This is upload ticket!");
    testIssue.addAttachment(attach1);
    final Project tmpProject = ProjectFactory.create("Upload project", "uploadtmpproject");
    final Project project = mgr.getProjectManager().createProject(tmpProject);
    try {
      final Issue createdIssue = issueManager.createIssue(project.getIdentifier(),
          testIssue);
      try {
        System.out.println(createdIssue.getAttachments());
      } finally {
        issueManager.deleteIssue(createdIssue.getId());
      }
    } finally {
      mgr.getProjectManager().deleteProject(project.getIdentifier());
    }
  }
View Full Code Here

    issueManager.update(issue);
  }

  @SuppressWarnings("unused")
  private static void getProject(RedmineManager mgr) throws RedmineException {
    Project test = mgr.getProjectManager().getProjectByKey("test");
    System.out.println(test);
  }
View Full Code Here

    logger.info("Running redmine tests using: " + testConfig.getURI());
        RedmineManager mgr = RedmineManagerFactory.createWithUserAuth(testConfig.getURI(), testConfig.getLogin(), testConfig.getPassword());
        issueManager = mgr.getIssueManager();
        projectManager = mgr.getProjectManager();

        Project junitTestProject = ProjectFactory.create("test project", "test" + Calendar.getInstance().getTimeInMillis());


        try {
      Project createdProject = projectManager.createProject(junitTestProject);
      projectKey = createdProject.getIdentifier();
    } catch (Exception e) {
      logger.error("Exception while creating test project", e);
      Assert.fail("can't create a test project. " + e.getMessage());
    }
  }
View Full Code Here

    }
  }

  @Test
  public void testProjectDefaults() throws RedmineException {
    final Project template = ProjectFactory.create("Test name", "key" + Calendar.getInstance().getTimeInMillis());
    final Project result = projectManager.createProject(template);
    try {
      Assert.assertNotNull(result.getId());
      Assert.assertEquals(template.getIdentifier(),
          result.getIdentifier());
      Assert.assertEquals("Test name", result.getName());
      Assert.assertEquals("", result.getDescription());
      Assert.assertEquals("", result.getHomepage());
      Assert.assertNotNull(result.getCreatedOn());
      Assert.assertNotNull(result.getUpdatedOn());
      Assert.assertNotNull(result.getTrackers());
      Assert.assertNull(result.getParentId());
    } finally {
            projectManager.deleteProject(result.getIdentifier());
    }
  }
View Full Code Here

TOP

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

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.