use of org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddFileSetsTask in project maven-plugins by apache.
the class FileSetAssemblyPhaseTest method testShouldNotFailWhenNoFileSetsSpecified.
public void testShouldNotFailWhenNoFileSetsSpecified() throws ArchiveCreationException, AssemblyFormattingException {
final Assembly assembly = new Assembly();
assembly.setId("test");
final MockAndControlForLogger macLogger = new MockAndControlForLogger();
final MockAndControlForAddFileSetsTask macTask = new MockAndControlForAddFileSetsTask(mm, fileManager);
mm.replayAll();
createPhase(macLogger).execute(assembly, macTask.archiver, macTask.configSource);
mm.verifyAll();
}
use of org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddFileSetsTask in project maven-plugins by apache.
the class FileSetAssemblyPhaseTest method testShouldAddOneFileSet.
public void testShouldAddOneFileSet() throws ArchiveCreationException, AssemblyFormattingException {
final Assembly assembly = new Assembly();
assembly.setId("test");
assembly.setIncludeBaseDirectory(false);
final FileSet fs = new FileSet();
fs.setOutputDirectory("/out");
fs.setDirectory("/input");
fs.setFileMode("777");
fs.setDirectoryMode("777");
assembly.addFileSet(fs);
final MockAndControlForLogger macLogger = new MockAndControlForLogger();
final MockAndControlForAddFileSetsTask macTask = new MockAndControlForAddFileSetsTask(mm, fileManager);
macTask.expectGetArchiveBaseDirectory();
final MavenProject project = new MavenProject(new Model());
macLogger.expectError(true, true);
final int dirMode = Integer.parseInt("777", 8);
final int fileMode = Integer.parseInt("777", 8);
final int[] modes = { -1, -1, dirMode, fileMode };
macTask.expectAdditionOfSingleFileSet(project, "final-name", false, modes, 1, true);
DefaultAssemblyArchiverTest.setupInterpolators(macTask.configSource);
mm.replayAll();
createPhase(macLogger).execute(assembly, macTask.archiver, macTask.configSource);
mm.verifyAll();
}
use of org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddFileSetsTask in project maven-plugins by apache.
the class AddFileSetsTaskTest method setUp.
@Override
public void setUp() {
mockManager = new EasyMockSupport();
fileManager = new TestFileManager("add-fileset.test.", "");
macTask = new MockAndControlForAddFileSetsTask(mockManager, fileManager);
}
use of org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddFileSetsTask in project maven-plugins by apache.
the class ModuleSetAssemblyPhaseTest method testAddModuleSourceFileSets_ShouldAddOneSourceDirectory.
public void testAddModuleSourceFileSets_ShouldAddOneSourceDirectory() throws ArchiveCreationException, AssemblyFormattingException {
final EasyMockSupport mm = new EasyMockSupport();
final MockAndControlForAddFileSetsTask macTask = new MockAndControlForAddFileSetsTask(mm, fileManager);
final MavenProject project = createProject("group", "artifact", "version", null);
macTask.expectGetProject(project);
final ArtifactMock artifactMock = new ArtifactMock(mm, "group", "artifact", "version", "jar", false);
project.setArtifact(artifactMock.getArtifact());
final Set<MavenProject> projects = singleton(project);
final ModuleSources sources = new ModuleSources();
final FileSet fs = new FileSet();
fs.setDirectory("/src");
fs.setDirectoryMode("777");
fs.setFileMode("777");
sources.addFileSet(fs);
macTask.expectGetArchiveBaseDirectory();
final int mode = TypeConversionUtils.modeToInt("777", new ConsoleLogger(Logger.LEVEL_DEBUG, "test"));
final int[] modes = { -1, -1, mode, mode };
macTask.expectAdditionOfSingleFileSet(project, "final-name", false, modes, 1, true, false);
DefaultAssemblyArchiverTest.setupInterpolators(macTask.configSource);
mm.replayAll();
final Logger logger = new ConsoleLogger(Logger.LEVEL_DEBUG, "test");
createPhase(logger, null).addModuleSourceFileSets(sources, projects, macTask.archiver, macTask.configSource);
mm.verifyAll();
}
Aggregations