File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\test\java\hudson\tasks\_maven\Maven3MojoNoteTest.java.html

1 package hudson.tasks._maven;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertTrue;
5 import hudson.MarkupText;
6
7 import org.junit.Test;
8
9 public class Maven3MojoNoteTest {
10
11 @Test
12 public void testAnnotateMavenPlugin() {
13 check("[INFO] <b class=maven-mojo>--- maven-clean-plugin:2.4.1:clean (default-clean) @ jobConfigHistory ---</b>", "[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ jobConfigHistory ---");
14 }
15
16 @Test
17 public void testAnnotateCodehausPlugin() {
18 check("[INFO] <b class=maven-mojo>--- cobertura-maven-plugin:2.4:instrument (report:cobertura) @ sardine ---</b>", "[INFO] --- cobertura-maven-plugin:2.4:instrument (report:cobertura) @ sardine ---");
19
20 }
21
22 @Test
23 public void testAnnotateOtherPlugin() {
24 check("[INFO] <b class=maven-mojo>--- gmaven-plugin:1.0-rc-5:generateTestStubs (test-in-groovy) @ jobConfigHistory ---</b>", "[INFO] --- gmaven-plugin:1.0-rc-5:generateTestStubs (test-in-groovy) @ jobConfigHistory ---");
25 }
26
27 private void check(final String decorated, final String input) {
28 assertTrue(input + " does not match" + Maven3MojoNote.PATTERN, Maven3MojoNote.PATTERN.matcher(input).matches());
29 assertEquals(decorated, annotate(input));
30 }
31
32 private String annotate(String text) {
33 final MarkupText markupText = new MarkupText(text);
34 new Maven3MojoNote().annotate(new Object(), markupText, 0);
35 return markupText.toString(true);
36 }
37
38 }
39