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