File tree Expand file tree Collapse file tree
java/org/codehaus/mojo/exec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,22 @@ public void testJSR512StaticMainNoArgs() throws Exception {
115115 assertEquals ("Correct choice" + System .getProperty ("line.separator" ), output );
116116 }
117117
118+ public void testJSR512PackagePrivateStaticMainNoArgs () throws Exception {
119+ File pom = new File (getBasedir (), "src/test/projects/project27/pom.xml" );
120+
121+ String output = execute (pom , "java" );
122+
123+ assertEquals ("Correct choice" + System .getProperty ("line.separator" ), output );
124+ }
125+
126+ public void testJSR512PackagePrivateStaticMainWithArgs () throws Exception {
127+ File pom = new File (getBasedir (), "src/test/projects/project28/pom.xml" );
128+
129+ String output = execute (pom , "java" );
130+
131+ assertEquals ("Correct choice arg1 arg2" + System .getProperty ("line.separator" ), output );
132+ }
133+
118134 public void testJSR512FailureInstanceMainPrivateNoArgsConstructor () throws Exception {
119135 File pom = new File (getBasedir (), "src/test/projects/project25/pom.xml" );
120136 try {
Original file line number Diff line number Diff line change 1+ package org .codehaus .mojo .exec ;
2+
3+ /**
4+ * Tests a main method that's not public, static, and has no parameters.
5+ */
6+ public class JSR512DummyMain6 {
7+ static void main () {
8+ System .out .println ("Correct choice" );
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ package org .codehaus .mojo .exec ;
2+
3+ /**
4+ * Tests a main method that's not public, static, and has parameters.
5+ */
6+ public class JSR512DummyMain7 {
7+ static void main (String [] args ) {
8+ StringBuilder buffer = new StringBuilder ("Correct choice" );
9+
10+ for (String arg : args ) {
11+ buffer .append (" " ).append (arg );
12+ }
13+
14+ System .out .println (buffer .toString ());
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ <project >
2+ <modelVersion >4.0.0</modelVersion >
3+ <groupId >org.cb.maven.plugins.exec</groupId >
4+ <artifactId >project4</artifactId >
5+ <version >0.1</version >
6+ <packaging >jar</packaging >
7+ <name >Maven Exec Plugin</name >
8+ <inceptionYear >2005</inceptionYear >
9+ <licenses >
10+ <license >
11+ <name >Apache License 2</name >
12+ <url >http://www.apache.org/licenses/LICENSE-2.0.txt</url >
13+ <distribution >repo</distribution >
14+ </license >
15+ </licenses >
16+
17+ <build >
18+ <plugins >
19+ <plugin >
20+ <groupId >org.codehaus.mojo</groupId >
21+ <artifactId >exec-maven-plugin</artifactId >
22+ <executions >
23+ <execution >
24+ <phase >test</phase >
25+ <goals >
26+ <goal >java</goal >
27+ </goals >
28+ </execution >
29+ </executions >
30+ <configuration >
31+ <mainClass >org.codehaus.mojo.exec.JSR512DummyMain6</mainClass >
32+ </configuration >
33+ </plugin >
34+ </plugins >
35+ </build >
36+
37+ </project >
Original file line number Diff line number Diff line change 1+ <project >
2+ <modelVersion >4.0.0</modelVersion >
3+ <groupId >org.cb.maven.plugins.exec</groupId >
4+ <artifactId >project4</artifactId >
5+ <version >0.1</version >
6+ <packaging >jar</packaging >
7+ <name >Maven Exec Plugin</name >
8+ <inceptionYear >2005</inceptionYear >
9+ <licenses >
10+ <license >
11+ <name >Apache License 2</name >
12+ <url >http://www.apache.org/licenses/LICENSE-2.0.txt</url >
13+ <distribution >repo</distribution >
14+ </license >
15+ </licenses >
16+
17+ <build >
18+ <plugins >
19+ <plugin >
20+ <groupId >org.codehaus.mojo</groupId >
21+ <artifactId >exec-maven-plugin</artifactId >
22+ <executions >
23+ <execution >
24+ <phase >test</phase >
25+ <goals >
26+ <goal >java</goal >
27+ </goals >
28+ </execution >
29+ </executions >
30+ <configuration >
31+ <mainClass >org.codehaus.mojo.exec.JSR512DummyMain7</mainClass >
32+ <arguments >
33+ <argument >arg1</argument >
34+ <argument >arg2</argument >
35+ </arguments >
36+ </configuration >
37+ </plugin >
38+ </plugins >
39+ </build >
40+
41+ </project >
You can’t perform that action at this time.
0 commit comments