~ubuntu-branches/ubuntu/wily/maven-enforcer/wily

« back to all changes in this revision

Viewing changes to enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseVersion.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-12 22:30:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110912223016-e2pk04avoq8bur7t
Tags: 1.0-1
* Team upload
* New upstream release.
* Add more Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.apache.maven.plugins.enforcer;
 
2
 
1
3
/*
2
4
 * Licensed to the Apache Software Foundation (ASF) under one
3
5
 * or more contributor license agreements.  See the NOTICE file
16
18
 * specific language governing permissions and limitations
17
19
 * under the License.
18
20
 */
19
 
package org.apache.maven.plugins.enforcer;
20
21
 
21
22
import java.io.IOException;
22
23
 
30
31
// TODO: Auto-generated Javadoc
31
32
/**
32
33
 * The Class TestRequireReleaseVersion.
33
 
 * 
 
34
 *
34
35
 * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
35
36
 */
36
37
public class TestRequireReleaseVersion
39
40
 
40
41
    /**
41
42
     * Test mojo.
42
 
     * 
 
43
     *
43
44
     * @throws IOException Signals that an I/O exception has occurred.
44
45
     */
45
46
    public void testMojo()
58
59
        project.setArtifact( factory.getSnapshotArtifact() );
59
60
 
60
61
        TestEnforcerRuleUtils.execute( rule, helper, true );
61
 
    
 
62
 
62
63
        project.setArtifact( factory.getReleaseArtifact() );
63
 
        
 
64
 
64
65
        MockProject parent = new MockProject();
65
66
        parent.setArtifact( factory.getSnapshotArtifact() );
66
67
        project.setParent( parent );
67
68
        helper = EnforcerTestUtils.getHelper(project);
68
 
         
 
69
 
69
70
        ( (RequireReleaseVersion) rule ).setFailWhenParentIsSnapshot( true );
70
71
        TestEnforcerRuleUtils.execute( rule, helper, true );
71
 
        
 
72
 
72
73
        ( (RequireReleaseVersion) rule ).setFailWhenParentIsSnapshot( false );
73
74
        TestEnforcerRuleUtils.execute( rule, helper, false );
74
75