1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.testing;
20
21 import java.util.List;
22
23 import org.apache.maven.artifact.Artifact;
24 import org.apache.maven.plugin.MojoExecution;
25
26 public class PluginArtifactFileTest extends AbstractMojoTestCase {
27 private static final String FS = System.getProperty("file.separator");
28
29 public void testArtifact() throws Exception {
30 MojoExecution execution = newMojoExecution("parameters");
31
32 List<Artifact> artifacts =
33 execution.getMojoDescriptor().getPluginDescriptor().getArtifacts();
34
35 assertEquals(1, artifacts.size());
36
37 Artifact artifact = artifacts.get(0);
38 assertEquals("test", artifact.getGroupId());
39 assertEquals("test-plugin", artifact.getArtifactId());
40 assertEquals("0.0.1-SNAPSHOT", artifact.getBaseVersion());
41 assertTrue(artifact.getFile().getAbsolutePath().endsWith(FS + "target" + FS + "test-classes"));
42 }
43
44
45 }