1 package org.apache.maven.artifact.installer;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24 import org.apache.maven.artifact.AbstractArtifactComponentTestCase;
25 import org.apache.maven.artifact.Artifact;
26
27
28
29
30
31 public class ArtifactInstallerTest
32 extends AbstractArtifactComponentTestCase
33 {
34 private ArtifactInstaller artifactInstaller;
35
36 protected void setUp()
37 throws Exception
38 {
39 super.setUp();
40
41 artifactInstaller = (ArtifactInstaller) lookup( ArtifactInstaller.ROLE );
42 }
43
44 protected String component()
45 {
46 return "installer";
47 }
48
49 public void testArtifactInstallation()
50 throws Exception
51 {
52 String artifactBasedir = new File( getBasedir(), "src/test/resources/artifact-install" ).getAbsolutePath();
53
54 Artifact artifact = createArtifact( "artifact", "1.0" );
55
56 File source = new File( artifactBasedir, "artifact-1.0.jar" );
57
58 artifactInstaller.install( source, artifact, localRepository() );
59
60 assertLocalArtifactPresent( artifact );
61 }
62 }