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 MinMavenProjectStub
38 extends org.apache.maven.plugin.testing.stubs.MavenProjectStub
39 {
40
41 public List<String> getCompileClasspathElements()
42 throws DependencyResolutionRequiredException
43 {
44 return Collections.singletonList( PlexusTestCase.getBasedir() + "/target/classes" );
45 }
46
47
48 public List<String> getTestClasspathElements()
49 throws DependencyResolutionRequiredException
50 {
51 List<String> list = new ArrayList<String>( getCompileClasspathElements() );
52 list.add( PlexusTestCase.getBasedir() + "/target/test-classes" );
53 return list;
54 }
55
56
57 public File getBasedir()
58 {
59 return new File( PlexusTestCase.getBasedir() );
60 }
61
62
63 public List<ReportPlugin> getReportPlugins()
64 {
65 ReportPlugin jxrPlugin = new ReportPlugin();
66
67 jxrPlugin.setArtifactId( "maven-jxr-plugin" );
68
69 return Collections.singletonList( jxrPlugin );
70 }
71
72
73 public Organization getOrganization()
74 {
75 Organization organization = new Organization();
76
77 organization.setName( "maven-plugin-tests" );
78
79 return organization;
80 }
81
82
83 public String getInceptionYear()
84 {
85 return "2006";
86 }
87
88
89 public Build getBuild()
90 {
91 Build build = new Build();
92
93 build.setDirectory( PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/min" );
94
95 return build;
96 }
97
98
99 public File getFile()
100 {
101 File file = new File( getBasedir(), "pom.xml" );
102
103 return file;
104 }
105 }