@@ -0,0 +1,2871 @@
+/*-%0A * Copyright (c) 2014 Red Hat, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.fedoraproject.xmvn.mojo;%0A%0Aimport static org.easymock.EasyMock.replay;%0Aimport static org.easymock.EasyMock.verify;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.io.File;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.Collections;%0A%0Aimport org.easymock.EasyMockRunner;%0Aimport org.easymock.Mock;%0Aimport org.easymock.MockType;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport org.fedoraproject.xmvn.artifact.Artifact;%0Aimport org.fedoraproject.xmvn.deployer.Deployer;%0Aimport org.fedoraproject.xmvn.deployer.DeploymentRequest;%0Aimport org.fedoraproject.xmvn.deployer.DeploymentResult;%0A%0A/**%0A * Test if non-POM modules which have no artifact file are handled properly.%0A * %0A * @author Mikolaj Izdebski%0A */%0A@RunWith( EasyMockRunner.class )%0Apublic class NullFileInstallationTest%0A    extends AbstractInstallMojoTest%0A%7B%0A    boolean deployed;%0A%0A    @Mock( type = MockType.NICE )%0A    DeploymentResult result;%0A%0A    Path pomPath = Paths.get( %22/some/non/existent.path%22 );%0A%0A    class DeployerMock%0A        implements Deployer%0A    %7B%0A        @Override%0A        public DeploymentResult deploy( DeploymentRequest request )%0A        %7B%0A            assertFalse( deployed );%0A            deployed = true;%0A%0A            Artifact artifact = request.getArtifact();%0A            assertNotNull( artifact );%0A            assertEquals( %22pom%22, artifact.getExtension() );%0A            assertEquals( pomPath, artifact.getPath() );%0A            return result;%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected File getArtifactFile()%0A        throws Exception%0A    %7B%0A        return null;%0A    %7D%0A%0A    @Test%0A    public void testNullFileInstallation()%0A        throws Exception%0A    %7B%0A        setMojoMockExpectations();%0A        replay( result );%0A%0A        getProject().setArtifact( getArtifact() );%0A        getProject().setFile( pomPath.toFile() );%0A%0A        InstallMojo mojo = new InstallMojo( new DeployerMock() );%0A        mojo.setReactorProjects( Collections.singletonList( getProject() ) );%0A        deployed = false;%0A        mojo.execute();%0A        assertTrue( deployed );%0A%0A        verify( result );%0A        verifyMojoMocks();%0A    %7D%0A%7D%0A

Add test for installation of projects with no artifact file