1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.internal;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 import org.junit.Test;
25
26 import static org.junit.Assert.assertEquals;
27
28 public class MultilineMessageHelperTest {
29
30 @Test
31 public void testBuilderCommon() {
32 List<String> msgs = new ArrayList<>();
33 msgs.add("*****************************************************************");
34 msgs.add("* Your build is requesting parallel execution, but project *");
35 msgs.add("* contains the following plugin(s) that have goals not marked *");
36 msgs.add("* as @threadSafe to support parallel building. *");
37 msgs.add("* While this /may/ work fine, please look for plugin updates *");
38 msgs.add("* and/or request plugins be made thread-safe. *");
39 msgs.add("* If reporting an issue, report it against the plugin in *");
40 msgs.add("* question, not against maven-core *");
41 msgs.add("*****************************************************************");
42
43 assertEquals(
44 msgs,
45 MultilineMessageHelper.format(
46 "Your build is requesting parallel execution, but project contains the following "
47 + "plugin(s) that have goals not marked as @threadSafe to support parallel building.",
48 "While this /may/ work fine, please look for plugin updates and/or "
49 + "request plugins be made thread-safe.",
50 "If reporting an issue, report it against the plugin in question, not against maven-core"));
51 }
52
53 @Test
54 public void testMojoExecutor() {
55 List<String> msgs = new ArrayList<>();
56 msgs.add("*****************************************************************");
57 msgs.add("* An aggregator Mojo is already executing in parallel build, *");
58 msgs.add("* but aggregator Mojos require exclusive access to reactor to *");
59 msgs.add("* prevent race conditions. This mojo execution will be blocked *");
60 msgs.add("* until the aggregator work is done. *");
61 msgs.add("*****************************************************************");
62
63 assertEquals(
64 msgs,
65 MultilineMessageHelper.format(
66 "An aggregator Mojo is already executing in parallel build, but aggregator "
67 + "Mojos require exclusive access to reactor to prevent race conditions. This "
68 + "mojo execution will be blocked until the aggregator work is done."));
69 }
70 }