View Javadoc

1   package org.apache.maven.it;
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 java.io.File;
23  
24  import org.apache.maven.it.Verifier;
25  import org.apache.maven.it.util.ResourceExtractor;
26  
27  /**
28   * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3331">MNG-3331</a>.
29   * 
30   * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
31   * 
32   */
33  public class MavenITmng3331ModulePathNormalizationTest
34      extends AbstractMavenIntegrationTestCase
35  {
36      public MavenITmng3331ModulePathNormalizationTest()
37      {
38          super( ALL_MAVEN_VERSIONS );
39      }
40  
41      public void testitMNG3331a ()
42          throws Exception
43      {
44          //testMNG3331ModuleWithSpaces
45          File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3331/with-spaces" );
46  
47          Verifier verifier;
48  
49          verifier = newVerifier( testDir.getAbsolutePath() );
50  
51          verifier.executeGoal( "initialize" );
52  
53          /*
54           * This is the simplest way to check a build
55           * succeeded. It is also the simplest way to create
56           * an IT test: make the build pass when the test
57           * should pass, and make the build fail when the
58           * test should fail. There are other methods
59           * supported by the verifier. They can be seen here:
60           * http://maven.apache.org/shared/maven-verifier/apidocs/index.html
61           */
62          verifier.verifyErrorFreeLog();
63  
64          /*
65           * Reset the streams before executing the verifier
66           * again.
67           */
68          verifier.resetStreams();
69      }
70  
71      public void testitMNG3331b ()
72          throws Exception
73      {
74          //testMNG3331ModuleWithRelativeParentDirRef
75          File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3331/with-relative-parentDir-ref" );
76  
77          Verifier verifier;
78  
79          verifier = newVerifier( new File( testDir, "parent" ).getAbsolutePath() );
80  
81          verifier.executeGoal( "initialize" );
82  
83          /*
84           * This is the simplest way to check a build
85           * succeeded. It is also the simplest way to create
86           * an IT test: make the build pass when the test
87           * should pass, and make the build fail when the
88           * test should fail. There are other methods
89           * supported by the verifier. They can be seen here:
90           * http://maven.apache.org/shared/maven-verifier/apidocs/index.html
91           */
92          verifier.verifyErrorFreeLog();
93  
94          /*
95           * Reset the streams before executing the verifier
96           * again.
97           */
98          verifier.resetStreams();
99      }
100 
101 }