// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MSBuildMojoITHelper.java
// static void addPropertiesToVerifier( Verifier verifier ) throws IOException
// {
//     Properties props = new Properties();
//     props.load( MSBuildMojoITHelper.class.getResourceAsStream( VERIFIER_PROPERTIES_FILE ) );
//     Properties systemProps = verifier.getSystemProperties();
//     systemProps.putAll( props );
//     verifier.setSystemProperties( systemProps );
// }
// 
// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MSBuildMojoITHelper.java
// static void assertDirectoryContents( File directory, int expectedCount, List<String> expectedFiles )
// {
//     assertTrue ( "Expected output directory missing: " + directory.getAbsolutePath(), directory.exists() );
//     List<String> dirContents = Arrays.asList( directory.list() );
//     if ( expectedCount != -1 )
//     {
//         assertEquals( expectedCount, dirContents.size() );
//     }
//     for ( String fileName: expectedFiles )
//     {
//         assertTrue( "Expected file missing: " + fileName, dirContents.contains( fileName ) );
//     }
// }
// 
// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MSBuildMojoITHelper.java
// static File calculateAndDeleteOutputDirectory( File parent, String name ) throws IOException
// {
//     File result = new File( parent, name );
//     if ( result.exists() )
//     {
//         for ( File content : result.listFiles() )
//         {
//             // NOTE: No attempt to recurse, shouldn't ever be needed!
//             if ( !content.delete() )
//             {
//                 throw new IOException( "Failed to delete " +  content.getAbsolutePath() );
//             }
//         }
//         if ( !result.delete() )
//         {
//             throw new IOException( "Failed to delete " +  result.getAbsolutePath() );
//         }
//     }
// 
//     return result;
// }


import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.Arrays;
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import org.junit.Test;
import static uk.org.raje.maven.plugin.msbuild.it.MSBuildMojoITHelper.addPropertiesToVerifier;
import static uk.org.raje.maven.plugin.msbuild.it.MSBuildMojoITHelper.assertDirectoryContents;
import static uk.org.raje.maven.plugin.msbuild.it.MSBuildMojoITHelper.calculateAndDeleteOutputDirectory;
        verifier.deleteArtifacts( GROUPID, SOLUTION_ARTIFACTID, VERSION );

        verifier.executeGoal( "install" );
        verifier.verifyErrorFreeLog();
        assertDirectoryContents( win32ReleaseDir, 5, Arrays.asList( new String[]
                {"output-directory-test.exe", "output-directory-test.iobj", "output-directory-test-lib.lib",
                 "output-directory-test.ipdb", "output-directory-test.pdb"} ) );
        assertDirectoryContents( win32DebugDir, 5, Arrays.asList( new String[]
                {"output-directory-test.exe", "output-directory-test.ilk", "output-directory-test.pdb",
                 "output-directory-test-lib.lib", "output-directory-test-lib.pdb"} ) );

        File artifactsDir = new File(
                verifier.getArtifactMetadataPath( GROUPID, SOLUTION_ARTIFACTID, VERSION ) ).getParentFile();
        assertDirectoryContents( artifactsDir, 5, Arrays.asList( new String[]{
                SOLUTION_ARTIFACTID + "-" + VERSION + ".pom",
                SOLUTION_ARTIFACTID + "-" + VERSION + "-Win32-Release.zip",
                SOLUTION_ARTIFACTID + "-" + VERSION + "-Win32-Debug.zip"} ) );

        verifier.resetStreams();

        verifier.executeGoal( "clean" );
        verifier.verifyErrorFreeLog();
        assertEquals( 0, win32ReleaseDir.list().length );
        assertEquals( 0, win32DebugDir.list().length );
    }

    @Test
    public void testLibProjectBuild() throws Exception
    {
        File testDir = ResourceExtractor.simpleExtractResources( getClass(),
// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MSBuildMojoITHelper.java
// static void addPropertiesToVerifier( Verifier verifier ) throws IOException
// {
//     Properties props = new Properties();
//     props.load( MSBuildMojoITHelper.class.getResourceAsStream( VERIFIER_PROPERTIES_FILE ) );
//     Properties systemProps = verifier.getSystemProperties();
//     systemProps.putAll( props );
//     verifier.setSystemProperties( systemProps );
// }
// 
// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MSBuildMojoITHelper.java
// static void assertDirectoryContents( File directory, int expectedCount, List<String> expectedFiles )
// {
//     assertTrue ( "Expected output directory missing: " + directory.getAbsolutePath(), directory.exists() );
//     List<String> dirContents = Arrays.asList( directory.list() );
//     if ( expectedCount != -1 )
//     {
//         assertEquals( expectedCount, dirContents.size() );
//     }
//     for ( String fileName: expectedFiles )
//     {
//         assertTrue( "Expected file missing: " + fileName, dirContents.contains( fileName ) );
//     }
// }
// 
// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MSBuildMojoITHelper.java
// static File calculateAndDeleteOutputDirectory( File parent, String name ) throws IOException
// {
//     File result = new File( parent, name );
//     if ( result.exists() )
//     {
//         for ( File content : result.listFiles() )
//         {
//             // NOTE: No attempt to recurse, shouldn't ever be needed!
//             if ( !content.delete() )
//             {
//                 throw new IOException( "Failed to delete " +  content.getAbsolutePath() );
//             }
//         }
//         if ( !result.delete() )
//         {
//             throw new IOException( "Failed to delete " +  result.getAbsolutePath() );
//         }
//     }
// 
//     return result;
// }


// Path: msbuild-maven-plugin-it/src/test/java/uk/org/raje/maven/plugin/msbuild/it/MavenITOutputDirectoryTest.java
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.Arrays;
import org.apache.maven.it.Verifier;
import org.apache.maven.it.util.ResourceExtractor;
import org.junit.Test;
import static uk.org.raje.maven.plugin.msbuild.it.MSBuildMojoITHelper.addPropertiesToVerifier;
import static uk.org.raje.maven.plugin.msbuild.it.MSBuildMojoITHelper.assertDirectoryContents;
import static uk.org.raje.maven.plugin.msbuild.it.MSBuildMojoITHelper.calculateAndDeleteOutputDirectory;

        verifier.deleteArtifacts( GROUPID, SOLUTION_ARTIFACTID, VERSION );

        verifier.executeGoal( "install" );
        verifier.verifyErrorFreeLog();
        assertDirectoryContents( win32ReleaseDir, 5, Arrays.asList( new String[]
                {"output-directory-test.exe", "output-directory-test.iobj", "output-directory-test-lib.lib",
                 "output-directory-test.ipdb", "output-directory-test.pdb"} ) );
        assertDirectoryContents( win32DebugDir, 5, Arrays.asList( new String[]
                {"output-directory-test.exe", "output-directory-test.ilk", "output-directory-test.pdb",
                 "output-directory-test-lib.lib", "output-directory-test-lib.pdb"} ) );

        File artifactsDir = new File(
                verifier.getArtifactMetadataPath( GROUPID, SOLUTION_ARTIFACTID, VERSION ) ).getParentFile();
        assertDirectoryContents( artifactsDir, 5, Arrays.asList( new String[]{
                SOLUTION_ARTIFACTID + "-" + VERSION + ".pom",
                SOLUTION_ARTIFACTID + "-" + VERSION + "-Win32-Release.zip",
                SOLUTION_ARTIFACTID + "-" + VERSION + "-Win32-Debug.zip"} ) );

        verifier.resetStreams();

        verifier.executeGoal( "clean" );
        verifier.verifyErrorFreeLog();
        assertEquals( 0, win32ReleaseDir.list().length );
        assertEquals( 0, win32DebugDir.list().length );
    }

    @Test
    public void testLibProjectBuild() throws Exception
    {
        File testDir = ResourceExtractor.simpleExtractResources( getClass(),
                "/output-directory-test/output-directory-test-lib" );