1 package org.apache.its;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import static org.apache.its.util.TestUtils.archivePathFromChild;
23 import static org.apache.its.util.TestUtils.archivePathFromProject;
24 import static org.apache.its.util.TestUtils.assertZipContents;
25 import static org.apache.its.util.TestUtils.getTestDir;
26
27 import org.apache.maven.it.VerificationException;
28 import org.apache.maven.it.Verifier;
29 import org.junit.Test;
30
31 import java.io.File;
32 import java.io.IOException;
33 import java.net.URISyntaxException;
34 import java.util.HashSet;
35 import java.util.Set;
36
37 public class IT_003_SharedResourceInclusion
38 {
39
40 private static final String BASENAME = "shared-resources";
41 private static final String VERSION = "1";
42
43 @Test
44 public void execute()
45 throws VerificationException, IOException, URISyntaxException
46 {
47 File testDir = getTestDir( BASENAME );
48
49 Verifier verifier = new Verifier( testDir.getAbsolutePath() );
50
51 verifier.executeGoal( "package" );
52
53 verifier.verifyErrorFreeLog();
54 verifier.resetStreams();
55
56 File assembly = new File( testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip" );
57
58 Set<String> required = new HashSet<String>();
59
60 required.add( archivePathFromProject( BASENAME, VERSION, "/pom.xml" ) );
61 required.add( archivePathFromProject( BASENAME, VERSION, "/LICENSE" ) );
62 required.add( archivePathFromProject( BASENAME, VERSION, "/DEPENDENCIES" ) );
63 required.add( archivePathFromProject( BASENAME, VERSION, "/NOTICE" ) );
64
65 Set<String> banned = new HashSet<String>();
66
67 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/LICENSE" ) );
68 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/DEPENDENCIES" ) );
69 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/NOTICE" ) );
70
71 banned.add( archivePathFromChild( BASENAME, VERSION, "child2", "/LICENSE" ) );
72 banned.add( archivePathFromChild( BASENAME, VERSION, "child2", "/DEPENDENCIES" ) );
73 banned.add( archivePathFromChild( BASENAME, VERSION, "child2", "/NOTICE" ) );
74
75 assertZipContents( required, banned, assembly );
76 }
77
78 }