configurator = (DefaultArchetypeGenerationConfigurator) lookup( ArchetypeGenerationConfigurator.ROLE );
MockControl control = MockControl.createControl( ArchetypeArtifactManager.class );
control.setDefaultMatcher( MockControl.ALWAYS_MATCHER );
ArchetypeArtifactManager manager = (ArchetypeArtifactManager) control.getMock();
manager.exists( "archetypeGroupId", "archetypeArtifactId", "archetypeVersion", null, null, null );
control.setReturnValue( true );
manager.isFileSetArchetype( "archetypeGroupId", "archetypeArtifactId", "archetypeVersion", null, null, null );
control.setReturnValue( false );
manager.isOldArchetype( "archetypeGroupId", "archetypeArtifactId", "archetypeVersion", null, null, null );
control.setReturnValue( true );
manager.getOldArchetypeDescriptor( "archetypeGroupId", "archetypeArtifactId", "archetypeVersion", null,
null, null );
control.setReturnValue( new ArchetypeDescriptor() );
control.replay();
configurator.setArchetypeArtifactManager( manager );
}