예제 #1
0
  public void testShouldBuildJiraOkUsingElementAndFixVersionsWithMoreThanOneFixVersion() {
    Element e = createClassMock(Element.class);
    List<JiraVersion> fixVersions = createInterfaceMock(List.class);

    setupMockActualsForElement(e, "LLU-1", "Blah", "BlahStatus", "BlahResolution", "BlahType");
    EasyMock.expect(fixVersions.get(0)).andReturn(TestObjects.Version_10);
    EasyMock.expect(fixVersions.size()).andReturn(2);

    replay();

    JiraIssue jira = jiraBuilder.buildJira(e, fixVersions);

    verify();

    assertJiraDetails(
        jira,
        "LLU-1",
        "Blah",
        "BlahStatus",
        "BlahResolution",
        "BlahType",
        new JiraVersion[] {TestObjects.Version_10});
    assertEquals(1, jira.getFixVersions().size());
    assertEquals(TestObjects.Version_10, jira.getFixVersions().get(0));
    assertEquals(null, jira.getBuildNo());
  }
예제 #2
0
  public void testShouldBuildJiraOkUsingElement() {
    Element e = createClassMock(Element.class);
    setupMockActualsForElement(e, "LLU-1", "Blah", "BlahStatus", "BlahResolution", "BlahType");

    replay();

    JiraIssue jira = jiraBuilder.buildJira(e);

    verify();

    assertJiraDetails(
        jira, "LLU-1", "Blah", "BlahStatus", "BlahResolution", "BlahType", new JiraVersion[] {});
    assertEquals(0, jira.getFixVersions().size());
    assertEquals(null, jira.getBuildNo());
  }
예제 #3
0
  public void testShouldBuildJirasOkUsingListOfElementsWithBuildNo() {
    List<Element> mockList = createInterfaceMock(List.class);
    EasyMock.expect(mockList.iterator()).andReturn(new TestIterator(listWithBuildNo, 1));
    EasyMock.expect(mockList.size()).andReturn(1).anyTimes();

    replay();

    List<JiraIssue> jiras = jiraBuilder.buildJiras(mockList);

    verify();

    assertEquals(1, jiras.size());
    JiraIssue jiraIssue = jiras.get(0);
    assertJiraDetails(
        jiraIssue,
        "LLU-4052",
        "Change SuiteDispatcher Log from Error to Debug when no jobs are found",
        "Open",
        "Unresolved",
        "Technical Debt",
        new JiraVersion[] {TestObjects.Version_Backlog});
    assertEquals("testBuildNo", jiraIssue.getBuildNo());
  }
예제 #4
0
  public void testShouldBuildJirasOkUsingListOfElementsWithoutBuildNo() {
    List<Element> mockList = createInterfaceMock(List.class);
    EasyMock.expect(mockList.iterator()).andReturn(new TestIterator(listWithOutBuildNo, 1));
    EasyMock.expect(mockList.size()).andReturn(1).anyTimes();

    replay();

    List<JiraIssue> jiras = jiraBuilder.buildJiras(mockList);

    verify();

    assertEquals(1, jiras.size());
    JiraIssue jiraIssue = jiras.get(0);
    assertJiraDetails(
        jiraIssue,
        "LLU-4119",
        "&apos;Quality Gateway&apos; tests set up",
        "Open",
        "Unresolved",
        "Story",
        new JiraVersion[] {TestObjects.Version_Backlog});
    assertEquals(null, jiraIssue.getBuildNo());
  }
예제 #5
0
 public void testShouldFormatDateOk() throws ParseException {
   assertEquals("2009-01-29", JiraBuilder.formatToDate("Thu, 29 Jan 2009 00:00:00 +0000 (GMT)"));
   assertEquals("", JiraBuilder.formatToDate(null));
   assertEquals("", JiraBuilder.formatToDate(""));
 }
예제 #6
0
 public void testGetStringAsInt() {
   assertEquals(50, JiraBuilder.getStringAsIntIfNumeric("50"));
   assertEquals(50, JiraBuilder.getStringAsIntIfNumeric("50.0"));
   assertEquals(50, JiraBuilder.getStringAsIntIfNumeric("50.1"));
   assertEquals(50, JiraBuilder.getStringAsIntIfNumeric("50.99"));
 }