1 package org.apache.maven.plugin.javadoc.stubs;
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.artifact.Artifact;
23 import org.apache.maven.model.Build;
24 import org.apache.maven.plugin.testing.stubs.ArtifactStub;
25 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
26
27 import java.io.File;
28 import java.util.ArrayList;
29 import java.util.HashSet;
30 import java.util.List;
31 import java.util.Set;
32
33
34
35
36
37 public class ProxyTestMavenProjectStub
38 extends MavenProjectStub
39 {
40 private Set<Artifact> dependencyArtifacts = new HashSet<Artifact>();
41
42 public ProxyTestMavenProjectStub()
43 {
44 readModel( new File( getBasedir(), "proxy-test-plugin-config.xml" ) );
45
46 setGroupId( getModel().getGroupId() );
47 setArtifactId( getModel().getArtifactId() );
48 setVersion( getModel().getVersion() );
49 setName( getModel().getName() );
50 setUrl( getModel().getUrl() );
51 setPackaging( getModel().getPackaging() );
52
53 Build build = new Build();
54 build.setFinalName( getModel().getArtifactId() );
55 build.setSourceDirectory( getBasedir() + "/src/main/java" );
56 build.setDirectory( super.getBasedir() + "/target/test/unit/proxy-test/target" );
57 setBuild( build );
58
59 List<String> compileSourceRoots = new ArrayList<String>();
60 compileSourceRoots.add( getBasedir() + "/src/main/java" );
61 setCompileSourceRoots( compileSourceRoots );
62
63 ArtifactStub artifact = new ArtifactStub();
64 artifact.setGroupId( "commons-logging" );
65 artifact.setArtifactId( "commons-logging" );
66 artifact.setVersion( "1.1.1" );
67 artifact.setScope( Artifact.SCOPE_RUNTIME );
68 artifact.setType( "jar" );
69 artifact.setFile( getBasedir() );
70
71 dependencyArtifacts.add( artifact );
72 }
73
74
75 public File getBasedir()
76 {
77 return new File( super.getBasedir() + "/src/test/resources/unit/proxy-test" );
78 }
79
80 public Set<Artifact> getDependencyArtifacts()
81 {
82 return dependencyArtifacts;
83 }
84 }