1 package org.apache.maven.plugin.war.stub;
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.HashSet;
24 import java.util.Properties;
25 import java.util.Set;
26
27 import org.apache.maven.artifact.Artifact;
28 import org.apache.maven.model.Build;
29 import org.apache.maven.model.Organization;
30 import org.apache.maven.project.MavenProject;
31
32
33
34
35 public class MavenProjectBasicStub
36 extends MavenProject
37 {
38 protected String testRootDir;
39
40 protected Properties properties;
41
42 public MavenProjectBasicStub()
43 throws Exception
44 {
45 super( new ModelStub() );
46 properties = new Properties();
47 }
48
49 public Set<Artifact> getArtifacts()
50 {
51 return new HashSet<Artifact>();
52 }
53
54 public String getName()
55 {
56 return "Test Project ";
57 }
58
59 public File getBasedir()
60 {
61
62
63
64 return null;
65 }
66
67 public String getGroupId()
68 {
69 return "org.apache.maven.plugin.test";
70 }
71
72 public String getArtifactId()
73 {
74 return "maven-war-plugin-test";
75 }
76
77 public String getPackaging()
78 {
79 return "jar";
80 }
81
82 public String getVersion()
83 {
84 return "0.0-Test";
85 }
86
87 public void addProperty( String key, String value )
88 {
89 properties.put( key, value );
90 }
91
92 public Properties getProperties()
93 {
94 return properties;
95 }
96
97 public String getDescription()
98 {
99 return "Test Description";
100 }
101
102 public Organization getOrganization()
103 {
104 return new Organization()
105 {
106 public String getName()
107 {
108 return "Test Name";
109 }
110 };
111 }
112
113 @Override
114 public Build getBuild()
115 {
116 Build build = super.getBuild();
117
118 build.setDirectory( System.getProperty( "project.build.directory" ) );
119
120 return build;
121 }
122 }