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.Collections;
25 import java.util.HashSet;
26 import java.util.Set;
27
28 import org.apache.maven.it.VerificationException;
29 import org.apache.maven.it.Verifier;
30 import org.junit.Test;
31
32 import static org.apache.its.util.TestUtils.archivePathFromChild;
33 import static org.apache.its.util.TestUtils.archivePathFromProject;
34 import static org.apache.its.util.TestUtils.assertZipContents;
35 import static org.apache.its.util.TestUtils.getTestDir;
36
37 public class IT_004_IdeExcludes {
38
39 private static final String BASENAME = "ide-excludes";
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 = new Verifier(testDir.getAbsolutePath());
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 = Collections.emptySet();
56
57 Set<String> banned = new HashSet<String>();
58
59 banned.add(archivePathFromProject(BASENAME, VERSION, "/.classpath"));
60 banned.add(archivePathFromProject(BASENAME, VERSION, "/.project"));
61 banned.add(archivePathFromProject(BASENAME, VERSION, "/maven-eclipse.xml"));
62 banned.add(archivePathFromProject(BASENAME, VERSION, "/ide-excludes.iml"));
63 banned.add(archivePathFromProject(BASENAME, VERSION, "/ide-excludes.ipr"));
64 banned.add(archivePathFromProject(BASENAME, VERSION, "/ide-excludes.iws"));
65 banned.add(archivePathFromProject(BASENAME, VERSION, "/.deployables"));
66 banned.add(archivePathFromProject(BASENAME, VERSION, "/.settings"));
67 banned.add(archivePathFromProject(BASENAME, VERSION, "/.wtpmodules"));
68 banned.add(archivePathFromProject(BASENAME, VERSION, "/.externalToolBuilders"));
69
70 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/.classpath"));
71 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/.project"));
72 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/maven-eclipse.xml"));
73 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/.deployables"));
74 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/.settings"));
75 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/.wtpmodules"));
76 banned.add(archivePathFromChild(BASENAME, VERSION, "child1", "/.externalToolBuilders"));
77
78 banned.add(archivePathFromChild(BASENAME, VERSION, "child2", "/ide-excludes-child2.iml"));
79 banned.add(archivePathFromChild(BASENAME, VERSION, "child2", "/ide-excludes-child2.ipr"));
80 banned.add(archivePathFromChild(BASENAME, VERSION, "child2", "/ide-excludes-child2.iws"));
81
82 assertZipContents(required, banned, assembly);
83 }
84 }