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