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.Collections;
35 import java.util.HashSet;
36 import java.util.Set;
37
38 public class IT_004_IdeExcludes
39 {
40
41 private static final String BASENAME = "ide-excludes";
42 private static final String VERSION = "1";
43
44 @Test
45 public void execute()
46 throws VerificationException, IOException, URISyntaxException
47 {
48 File testDir = getTestDir( BASENAME );
49
50 Verifier verifier = new Verifier( testDir.getAbsolutePath() );
51
52 verifier.executeGoal( "package" );
53
54 verifier.verifyErrorFreeLog();
55 verifier.resetStreams();
56
57 File assembly = new File( testDir, "target/" + BASENAME + "-" + VERSION + "-source-release.zip" );
58
59 Set<String> required = Collections.emptySet();
60
61 Set<String> banned = new HashSet<String>();
62
63 banned.add( archivePathFromProject( BASENAME, VERSION, "/.classpath" ) );
64 banned.add( archivePathFromProject( BASENAME, VERSION, "/.project" ) );
65 banned.add( archivePathFromProject( BASENAME, VERSION, "/maven-eclipse.xml" ) );
66 banned.add( archivePathFromProject( BASENAME, VERSION, "/ide-excludes.iml" ) );
67 banned.add( archivePathFromProject( BASENAME, VERSION, "/ide-excludes.ipr" ) );
68 banned.add( archivePathFromProject( BASENAME, VERSION, "/ide-excludes.iws" ) );
69 banned.add( archivePathFromProject( BASENAME, VERSION, "/.deployables" ) );
70 banned.add( archivePathFromProject( BASENAME, VERSION, "/.settings" ) );
71 banned.add( archivePathFromProject( BASENAME, VERSION, "/.wtpmodules" ) );
72 banned.add( archivePathFromProject( BASENAME, VERSION, "/.externalToolBuilders" ) );
73
74 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/.classpath" ) );
75 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/.project" ) );
76 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/maven-eclipse.xml" ) );
77 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/.deployables" ) );
78 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/.settings" ) );
79 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/.wtpmodules" ) );
80 banned.add( archivePathFromChild( BASENAME, VERSION, "child1", "/.externalToolBuilders" ) );
81
82 banned.add( archivePathFromChild( BASENAME, VERSION, "child2", "/ide-excludes-child2.iml" ) );
83 banned.add( archivePathFromChild( BASENAME, VERSION, "child2", "/ide-excludes-child2.ipr" ) );
84 banned.add( archivePathFromChild( BASENAME, VERSION, "child2", "/ide-excludes-child2.iws" ) );
85
86 assertZipContents( required, banned, assembly );
87 }
88
89 }