use of org.apache.maven.plugins.assembly.model.ModuleSources in project maven-plugins by apache.
the class ModuleSetAssemblyPhaseTest method testIsDeprecatedModuleSourcesConfigPresent_ShouldNotCatchDirMode.
public void testIsDeprecatedModuleSourcesConfigPresent_ShouldNotCatchDirMode() {
final ModuleSources sources = new ModuleSources();
sources.setDirectoryMode("777");
final ModuleSetAssemblyPhase phase = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null);
assertFalse(phase.isDeprecatedModuleSourcesConfigPresent(sources));
}
use of org.apache.maven.plugins.assembly.model.ModuleSources in project maven-plugins by apache.
the class ModuleSetAssemblyPhaseTest method testIsDeprecatedModuleSourcesConfigPresent_ShouldCatchExclude.
public void testIsDeprecatedModuleSourcesConfigPresent_ShouldCatchExclude() {
final ModuleSources sources = new ModuleSources();
sources.addExclude("**/excluded.txt");
final ModuleSetAssemblyPhase phase = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null);
assertTrue(phase.isDeprecatedModuleSourcesConfigPresent(sources));
}
use of org.apache.maven.plugins.assembly.model.ModuleSources in project maven-plugins by apache.
the class ModuleSetAssemblyPhaseTest method testCreateFileSet_ShouldPrependModuleDirWhenOutDirIsProvided.
public void testCreateFileSet_ShouldPrependModuleDirWhenOutDirIsProvided() throws AssemblyFormattingException {
final EasyMockSupport mm = new EasyMockSupport();
final Model model = new Model();
model.setArtifactId("artifact");
final MavenProject project = new MavenProject(model);
final MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask(mm, project);
macTask.expectGetFinalName(null);
final FileSet fs = new FileSet();
fs.setOutputDirectory("out");
final ModuleSources sources = new ModuleSources();
sources.setIncludeModuleDirectory(true);
final MavenProject artifactProject = new MavenProject(new Model());
final File basedir = fileManager.createTempDir();
artifactProject.setFile(new File(basedir, "pom.xml"));
final ArtifactMock artifactMock = new ArtifactMock(mm, "group", "artifact", "version", "jar", false);
artifactProject.setArtifact(artifactMock.getArtifact());
DefaultAssemblyArchiverTest.setupInterpolators(macTask.configSource);
mm.replayAll();
final FileSet result = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null).createFileSet(fs, sources, artifactProject, macTask.configSource);
assertEquals("artifact/out/", result.getOutputDirectory());
mm.verifyAll();
}
use of org.apache.maven.plugins.assembly.model.ModuleSources in project maven-plugins by apache.
the class ModuleSetAssemblyPhaseTest method testIsDeprecatedModuleSourcesConfigPresent_ShouldNotCatchFileMode.
public void testIsDeprecatedModuleSourcesConfigPresent_ShouldNotCatchFileMode() {
final ModuleSources sources = new ModuleSources();
sources.setFileMode("777");
final ModuleSetAssemblyPhase phase = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null);
assertFalse(phase.isDeprecatedModuleSourcesConfigPresent(sources));
}
use of org.apache.maven.plugins.assembly.model.ModuleSources in project maven-plugins by apache.
the class ModuleSetAssemblyPhaseTest method testCreateFileSet_ShouldAddExcludesForSubModulesWhenExcludeSubModDirsIsTrue.
public void testCreateFileSet_ShouldAddExcludesForSubModulesWhenExcludeSubModDirsIsTrue() throws AssemblyFormattingException {
final EasyMockSupport mm = new EasyMockSupport();
final MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask(mm, null);
macTask.expectGetFinalName(null);
final FileSet fs = new FileSet();
final ModuleSources sources = new ModuleSources();
sources.setExcludeSubModuleDirectories(true);
final Model model = new Model();
model.setArtifactId("artifact");
model.addModule("submodule");
final MavenProject project = new MavenProject(model);
final File basedir = fileManager.createTempDir();
project.setFile(new File(basedir, "pom.xml"));
final ArtifactMock artifactMock = new ArtifactMock(mm, "group", "artifact", "version", "jar", false);
project.setArtifact(artifactMock.getArtifact());
DefaultAssemblyArchiverTest.setupInterpolators(macTask.configSource);
mm.replayAll();
final FileSet result = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null).createFileSet(fs, sources, project, macTask.configSource);
assertEquals(1, result.getExcludes().size());
assertEquals("submodule/**", result.getExcludes().get(0));
mm.verifyAll();
}
Aggregations