### Question:
MappingTrackArchiver extends TrackingArchiver { public AssemblyFiles getAssemblyFiles(MavenSession session) { AssemblyFiles ret = new AssemblyFiles(new File(getDestFile().getParentFile(), assemblyName)); for (Addition addition : added) { Object resource = addition.resource; File target = new File(ret.getAssemblyDirectory(), addition.destination); if (resource instanceof File && addition.destination != null) { addFileEntry(ret, session, (File) resource, target); } else if (resource instanceof PlexusIoFileResource) { addFileEntry(ret, session, ((PlexusIoFileResource) resource).getFile(), target); } else if (resource instanceof FileSet) { FileSet fs = (FileSet) resource; DirectoryScanner ds = new DirectoryScanner(); File base = addition.directory; ds.setBasedir(base); ds.setIncludes(fs.getIncludes()); ds.setExcludes(fs.getExcludes()); ds.setCaseSensitive(fs.isCaseSensitive()); ds.scan(); for (String f : ds.getIncludedFiles()) { File source = new File(base, f); File subTarget = new File(target, f); addFileEntry(ret, session, source, subTarget); } } else { throw new IllegalStateException("Unknown resource type " + resource.getClass() + ": " + resource); } } return ret; }  AssemblyFiles getAssemblyFiles(MavenSession session); void init(KitLogger log, String assemblyName);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void noDirectory() throws Exception { archiver.setDestFile(new File(".")); archiver.addDirectory(new File(System.getProperty("user.home")), "tmp"); AssemblyFiles files = archiver.getAssemblyFiles(session); }
@Test public void simple() throws Exception { archiver.setDestFile(new File("target/test-data/maven.tracker")); new File(archiver.getDestFile(), "maven").mkdirs(); File tempFile = File.createTempFile("tracker", "txt"); File destination = new File("target/test-data/maven/test.txt"); org.codehaus.plexus.util.FileUtils.copyFile(tempFile, destination); archiver.addFile(tempFile, "test.txt"); AssemblyFiles files = archiver.getAssemblyFiles(session); assertNotNull(files); List<AssemblyFiles.Entry> entries = files.getUpdatedEntriesAndRefresh(); assertEquals(0, entries.size()); Thread.sleep(1000); FileUtils.touch(tempFile); entries = files.getUpdatedEntriesAndRefresh(); assertEquals(1, entries.size()); AssemblyFiles.Entry entry = entries.get(0); assertEquals(tempFile, entry.getSrcFile()); assertEquals(destination, entry.getDestFile()); }