public void testId3v2() throws ProtocolException, ParseException {
String urlString;
Protocol protocol;
Content content;
Parse parse;
Configuration conf = NutchConfiguration.create();
urlString = "file:" + sampleDir + fileSeparator + id3v2;
protocol = new ProtocolFactory(conf).getProtocol(urlString);
content = protocol.getProtocolOutput(new Text(urlString), new CrawlDatum())
.getContent();
parse = new ParseUtil(conf).parseByExtensionId("parse-mp3", content);
Metadata metadata = parse.getData().getParseMeta();
assertEquals("postgresql comment id3v2", metadata.get("COMM-Text"));
assertEquals("postgresql composer id3v2", metadata.get("TCOM-Text"));
assertEquals("02", metadata.get("TRCK-Text"));
assertEquals("http://localhost/", metadata.get("WCOP-URL Link"));
assertEquals("postgresql artist id3v2", metadata.get("TPE1-Text"));
assertEquals("(28)", metadata.get("TCON-Text"));
assertEquals("2004", metadata.get("TYER-Text"));
assertEquals("postgresql title id3v2", metadata.get("TIT2-Text"));
assertEquals("postgresql album id3v2", metadata.get("TALB-Text"));
assertEquals("postgresql encoded by id3v2", metadata.get("TENC-Text"));
assertEquals("postgresql title id3v2 - "
+ "postgresql album id3v2 - "
+ "postgresql artist id3v2", parse.getData().getTitle());
assertEquals("http://localhost/", parse.getData().getOutlinks()[0].getToUrl());
}