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 MavenITmng6656BuildConsumer
47 extends AbstractMavenIntegrationTestCase
48 {
49
50 public MavenITmng6656BuildConsumer()
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-6656-buildconsumer" );
70
71 Verifier verifier = newVerifier( testDir.getAbsolutePath(), false );
72 verifier.setMavenDebug( false );
73 verifier.setAutoclean( false );
74 verifier.addCliOption( "-Dchangelist=MNG6656" );
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-MNG6656-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-MNG6656-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-MNG6656-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-MNG6656-SNAPSHOT", "pom" ) ) );
90 }
91
92 static void assertTextEquals( File file1, File file2 )
93 throws IOException
94 {
95 assertEquals( FileUtils.loadFile( file1 ), FileUtils.loadFile( file2 ) );
96 }
97
98 }