{
final RepositoryItemUid uid1 = testRepository.createUid("/obr/samples/sample.xml");
final RepositoryItemUid uid2 = testRepository.createUid("/obr/sample.xml");
final RepositoryItemUid uid3 = testRepository.createUid("/sample.xml");
ObrResourceReader reader = obrMetadataSource.getReader(openObrSite(uid1));
ObrResourceWriter writer = obrMetadataSource.getWriter(uid2);
final Collection<URL> urls = new ArrayList<URL>();
Resource r;
while ((r = reader.readResource()) != null) {
urls.add(r.getURL());
writer.append(r);
writer.flush();
}
reader.close();
writer.complete();
writer.close();
reader = obrMetadataSource.getReader(openObrSite(uid2));
writer = obrMetadataSource.getWriter(uid3);
while ((r = reader.readResource()) != null) {
writer.append(r);
}
reader.close();
writer.complete();
writer.close();
reader = obrMetadataSource.getReader(openObrSite(uid3));
while ((r = reader.readResource()) != null) {
urls.remove(r.getURL());
}
reader.close();
assertEquals(Collections.emptyList(), urls);
}