final File testDir = new File(System.getProperty("java.io.tmpdir"),
"AtomTestCase");
BioUtils.delete(testDir, true);
testDir.mkdir();
final Service atomService = new Service(
"clap://class/org/restlet/test/ext/atom/service.xml");
assertEquals("AtomPub Test Site", atomService.getWorkspaces().get(0)
.getTitle());
assertEquals("entry", atomService.getWorkspaces().get(0)
.getCollections().get(0).getTitle());
final Feed atomFeed = atomService.getWorkspaces().get(0)
.getCollections().get(0).getFeed();
// Write the feed into a file.
final File feedFile = new File(testDir, "feed.xml");
atomFeed.write(new BufferedOutputStream(new FileOutputStream(feedFile)));