1 package org.apache.maven.plugins.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 CheckstyleProjectStub
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.emptyList();
56 }
57
58
59 public List<String> getTestClasspathElements()
60 throws DependencyResolutionRequiredException
61 {
62 return Collections.emptyList();
63 }
64
65
66 public List<String> getCompileSourceRoots()
67 {
68 return Collections.emptyList();
69 }
70
71
72 public List<String> getTestCompileSourceRoots()
73 {
74 return Collections.emptyList();
75 }
76
77
78 public File getBasedir()
79 {
80 return new File( PlexusTestCase.getBasedir() );
81 }
82
83
84 public List<ReportPlugin> getReportPlugins()
85 {
86 ReportPlugin jxrPlugin = new ReportPlugin();
87
88 jxrPlugin.setArtifactId( "maven-jxr-plugin" );
89
90 return Collections.singletonList( jxrPlugin );
91 }
92
93
94 public Organization getOrganization()
95 {
96 Organization organization = new Organization();
97
98 organization.setName( "maven-plugin-tests" );
99
100 return organization;
101 }
102
103
104 public String getInceptionYear()
105 {
106 return "2006";
107 }
108
109
110 public Build getBuild()
111 {
112 Build build = new Build();
113
114 build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/multi" );
115
116 return build;
117 }
118
119
120 public File getFile()
121 {
122 File file = new File( getBasedir(), "pom.xml" );
123
124 return file;
125 }
126 }