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
27 public class MavenITmng5387ArtifactReplacementPlugin
28 extends AbstractMavenIntegrationTestCase
29 {
30
31 private File testDir;
32
33 public MavenITmng5387ArtifactReplacementPlugin()
34 {
35 super( "[3.1,)" );
36 }
37
38 public void setUp()
39 throws Exception
40 {
41 super.setUp();
42
43 testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5387" );
44
45 }
46
47 protected void tearDown()
48 throws Exception
49 {
50
51 super.tearDown();
52 }
53
54 public void testArtifactReplacementExecution()
55 throws Exception
56 {
57 Verifier v0 = newVerifier( testDir.getAbsolutePath(), "remote" );
58 v0.setAutoclean( false );
59 v0.deleteDirectory( "target" );
60 v0.deleteArtifacts( "org.apache.maven.its.mng5387" );
61 v0.executeGoal( "install" );
62 v0.verifyErrorFreeLog();
63 v0.resetStreams();
64
65 String path = v0.getArtifactPath( "org.apache.maven.its.mng5387", "mng5387-it", "0.0.1-SNAPSHOT", "txt", "c" );
66 String contents = FileUtils.fileRead( new File( path ), "utf-8" );
67 assertTrue( contents.contains( "This is the second file" ) );
68 }
69 }