package org.codehaus.mojo.natives.plugin;

import java.io.File;

import org.apache.maven.plugin.testing.AbstractMojoTestCase;

public class NativeLinkerMojoTest
    extends AbstractMojoTestCase
{
    public void testMojoLookup()
        throws Exception
    {
        File pluginXml = new File( getBasedir(), "src/test/resources/linker/plugin-config.xml" );
        NativeLinkMojo mojo = (NativeLinkMojo) lookupMojo( "link", pluginXml );
        assertNotNull( mojo );
    }

}

@@ -60,16 +60,402 @@
 .File;%0D%0A
+import java.util.ArrayList;%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.HashSet;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport org.apache.maven.artifact.Artifact;%0D%0Aimport org.apache.maven.artifact.DefaultArtifact;%0D%0Aimport org.apache.maven.artifact.handler.ArtifactHandler;%0D%0Aimport org.apache.maven.artifact.handler.DefaultArtifactHandler;%0D%0Aimport org.apache.maven.artifact.versioning.VersionRange;
 %0D%0Aimport
@@ -872,11 +872,1105 @@
    %7D%0D%0A%0D%0A
+    public void NotestExecute()%0D%0A        throws Exception%0D%0A    %7B%0D%0A        File pluginXml = new File( getBasedir(), %22src/test/resources/linker/plugin-config.xml%22 );%0D%0A        NativeLinkMojo mojo = (NativeLinkMojo) lookupMojo( %22link%22, pluginXml );%0D%0A        assertNotNull( mojo );%0D%0A        %0D%0A        //must init this%0D%0A        mojo.setPluginContext( new HashMap() );%0D%0A        %0D%0A        //simulate object files%0D%0A        List objectList = new ArrayList();%0D%0A        objectList.add( new File( %22o1.o%22 ) );%0D%0A        objectList.add( new File( %22o2.o%22 ) );%0D%0A        mojo.saveCompilerOutputFilePaths( objectList );%0D%0A        %0D%0A        //simulate artifact %0D%0A        ArtifactHandler artifactHandler = new DefaultArtifactHandler();%0D%0A        Artifact artifact = new DefaultArtifact( %22test%22, %22test%22, VersionRange.createFromVersion( %221.0-SNAPSHOT%22 ), %22compile%22, %22exe%22, null, artifactHandler );%0D%0A        mojo.getProject().setArtifact( artifact );%0D%0A%0D%0A        //simulate artifacts %0D%0A        mojo.getProject().setArtifacts( new HashSet() ); //no extern libs for now%0D%0A        %0D%0A        mojo.execute();%0D%0A         %0D%0A    %7D%0D%0A
 %7D%0D%0A

add another dummy test for Link Mojo