throws ArchiveCreationException, AssemblyFormattingException, IOException,
InvalidAssemblerConfigurationException
{
final MockManager mm = new MockManager();
final MockAndControlForAddDependencySetsTask macTask = new MockAndControlForAddDependencySetsTask( mm );
final ArtifactMock artifactMock = new ArtifactMock( mm, "group", "artifact", "version", "jar", false );
final File artifactFile = artifactMock.setNewFile();
macTask.expectCSGetFinalName( "final-name" );
macTask.expectGetDestFile( new File( "junk" ) );
macTask.expectAddFile( artifactFile, "out/artifact",
TypeConversionUtils.modeToInt( "777", new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) ) );
macTask.expectGetSession( null );
final ModuleBinaries binaries = new ModuleBinaries();
binaries.setUnpack( false );
binaries.setFileMode( "777" );
binaries.setOutputDirectory( "out" );
binaries.setOutputFileNameMapping( "artifact" );
final DependencySet ds = new DependencySet();
ds.setUseProjectArtifact( false );
ds.setOutputDirectory( binaries.getOutputDirectory() );
ds.setOutputFileNameMapping( "${artifact.artifactId}" );
ds.setFileMode( "777" );
binaries.addDependencySet( ds );
final MavenProject project = createProject( "group", "artifact", "version", null );
project.setArtifact( artifactMock.getArtifact() );
final ArtifactMock depArtifactMock = new ArtifactMock( mm, "group", "dep", "1", "jar", false );
final File depArtifactFile = depArtifactMock.setNewFile();
macTask.expectAddFile( depArtifactFile, "out/dep",
TypeConversionUtils.modeToInt( "777", new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) ) );
final MavenProject depProject = createProject( "group", "dep", "version", null );
depProject.setArtifact( depArtifactMock.getArtifact() );
macTask.expectBuildFromRepository( depProject );
macTask.expectCSGetRepositories( null, null );
final Set<MavenProject> projects = Collections.singleton( project );
mm.replayAll();