finally
{
IOUtil.close( fw );
}
final Assembly assembly = new Assembly();
assembly.setId( "test" );
assembly.addComponentDescriptor( componentsFilename );
final StringWriter sw = new StringWriter();
final AssemblyXpp3Writer assemblyWriter = new AssemblyXpp3Writer();
assemblyWriter.write( sw, assembly );
final StringReader sr = new StringReader( sw.toString() );
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( "/dir", fileSets.get( 0 )
.getDirectory() );