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