1 package org.apache.maven.it;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.it.util.ResourceExtractor;
23
24 import java.io.File;
25 import java.util.Collection;
26
27
28
29
30
31
32
33
34
35 public class MavenITmng2921ActiveAttachedArtifactsTest
36 extends AbstractMavenIntegrationTestCase
37 {
38
39 public MavenITmng2921ActiveAttachedArtifactsTest()
40 {
41 super( "(2.0.6,)" );
42 }
43
44
45
46
47
48
49
50
51
52
53
54 public void testitMNG2921()
55 throws Exception
56 {
57 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2921" );
58 Verifier verifier = newVerifier( testDir.getAbsolutePath() );
59 verifier.setAutoclean( false );
60 verifier.deleteDirectory( "consumer/target" );
61 verifier.executeGoal( "validate" );
62 verifier.verifyErrorFreeLog();
63 verifier.resetStreams();
64
65 Collection<String> compileArtifacts = verifier.loadLines( "consumer/target/compile.txt", "UTF-8" );
66 assertTrue( compileArtifacts.toString(),
67 compileArtifacts.contains( "org.apache.maven.its.mng2921:ejbs:ejb-client:client:1.0-SNAPSHOT" ) );
68 assertTrue( compileArtifacts.toString(),
69 compileArtifacts.contains( "org.apache.maven.its.mng2921:producer:ejb-client:client:1.0-SNAPSHOT" ) );
70 assertFalse( compileArtifacts.toString(),
71 compileArtifacts.contains( "org.apache.maven.its.mng2921:tests:test-jar:tests:1.0-SNAPSHOT" ) );
72 assertFalse( compileArtifacts.toString(),
73 compileArtifacts.contains( "org.apache.maven.its.mng2921:producer:test-jar:tests:1.0-SNAPSHOT" ) );
74
75 Collection<String> testArtifacts = verifier.loadLines( "consumer/target/test.txt", "UTF-8" );
76 assertTrue( testArtifacts.toString(),
77 testArtifacts.contains( "org.apache.maven.its.mng2921:ejbs:ejb-client:client:1.0-SNAPSHOT" ) );
78 assertTrue( testArtifacts.toString(),
79 testArtifacts.contains( "org.apache.maven.its.mng2921:producer:ejb-client:client:1.0-SNAPSHOT" ) );
80 assertTrue( testArtifacts.toString(),
81 testArtifacts.contains( "org.apache.maven.its.mng2921:tests:test-jar:tests:1.0-SNAPSHOT" ) );
82 assertTrue( testArtifacts.toString(),
83 testArtifacts.contains( "org.apache.maven.its.mng2921:producer:test-jar:tests:1.0-SNAPSHOT" ) );
84
85 Collection<String> testClassPath = verifier.loadLines( "consumer/target/test-classpath.txt", "UTF-8" );
86 assertTrue( testClassPath.toString(), testClassPath.contains( "ejbs/attached.jar" ) );
87 assertTrue( testClassPath.toString(), testClassPath.contains( "tests/attached.jar" ) );
88 assertTrue( testClassPath.toString(), testClassPath.contains( "producer/client.jar" ) );
89 assertTrue( testClassPath.toString(), testClassPath.contains( "producer/tests.jar" ) );
90 }
91
92 }