View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugin.eclipse.it;
20  
21  import java.io.File;
22  import java.util.Properties;
23  
24  import org.codehaus.plexus.util.FileUtils;
25  
26  /**
27   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
28   * @author <a href="mailto:berrach@apache.org">Barrie Treloar</a>
29   */
30  public class RadPluginIT
31      extends AbstractEclipsePluginIT
32  {
33      public void testProject1()
34          throws Exception
35      {
36          testProject( "project-rad-1", new Properties(), "rad-clean", "rad" );
37      }
38  
39      public void testProject2()
40          throws Exception
41      {
42          testProject( "project-rad-2", new Properties(), "rad-clean", "rad" );
43      }
44  
45      public void testProject3()
46          throws Exception
47      {
48          testProject( "project-rad-3", new Properties(), "rad-clean", "rad" );
49      }
50  
51      public void testProject4()
52          throws Exception
53      {
54          testProject( "project-rad-4", new Properties(), "rad-clean", "rad" );
55      }
56  
57      public void testProject5()
58          throws Exception
59      {
60          File basedir = getTestFile( "target/test-classes/projects/project-rad-5" );
61          FileUtils.deleteDirectory( new File( basedir, "project-rad-1/META-INF" ) );
62          new File( basedir, "project-rad-1/META-INF" ).mkdirs();
63          testProject( "project-rad-5", new Properties(), "rad-clean", "rad", true );
64      }
65  
66      public void testProject6()
67          throws Exception
68      {
69          testProject( "project-rad-6", new Properties(), "rad-clean", "rad" );
70      }
71  
72      /**
73       * Tests warSourceDirectory setting to be reflected in generated .websettings, location of jars in WEB-INF/lib and
74       * generation of MANIFEST.MF at the right place
75       * 
76       * @throws Exception
77       */
78      public void testProject7()
79          throws Exception
80      {
81          testProject( "project-rad-7", new Properties(), "rad-clean", "rad" );
82          assertFalse(
83                       "Default path should not exist because it is overridden!",
84                       new File( getTestFile( "target/test-classes/projects/project-rad-7" ), "/src/main/webapp" ).exists() );
85  
86      }
87  
88      public void testProject8()
89          throws Exception
90      {
91          testProject( "project-rad-8", new Properties(), "rad-clean", "rad" );
92      }
93  }