Package org.apache.maven.enforcer.rule.api

Examples of org.apache.maven.enforcer.rule.api.EnforcerRuleHelper


    @Test
    public void validateCorrectPom() throws Exception {

        // Assemble
        final MavenProject project = MavenTestUtils.readPom("testdata/poms/tools-parent.xml");
        final EnforcerRuleHelper mockHelper = new MockEnforcerRuleHelper(project);
        final ValidateProjectType unitUnderTest = new ValidateProjectType();

        // Act & Assert
        unitUnderTest.execute(mockHelper);
    }
View Full Code Here


    @Test
    public void validateTestProjectTypePom() throws Exception {

        // Assemble
        final MavenProject project = MavenTestUtils.readPom("testdata/poms/osgi-test-pom.xml");
        final EnforcerRuleHelper mockHelper = new MockEnforcerRuleHelper(project);
        final ValidateProjectType unitUnderTest = new ValidateProjectType();

        // Act & Assert
        unitUnderTest.execute(mockHelper);
    }
View Full Code Here

    @Test
    public void validateAspectPom() throws Exception {

        // Assemble
        final MavenProject project = MavenTestUtils.readPom("testdata/poms/aspect-project.xml");
        final EnforcerRuleHelper mockHelper = new MockEnforcerRuleHelper(project);
        final ValidateProjectType unitUnderTest = new ValidateProjectType();

        // Act & Assert
        unitUnderTest.execute(mockHelper);
    }
View Full Code Here

    @Test(expected = EnforcerRuleException.class)
    public void validateExceptionOnParentPomWithModules() throws Exception {

        // Assemble
        final MavenProject project = MavenTestUtils.readPom("testdata/poms/incorrect-parent-with-modules.xml");
        final EnforcerRuleHelper mockHelper = new MockEnforcerRuleHelper(project);
        final ValidateProjectType unitUnderTest = new ValidateProjectType();

        // Act & Assert
        unitUnderTest.execute(mockHelper);
    }
View Full Code Here

                "testdata/project/incorrect/src/main/java");
        Assert.assertNotNull("compileSourceRoot not found", compileSourceRoot);

        project.addCompileSourceRoot(compileSourceRoot.getPath());

        final EnforcerRuleHelper mockHelper = new MockEnforcerRuleHelper(project);

        final CorrectPackagingRule unitUnderTest = new CorrectPackagingRule();

        // Act & Assert
        try {
View Full Code Here

        EvaluateBeanshell rule = new EvaluateBeanshell();
        // this property should not be set
        rule.condition = "${env} == \"This is a test.\"";
        rule.message = "We have a variable : ${env}";

        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
        rule.execute( helper );
    }
View Full Code Here

        rule.condition = "${env} == null";
        rule.message = "We have a variable : ${env}";

        try
        {
            EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
            rule.execute( helper );
            fail( "Expected an exception." );
        }
        catch ( EnforcerRuleException e )
        {
View Full Code Here

        // this property should be set by the surefire
        // plugin
        rule.condition = "${env} == null";
        try
        {
            EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
            rule.execute( helper );
            fail( "Expected an exception." );
        }
        catch ( EnforcerRuleException e )
        {
View Full Code Here

            ExpressionEvaluator eval = (ExpressionEvaluator) evalControl.getMock();
            eval.evaluate( rule.condition );
            evalControl.expectAndDefaultThrow( null, new ExpressionEvaluationException( "expected error" ) );
            evalControl.replay();

            EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project, eval );
            rule.execute( helper );
            fail( "Expected an exception." );
        }
        catch ( EnforcerRuleException e )
        {
View Full Code Here

        EvaluateBeanshell rule = new EvaluateBeanshell();
        rule.condition = "this is not valid beanshell";
        rule.message = "We have a variable : ${env}";
        try
        {
            EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
            rule.execute( helper );
            fail( "Expected an exception." );
        }
        catch ( EnforcerRuleException e )
        {
View Full Code Here

TOP

Related Classes of org.apache.maven.enforcer.rule.api.EnforcerRuleHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.