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