use of org.codehaus.plexus.archiver.diags.TrackingArchiver in project maven-plugins by apache.
the class AssemblyProxyArchiverTest method addFileSet_SkipWhenSourceIsAssemblyWorkDir.
@Test(timeout = 5000)
public void addFileSet_SkipWhenSourceIsAssemblyWorkDir() throws IOException, ArchiverException {
final File sources = fileManager.createTempDir();
final File workdir = new File(sources, "workdir");
final TrackingArchiver tracker = new TrackingArchiver();
final AssemblyProxyArchiver archiver = new AssemblyProxyArchiver("", tracker, null, null, null, workdir, logger);
archiver.setForced(true);
final DefaultFileSet fs = new DefaultFileSet();
fs.setDirectory(workdir);
archiver.addFileSet(fs);
assertTrue(tracker.added.isEmpty());
}
use of org.codehaus.plexus.archiver.diags.TrackingArchiver in project maven-plugins by apache.
the class AssemblyProxyArchiverTest method addFileSet_addExcludeWhenSourceContainsAssemblyWorkDir.
@Test(timeout = 5000)
public void addFileSet_addExcludeWhenSourceContainsAssemblyWorkDir() throws IOException, ArchiverException {
final File sources = fileManager.createTempDir();
final File workdir = new File(sources, "workdir");
workdir.mkdir();
fileManager.createFile(sources, "test-included.txt", "This is included");
fileManager.createFile(workdir, "test-excluded.txt", "This is excluded");
final TrackingArchiver tracker = new TrackingArchiver();
final AssemblyProxyArchiver archiver = new AssemblyProxyArchiver("", tracker, null, null, null, workdir, logger);
archiver.setForced(true);
final DefaultFileSet fs = new DefaultFileSet();
fs.setDirectory(sources);
archiver.addFileSet(fs);
assertEquals(1, tracker.added.size());
final TrackingArchiver.Addition addition = tracker.added.get(0);
assertNotNull(addition.excludes);
assertEquals(1, addition.excludes.length);
assertEquals(workdir.getName(), addition.excludes[0]);
}
Aggregations