/*-
 * Copyright (c) 2013 Red Hat, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.fedoraproject.maven.model;

import org.apache.maven.model.Model;
import org.codehaus.plexus.PlexusTestCase;

/**
 * @author Mikolaj Izdebski
 */
public class ModelProcessorTest
    extends PlexusTestCase
{
    /**
     * Test if Plexus can load processor component.
     * 
     * @throws Exception
     */
    public void testComponentLookup()
        throws Exception
    {
        ModelProcessor processor = lookup( ModelProcessor.class );
        assertNotNull( processor );
    }

    /**
     * Test if processor can apply identity transformation on empty model.
     * 
     * @throws Exception
     */
    public void testIdentityTransformation()
        throws Exception
    {
        ModelProcessor processor = lookup( ModelProcessor.class );
        processor.processModel( new Model(), new AbstractModelVisitor() );
    }
}

@@ -646,36 +646,198 @@
 ort 
-org.apache.maven.model.Model
+java.util.concurrent.Semaphore;%0A%0Aimport org.apache.maven.model.Dependency;%0Aimport org.apache.maven.model.Exclusion;%0Aimport org.apache.maven.model.Model;%0Aimport org.apache.maven.model.Profile
 ;%0Aim
@@ -1514,32 +1514,32 @@
 cessor.class );%0A
-
         processo
@@ -1602,11 +1602,1968 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Test if processor can retrieve information.%0A     * %0A     * @throws Exception%0A     */%0A    public void testInformationRetrieval()%0A        throws Exception%0A    %7B%0A        Model model = new Model();%0A%0A        Profile profile = new Profile();%0A        model.addProfile( profile );%0A%0A        Dependency dependency = new Dependency();%0A        profile.addDependency( dependency );%0A%0A        Exclusion exclusion = new Exclusion();%0A        exclusion.setArtifactId( %22foo%22 );%0A        dependency.addExclusion( exclusion );%0A%0A        Dependency dependency2 = new Dependency();%0A        model.addDependency( dependency2 );%0A%0A        Exclusion exclusion2 = new Exclusion();%0A        exclusion2.setArtifactId( %22bar%22 );%0A        dependency2.addExclusion( exclusion2 );%0A%0A        final Semaphore fooSemaphore = new Semaphore( 0 );%0A        final Semaphore barSemaphore = new Semaphore( 0 );%0A%0A        ModelProcessor processor = lookup( ModelProcessor.class );%0A        processor.processModel( model, new AbstractModelVisitor()%0A        %7B%0A            @Override%0A            public void visitDependencyExclusion( Exclusion exclusion )%0A            %7B%0A                assertEquals( %22bar%22, exclusion.getArtifactId() );%0A                barSemaphore.release();%0A            %7D%0A%0A            @Override%0A            public void visitProfileDependencyExclusion( Exclusion exclusion )%0A            %7B%0A                assertEquals( %22foo%22, exclusion.getArtifactId() );%0A                fooSemaphore.release();%0A            %7D%0A%0A            @Override%0A            public void visitBuildPluginDependencyExclusion( Exclusion exclusion )%0A            %7B%0A                fail();%0A            %7D%0A%0A            @Override%0A            public void visitBuildPluginManagementPluginDependencyExclusion( Exclusion exclusion )%0A            %7B%0A                fail();%0A            %7D%0A%0A        %7D );%0A%0A        assertEquals( 1, fooSemaphore.availablePermits() );%0A        assertEquals( 1, barSemaphore.availablePermits() );%0A    %7D
 %0A%7D%0A

Implement ModelProcessorTest.testInformationRetrieval()