@Test public void testGetComments() { Entity entity = new Entity("defect", 1); String html = "<html><body>\n" + "<strong> Joe Joe, Fri Sep 07 2012:</strong><br>\nComment1\n" + "<strong>________________________________________</strong><br>\n" + "<strong> Jim Jim, Fri Sep 07 2012:</strong><br>\nComment2\n" + "<b>________________________________________</b><br>\n" + "<strong> John John, Fri Sep 07 2012:</strong><br>\nComment3\n" + "</body></html>"; entity.setProperty("dev-comments", html); HpAlmTask task = new HpAlmTask(getProject(), entity); Assert.assertEquals(3, task.getComments().length); Assert.assertEquals("Joe Joe", task.getComments()[0].getAuthor()); Assert.assertEquals("Jim Jim", task.getComments()[1].getAuthor()); Assert.assertEquals("John John", task.getComments()[2].getAuthor()); Entity requirement = new Entity("requirement", 1); requirement.setProperty("comments", html); task = new HpAlmTask(getProject(), requirement); Assert.assertEquals(3, task.getComments().length); }
public Comment[] getComments() { return parseComments(entity.getPropertyValue(entity.isInitialized("dev-comments")? "dev-comments": "comments")); }
HpAlmTask extends Task { public Comment[] getComments() { return parseComments(entity.getPropertyValue(entity.isInitialized("dev-comments")? "dev-comments": "comments")); } }
HpAlmTask extends Task { public Comment[] getComments() { return parseComments(entity.getPropertyValue(entity.isInitialized("dev-comments")? "dev-comments": "comments")); } HpAlmTask(Project project, Entity entity); }
HpAlmTask extends Task { public Comment[] getComments() { return parseComments(entity.getPropertyValue(entity.isInitialized("dev-comments")? "dev-comments": "comments")); } HpAlmTask(Project project, Entity entity); boolean isInitialized(); String getId(); String getSummary(); String getDescription(); Comment[] getComments(); Icon getIcon(); TaskType getType(); Date getUpdated(); Date getCreated(); boolean isClosed(); String getCustomIcon(); boolean isIssue(); String getIssueUrl(); static Date parseDate(String dateStr); static String getDescriptionField(String entityType); }
HpAlmTask extends Task { public Comment[] getComments() { return parseComments(entity.getPropertyValue(entity.isInitialized("dev-comments")? "dev-comments": "comments")); } HpAlmTask(Project project, Entity entity); boolean isInitialized(); String getId(); String getSummary(); String getDescription(); Comment[] getComments(); Icon getIcon(); TaskType getType(); Date getUpdated(); Date getCreated(); boolean isClosed(); String getCustomIcon(); boolean isIssue(); String getIssueUrl(); static Date parseDate(String dateStr); static String getDescriptionField(String entityType);  }