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 import org.apache.maven.shared.utils.io.FileUtils;
24
25 import java.io.File;
26 import java.io.IOException;
27 import java.util.Collections;
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 public class MavenITmng6957BuildConsumer
47 extends AbstractMavenIntegrationTestCase
48 {
49
50 public MavenITmng6957BuildConsumer()
51 {
52 super( "[4.0.0-alpha-1,)" );
53 }
54
55
56
57
58
59
60
61
62
63
64
65
66 public void testPublishedPoms()
67 throws Exception
68 {
69 File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6957-buildconsumer" );
70
71 Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
72 verifier.setMavenDebug( false );
73 verifier.setAutoclean( false );
74 verifier.addCliOption( "-Dchangelist=MNG6957" );
75
76 verifier.executeGoals( Collections.singletonList( "install" ) );
77 verifier.verifyErrorFreeLog();
78
79 assertTextEquals( new File( testDir, "expected/parent.pom"),
80 new File( verifier.getArtifactPath( "org.sonatype.mavenbook.multi", "parent", "0.9-MNG6957-SNAPSHOT", "pom" ) ) );
81
82 assertTextEquals( new File( testDir, "expected/simple-parent.pom"),
83 new File( verifier.getArtifactPath( "org.sonatype.mavenbook.multi", "simple-parent", "0.9-MNG6957-SNAPSHOT", "pom" ) ) );
84
85 assertTextEquals( new File( testDir, "expected/simple-weather.pom"),
86 new File( verifier.getArtifactPath( "org.sonatype.mavenbook.multi", "simple-weather", "0.9-MNG6957-SNAPSHOT", "pom" ) ) );
87
88 assertTextEquals( new File( testDir, "expected/simple-webapp.pom"),
89 new File( verifier.getArtifactPath( "org.sonatype.mavenbook.multi", "simple-webapp", "0.9-MNG6957-SNAPSHOT", "pom" ) ) );
90
91 assertTextEquals( new File( testDir, "expected/simple-testutils.pom"),
92 new File( verifier.getArtifactPath( "org.sonatype.mavenbook.multi", "simple-testutils", "0.9-MNG6957-SNAPSHOT", "pom" ) ) );
93
94 assertTextEquals( new File( testDir, "expected/utils-parent.pom"),
95 new File( verifier.getArtifactPath( "org.sonatype.mavenbook.multi", "utils-parent", "0.9-MNG6957-SNAPSHOT", "pom" ) ) );
96 }
97
98 static void assertTextEquals( File file1, File file2 )
99 throws IOException
100 {
101 assertEquals( FileUtils.loadFile( file1 ), FileUtils.loadFile( file2 ) );
102 }
103
104 }