}
public void testReadAssembly_ShouldReadAssemblyWithSiteDirInclusionFromAssemblyWithoutComponentsOrInterpolation()
throws IOException, AssemblyReadException, InvalidAssemblerConfigurationException
{
final Assembly assembly = new Assembly();
assembly.setId( "test" );
assembly.setIncludeSiteDirectory( true );
final StringWriter sw = new StringWriter();
final AssemblyXpp3Writer assemblyWriter = new AssemblyXpp3Writer();
assemblyWriter.write( sw, assembly );
final StringReader sr = new StringReader( sw.toString() );
final File siteDir = fileManager.createTempDir();
configSource.getSiteDirectory();
configSourceControl.setReturnValue( siteDir, MockControl.ZERO_OR_MORE );
final File basedir = fileManager.createTempDir();
configSource.getBasedir();
configSourceControl.setReturnValue( basedir, MockControl.ZERO_OR_MORE );
final Model model = new Model();
model.setGroupId( "group" );
model.setArtifactId( "artifact" );
model.setVersion( "version" );
final MavenProject project = new MavenProject( model );
configSource.getProject();
configSourceControl.setReturnValue( project, MockControl.ZERO_OR_MORE );
configSource.isSiteIncluded();
configSourceControl.setReturnValue( false, MockControl.ZERO_OR_MORE );
mockManager.replayAll();
final Assembly result = new DefaultAssemblyReader().readAssembly( sr, "testLocation", null, configSource );
assertEquals( assembly.getId(), result.getId() );
final List<FileSet> fileSets = result.getFileSets();
assertEquals( 1, fileSets.size() );
assertEquals( "/site", fileSets.get( 0 )
.getOutputDirectory() );