*/
public void testRule()
throws IOException
{
ArtifactStubFactory factory = new ArtifactStubFactory();
MockProject project = new MockProject();
EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
project.setArtifacts( factory.getMixedArtifacts() );
project.setDependencyArtifacts( factory.getScopedArtifacts() );
RequireReleaseDeps rule = new RequireReleaseDeps();
rule.setSearchTransitive( false );
TestEnforcerRuleUtils.execute( rule, helper, false );
rule.setSearchTransitive( true );
TestEnforcerRuleUtils.execute( rule, helper, true );
// test onlyWhenRelease in each case
project.setArtifact( factory.getSnapshotArtifact() );
TestEnforcerRuleUtils.execute( rule, helper, true );
rule.onlyWhenRelease = true;
TestEnforcerRuleUtils.execute( rule, helper, false );
project.setArtifact( factory.getReleaseArtifact() );
TestEnforcerRuleUtils.execute( rule, helper, true );
MockProject parent = new MockProject();
parent.setArtifact( factory.getSnapshotArtifact() );
project.setParent( parent );
project.setArtifacts( null );
project.setDependencyArtifacts( null );
helper = EnforcerTestUtils.getHelper(project);