* Tests that a file with both lyrics and
* ID3v2 tags gets both extracted correctly
*/
@Test
public void testMp3ParsingLyrics() throws Exception {
Parser parser = new AutoDetectParser(); // Should auto-detect!
ContentHandler handler = new BodyContentHandler();
Metadata metadata = new Metadata();
// Note - our test file has a lyrics tag, but lacks any
// lyrics in the tags, so we can't test that bit
// TODO Find a better sample file
InputStream stream = Mp3ParserTest.class.getResourceAsStream(
"/test-documents/testMP3lyrics.mp3");
try {
parser.parse(stream, handler, metadata, new ParseContext());
} finally {
stream.close();
}
assertEquals("audio/mpeg", metadata.get(Metadata.CONTENT_TYPE));