KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > artifact > installer > ArtifactInstallerTest


1 package org.apache.maven.artifact.installer;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.maven.artifact.AbstractArtifactComponentTestCase;
20 import org.apache.maven.artifact.Artifact;
21
22 import java.io.File JavaDoc;
23
24 /**
25  * @author <a HREF="mailto:jason@maven.org">Jason van Zyl</a>
26  * @version $Id: ArtifactInstallerTest.java 293493 2005-10-04 02:26:25Z brett $
27  */

28 public class ArtifactInstallerTest
29     extends AbstractArtifactComponentTestCase
30 {
31     private ArtifactInstaller artifactInstaller;
32
33     protected void setUp()
34         throws Exception JavaDoc
35     {
36         super.setUp();
37
38         artifactInstaller = (ArtifactInstaller) lookup( ArtifactInstaller.ROLE );
39     }
40
41     protected String JavaDoc component()
42     {
43         return "installer";
44     }
45
46     public void testArtifactInstallation()
47         throws Exception JavaDoc
48     {
49         String JavaDoc artifactBasedir = new File JavaDoc( getBasedir(), "src/test/resources/artifact-install" ).getAbsolutePath();
50
51         Artifact artifact = createArtifact( "artifact", "1.0" );
52
53         File JavaDoc source = new File JavaDoc( artifactBasedir, "artifact-1.0.jar" );
54
55         artifactInstaller.install( source, artifact, localRepository() );
56
57         assertLocalArtifactPresent( artifact );
58     }
59 }
Popular Tags