1 package org.apache.maven.plugin.source;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24
25
26
27 public class SourceJarMojoTest
28 extends AbstractSourcePluginTestCase
29 {
30 protected String getGoal()
31 {
32 return "jar";
33 }
34
35 public void testDefaultConfiguration()
36 throws Exception
37 {
38 doTestProjectWithSourceArchive( "project-001", new String[]{"default-configuration.properties",
39 "foo/project001/App.java", "foo/project001/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"} );
40 }
41
42 public void testExcludes()
43 throws Exception
44 {
45 doTestProjectWithSourceArchive( "project-003", new String[]{"default-configuration.properties",
46 "foo/project003/App.java", "foo/project003/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
47
48 } );
49 }
50
51 public void testNoSources()
52 throws Exception
53 {
54 executeMojo( "project-005" );
55
56 final File expectedFile = getTestTargetDir( "project-005" );
57 assertFalse( "Source archive should not have been created[" + expectedFile.getAbsolutePath() + "]",
58 expectedFile.exists() );
59 }
60
61 public void testIncludes()
62 throws Exception
63 {
64 doTestProjectWithSourceArchive( "project-007", new String[]{"templates/configuration-template.properties",
65 "foo/project007/App.java", "templates/", "foo/project007/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"
66
67 } );
68 }
69
70 public void testIncludePom()
71 throws Exception
72 {
73 doTestProjectWithSourceArchive( "project-009", new String[]{"default-configuration.properties", "pom.xml",
74 "foo/project009/App.java", "foo/project009/", "foo/", "META-INF/MANIFEST.MF", "META-INF/"} );
75 }
76 }