1 package org.apache.maven.plugin.war.stub;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import org.apache.maven.model.Organization;
23 import org.apache.maven.project.MavenProject;
24
25 import java.io.File;
26 import java.util.HashSet;
27 import java.util.Properties;
28 import java.util.Set;
29
30 /**
31 * Stub
32 */
33 public class MavenProjectBasicStub
34 extends MavenProject
35 {
36 protected String testRootDir;
37
38 protected Properties properties;
39
40 public MavenProjectBasicStub()
41 throws Exception
42 {
43 super( new ModelStub() );
44 properties = new Properties();
45 }
46
47 public Set getArtifacts()
48 {
49 return new HashSet();
50 }
51
52 public String getName()
53 {
54 return "Test Project ";
55 }
56
57 public File getBasedir()
58 {
59 // create an isolated environment
60 // see setupTestEnvironment for details
61 //return new File( testRootDir );
62 return null;
63 }
64
65 public String getGroupId()
66 {
67 return "org.apache.maven.plugin.test";
68 }
69
70 public String getArtifactId()
71 {
72 return "maven-war-plugin-test";
73 }
74
75 public String getPackaging()
76 {
77 return "jar";
78 }
79
80 public String getVersion()
81 {
82 return "0.0-Test";
83 }
84
85 public void addProperty( String key, String value )
86 {
87 properties.put( key, value );
88 }
89
90 public Properties getProperties()
91 {
92 return properties;
93 }
94
95 public String getDescription()
96 {
97 return "Test Description";
98 }
99
100 public Organization getOrganization()
101 {
102 return new Organization()
103 {
104 public String getName()
105 {
106 return "Test Name";
107 }
108 };
109 }
110
111 }