@Test
public void testMP4ParsingAudio() throws Exception {

    Metadata metadata = new Metadata();
    String content = getText("testMP4.m4a", metadata);
    // Check core properties
    assertEquals("audio/mp4", metadata.get(Metadata.CONTENT_TYPE));
    assertEquals("Test Title", metadata.get(TikaCoreProperties.TITLE));
    assertEquals("Test Artist", metadata.get(TikaCoreProperties.CREATOR));
    assertEquals("2012-01-28T18:39:18Z", metadata.get(TikaCoreProperties.CREATED));
    assertEquals("2012-01-28T18:40:25Z", metadata.get(TikaCoreProperties.MODIFIED));
    // Check the textual contents
    assertContains("Test Title", content);
    assertContains("Test Artist", content);
    assertContains("Test Album", content);
    assertContains("2008", content);
    assertContains("Test Comment", content);
    assertContains("Test Genre", content);
    
    // Check XMPDM-typed audio properties
    assertEquals("Test Album", metadata.get(XMPDM.ALBUM));
    assertEquals("Test Artist", metadata.get(XMPDM.ARTIST));
    assertEquals("Test Composer", metadata.get(XMPDM.COMPOSER));
    assertEquals("2008", metadata.get(XMPDM.RELEASE_DATE));
    assertEquals("Test Genre", metadata.get(XMPDM.GENRE));
    assertEquals("Test Comments", metadata.get(XMPDM.LOG_COMMENT.getName()));
    assertEquals("1", metadata.get(XMPDM.TRACK_NUMBER));
    assertEquals("Test Album Artist", metadata.get(XMPDM.ALBUM_ARTIST));
    assertEquals("6", metadata.get(XMPDM.DISC_NUMBER));
    assertEquals("0", metadata.get(XMPDM.COMPILATION));
    
    
    assertEquals("44100", metadata.get(XMPDM.AUDIO_SAMPLE_RATE));
    assertEquals("Stereo", metadata.get(XMPDM.AUDIO_CHANNEL_TYPE));
    assertEquals("M4A", metadata.get(XMPDM.AUDIO_COMPRESSOR));
    assertEquals("0.07", metadata.get(XMPDM.DURATION));
    
    assertEquals("iTunes 10.5.3.3", metadata.get(XMP.CREATOR_TOOL));
    
    
    // Check again by file, rather than stream
    TikaInputStream tstream = TikaInputStream.get(
          MP4ParserTest.class.getResourceAsStream("/test-documents/testMP4.m4a"));
    tstream.getFile();
    ContentHandler handler = new BodyContentHandler();
    try {
       AUTO_DETECT_PARSER.parse(tstream, handler, metadata, new ParseContext());
    } finally {
       tstream.close();
    }
    //TODO: why don't we check the output here?
}