// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static void dumpModel( final Model model )
//     throws IOException
// {
//     final StringWriter writer = new StringWriter();
//     new MavenXpp3Writer().write( writer, model );
// 
//     System.out.println( "\n\n" + writer.toString() + "\n\n" );
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static File getResourceFile( final String path )
// {
//     final URL resource = Thread.currentThread()
//                                .getContextClassLoader()
//                                .getResource( path );
//     if ( resource == null )
//     {
//         fail( "Resource not found: " + path );
//     }
// 
//     return new File( resource.getPath() );
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static Model loadModel( final String path )
//     throws IOException
// {
//     final File pom = getResourceFile( path );
//     return loadModel( pom );
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static Set<Model> loadModels( final Set<File> poms )
//     throws VManException, IOException
// {
//     final Set<Model> models = new LinkedHashSet<Model>( poms.size() );
//     for ( final File pom : poms )
//     {
//         models.add( loadModel( pom ) );
//     }
// 
//     return models;
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static VersionManagerSession newVersionManagerSession( final File workspace, final File reports, final String suffix, final String modifier )
// {
//     return new SessionBuilder( workspace, reports ).withVersionSuffix( suffix )
//                                                    .withVersionModifier( modifier )
//                                                    .build();
// }


import static com.redhat.rcm.version.testutil.TestProjectFixture.dumpModel;
import static com.redhat.rcm.version.testutil.TestProjectFixture.getResourceFile;
import static com.redhat.rcm.version.testutil.TestProjectFixture.loadModel;
import static com.redhat.rcm.version.testutil.TestProjectFixture.loadModels;
import static com.redhat.rcm.version.testutil.TestProjectFixture.newVersionManagerSession;
import static org.apache.commons.io.FileUtils.copyDirectory;
import static org.apache.commons.io.FileUtils.copyFile;
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.apache.maven.mae.project.key.FullProjectKey;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.project.MavenProject;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.redhat.rcm.version.fixture.LoggingFixture;
import com.redhat.rcm.version.mgr.mod.VersionSuffixModder;
import com.redhat.rcm.version.mgr.session.VersionManagerSession;
import com.redhat.rcm.version.model.Project;
    @Test
    public void adjustMultiple_BothVersions_ChildHasSeparateVersion()
        throws Throwable
    {
        final String path = "modules-separateVersions/pom.xml";

        final Map<FullProjectKey, Project> result =
            adjustMultiple( "Adjust both POMs when parent and child have separate versions", path );

        FullProjectKey key = new FullProjectKey( "test", "parent", "1" + SUFFIX );
        Project project = result.get( key );

        assertThat( "Parent POM cannot be found in result map: " + key, project, notNullValue() );
        assertThat( "Parent has wrong version!", project.getModel()
                                                        .getVersion(), equalTo( key.getVersion() ) );

        key = new FullProjectKey( "test", "child", "2" + SUFFIX );
        project = result.get( key );

        assertThat( "Child POM cannot be found in result map: " + key, project, notNullValue() );
        assertParent( project.getModel(), null, null, "1" + SUFFIX, true );
        assertThat( "Child has wrong version!", project.getModel()
                                                       .getVersion(), equalTo( key.getVersion() ) );
    }

    @Test
    public void dontAdjustVersion_InheritedVersion_ToolchainParent()
        throws Throwable
    {
        final String path = "child-inheritedVersion-1.0.pom";
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static void dumpModel( final Model model )
//     throws IOException
// {
//     final StringWriter writer = new StringWriter();
//     new MavenXpp3Writer().write( writer, model );
// 
//     System.out.println( "\n\n" + writer.toString() + "\n\n" );
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static File getResourceFile( final String path )
// {
//     final URL resource = Thread.currentThread()
//                                .getContextClassLoader()
//                                .getResource( path );
//     if ( resource == null )
//     {
//         fail( "Resource not found: " + path );
//     }
// 
//     return new File( resource.getPath() );
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static Model loadModel( final String path )
//     throws IOException
// {
//     final File pom = getResourceFile( path );
//     return loadModel( pom );
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static Set<Model> loadModels( final Set<File> poms )
//     throws VManException, IOException
// {
//     final Set<Model> models = new LinkedHashSet<Model>( poms.size() );
//     for ( final File pom : poms )
//     {
//         models.add( loadModel( pom ) );
//     }
// 
//     return models;
// }
// 
// Path: src/test/java/com/redhat/rcm/version/testutil/TestProjectFixture.java
// public static VersionManagerSession newVersionManagerSession( final File workspace, final File reports, final String suffix, final String modifier )
// {
//     return new SessionBuilder( workspace, reports ).withVersionSuffix( suffix )
//                                                    .withVersionModifier( modifier )
//                                                    .build();
// }


// Path: src/test/java/com/redhat/rcm/version/mgr/VersionSuffixManagementTest.java
import static com.redhat.rcm.version.testutil.TestProjectFixture.dumpModel;
import static com.redhat.rcm.version.testutil.TestProjectFixture.getResourceFile;
import static com.redhat.rcm.version.testutil.TestProjectFixture.loadModel;
import static com.redhat.rcm.version.testutil.TestProjectFixture.loadModels;
import static com.redhat.rcm.version.testutil.TestProjectFixture.newVersionManagerSession;
import static org.apache.commons.io.FileUtils.copyDirectory;
import static org.apache.commons.io.FileUtils.copyFile;
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.apache.maven.mae.project.key.FullProjectKey;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.project.MavenProject;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.redhat.rcm.version.fixture.LoggingFixture;
import com.redhat.rcm.version.mgr.mod.VersionSuffixModder;
import com.redhat.rcm.version.mgr.session.VersionManagerSession;
import com.redhat.rcm.version.model.Project;

    @Test
    public void adjustMultiple_BothVersions_ChildHasSeparateVersion()
        throws Throwable
    {
        final String path = "modules-separateVersions/pom.xml";

        final Map<FullProjectKey, Project> result =
            adjustMultiple( "Adjust both POMs when parent and child have separate versions", path );

        FullProjectKey key = new FullProjectKey( "test", "parent", "1" + SUFFIX );
        Project project = result.get( key );

        assertThat( "Parent POM cannot be found in result map: " + key, project, notNullValue() );
        assertThat( "Parent has wrong version!", project.getModel()
                                                        .getVersion(), equalTo( key.getVersion() ) );

        key = new FullProjectKey( "test", "child", "2" + SUFFIX );
        project = result.get( key );

        assertThat( "Child POM cannot be found in result map: " + key, project, notNullValue() );
        assertParent( project.getModel(), null, null, "1" + SUFFIX, true );
        assertThat( "Child has wrong version!", project.getModel()
                                                       .getVersion(), equalTo( key.getVersion() ) );
    }

    @Test
    public void dontAdjustVersion_InheritedVersion_ToolchainParent()
        throws Throwable
    {
        final String path = "child-inheritedVersion-1.0.pom";
        final Model original = loadModel( TEST_POMS + path );