コード例 #1
0
  @Test
  public void testNoWikiLinkToAnnotate() {
    AbstractBuild build = mock(AbstractBuild.class);
    AbstractProject<?, ?> project = mock(AbstractProject.class);
    when(project.getProperty(CodePlexProjectProperty.class))
        .thenReturn(new CodePlexProjectProperty("theproject"));
    when(build.getProject()).thenReturn(project);

    CodePlexChangeLogAnnotator annotator = new CodePlexChangeLogAnnotator();
    MarkupText markupText = new MarkupText("Ordinary commit message without wiki link.");
    annotator.annotate(build, null, markupText);
    assertEquals("Ordinary commit message without wiki link.", markupText.toString());
  }
コード例 #2
0
  @Test
  public void assertWorkItemInBracketsIsAnnotated() {
    AbstractBuild build = mock(AbstractBuild.class);
    AbstractProject<?, ?> project = mock(AbstractProject.class);
    when(project.getProperty(CodePlexProjectProperty.class))
        .thenReturn(new CodePlexProjectProperty("theproject"));
    when(build.getProject()).thenReturn(project);

    CodePlexChangeLogAnnotator annotator = new CodePlexChangeLogAnnotator();
    MarkupText markupText = new MarkupText("Message with [workitem: 12]. Yes a link.");
    annotator.annotate(build, null, markupText);
    assertEquals(
        "Message with <a href='http://www.codeplex.com/theproject/WorkItem/View.aspx?WorkItemId=12'>[workitem: 12]</a>. Yes a link.",
        markupText.toString());
  }
コード例 #3
0
  @Test
  public void assertWikiKeyWordIsAnnotated() {
    AbstractBuild build = mock(AbstractBuild.class);
    AbstractProject<?, ?> project = mock(AbstractProject.class);
    when(project.getProperty(CodePlexProjectProperty.class))
        .thenReturn(new CodePlexProjectProperty("theproject"));
    when(build.getProject()).thenReturn(project);

    CodePlexChangeLogAnnotator annotator = new CodePlexChangeLogAnnotator();
    MarkupText markupText = new MarkupText("Message with wiki:WikiLink. Yes a link.");
    annotator.annotate(build, null, markupText);
    assertEquals(
        "Message with <a href='http://www.codeplex.com/theproject/Wiki/View.aspx?title=WikiLink'>wiki:WikiLink</a>. Yes a link.",
        markupText.toString());
  }