public void testAddAllreadyExistingWithReplaceFalse() throws Exception {
final String archivename = "zip";
File input = this.createArchive(archivename);
ArchiveOutputStream out = null;
ArchiveInputStream ais = null;
File result = File.createTempFile("test", "."+archivename);
result.deleteOnExit();
try {
final InputStream is = new FileInputStream(input);
ais = factory.createArchiveInputStream(archivename, is);
out = factory.createArchiveOutputStream(archivename,
new FileOutputStream(result));
ChangeSet changes = new ChangeSet();
final File file1 = getFile("test.txt");
ArchiveEntry entry = new ZipArchiveEntry("testdata/test1.xml");
changes.add(entry, new FileInputStream(file1), false);
ChangeSetPerformer performer = new ChangeSetPerformer(changes);
ChangeSetResults results = performer.perform(ais, out);
assertTrue(results.getAddedFromStream().contains("testdata/test1.xml"));
assertTrue(results.getAddedFromChangeSet().size() == 0);
assertTrue(results.getDeleted().size() == 0);
is.close();
} finally {
if (out != null)
out.close();
if (ais != null)
ais.close();
}
this.checkArchiveContent(result, archiveList);
}