@Test
public void testEmbedded() throws Exception {

   ContentHandler handler = new BodyContentHandler();
   Metadata metadata = new Metadata();
    try (InputStream stream = RarParserTest.class.getResourceAsStream(
            "/test-documents/test-documents.rar")) {
        AUTO_DETECT_PARSER.parse(stream, handler, metadata, trackingContext);
    }
   
   // Should have found all 9 documents, but not the directory
   assertEquals(9, tracker.filenames.size());
   assertEquals(9, tracker.mediatypes.size());
   assertEquals(9, tracker.modifiedAts.size());
   
   // Should have names but not content types, as rar doesn't
   //  store the content types
   assertEquals("test-documents/testEXCEL.xls", tracker.filenames.get(0));
   assertEquals("test-documents/testHTML.html", tracker.filenames.get(1));
   assertEquals("test-documents/testOpenOffice2.odt", tracker.filenames.get(2));
   assertEquals("test-documents/testPDF.pdf", tracker.filenames.get(3));
   assertEquals("test-documents/testPPT.ppt", tracker.filenames.get(4));
   assertEquals("test-documents/testRTF.rtf", tracker.filenames.get(5));
   assertEquals("test-documents/testTXT.txt", tracker.filenames.get(6));
   assertEquals("test-documents/testWORD.doc", tracker.filenames.get(7));
   assertEquals("test-documents/testXML.xml", tracker.filenames.get(8));
   
   for(String type : tracker.mediatypes) {
      assertNull(type);
   }
   for(String crt : tracker.createdAts) {
       assertNull(crt);
   }
   for(String mod : tracker.modifiedAts) {
       assertNotNull(mod);
       assertTrue("Modified at " + mod, mod.startsWith("20"));
   }
   
   // Should have filenames in the content string
   String content = handler.toString();
   assertContains("test-documents/testHTML.html", content);
   assertContains("test-documents/testEXCEL.xls", content);
   assertContains("test-documents/testOpenOffice2.odt", content);
   assertContains("test-documents/testPDF.pdf", content);
   assertContains("test-documents/testPPT.ppt", content);
   assertContains("test-documents/testRTF.rtf", content);
   assertContains("test-documents/testTXT.txt", content);
   assertContains("test-documents/testWORD.doc", content);
   assertContains("test-documents/testXML.xml", content);
}