1 package org.apache.maven.plugin.checkstyle.stubs;
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 import java.util.Collections;
24 import java.util.List;
25
26 import org.apache.maven.artifact.DependencyResolutionRequiredException;
27 import org.apache.maven.model.Build;
28 import org.apache.maven.model.Organization;
29 import org.apache.maven.model.ReportPlugin;
30 import org.apache.maven.project.MavenProject;
31 import org.codehaus.plexus.PlexusTestCase;
32
33
34
35
36 public class MultiMavenProjectStub
37 extends org.apache.maven.plugin.testing.stubs.MavenProjectStub
38 {
39
40 public MultiMavenProjectStub()
41 {
42 setExecutionRoot( true );
43 }
44
45 @Override
46 public MavenProject getExecutionProject()
47 {
48 return this;
49 }
50
51
52 public List<String> getCompileClasspathElements()
53 throws DependencyResolutionRequiredException
54 {
55 return Collections.EMPTY_LIST;
56 }
57
58
59 public List<String> getTestClasspathElements()
60 throws DependencyResolutionRequiredException
61 {
62 return Collections.EMPTY_LIST;
63 }
64
65
66 public File getBasedir()
67 {
68 return new File( PlexusTestCase.getBasedir() );
69 }
70
71
72 public List<ReportPlugin> getReportPlugins()
73 {
74 ReportPlugin jxrPlugin = new ReportPlugin();
75
76 jxrPlugin.setArtifactId( "maven-jxr-plugin" );
77
78 return Collections.singletonList( jxrPlugin );
79 }
80
81
82 public Organization getOrganization()
83 {
84 Organization organization = new Organization();
85
86 organization.setName( "maven-plugin-tests" );
87
88 return organization;
89 }
90
91
92 public String getInceptionYear()
93 {
94 return "2006";
95 }
96
97
98 public Build getBuild()
99 {
100 Build build = new Build();
101
102 build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/multi" );
103
104 return build;
105 }
106
107
108 public File getFile()
109 {
110 File file = new File( getBasedir(), "pom.xml" );
111
112 return file;
113 }
114 }