@Test
public void testTSDFileData() throws Exception {

    try (InputStream inputXml =
                 TSDParserTest.class.getResourceAsStream("/test-documents/MANIFEST.XML.TSD");
         InputStream inputTxt1 =
                 TSDParserTest.class.getResourceAsStream("/test-documents/Test1.txt.tsd");
         InputStream inputTxt2 =
                 TSDParserTest.class.getResourceAsStream("/test-documents/Test2.txt.tsd");
         InputStream inputDocx =
                 TSDParserTest.class.getResourceAsStream("/test-documents/Test3.docx.tsd");
         InputStream inputPdf =
                 TSDParserTest.class.getResourceAsStream("/test-documents/Test4.pdf.tsd");
         InputStream inputPng =
                 TSDParserTest.class.getResourceAsStream("/test-documents/Test5.PNG.tsd");) {
        TSDParser tsdParser = new TSDParser();
        ContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();
        ParseContext parseContext = new ParseContext();
        tsdParser.parse(inputXml, handler, metadata, parseContext);
        assertNotNull(handler);
        assertNotNull(metadata);
        assertContains("Description=Time Stamped Data Envelope", metadata.toString());
        assertContains("Content-Type=application/timestamped-data", metadata.toString());
        assertContains("File-Parsed=true", metadata.toString());
        handler = new BodyContentHandler();
        metadata = new Metadata();
        parseContext = new ParseContext();
        tsdParser.parse(inputTxt1, handler, metadata, parseContext);
        assertNotNull(handler);
        assertNotNull(metadata);
        assertContains("Description=Time Stamped Data Envelope", metadata.toString());
        assertContains("Content-Type=application/timestamped-data", metadata.toString());
        assertContains("File-Parsed=true", metadata.toString());
        handler = new BodyContentHandler();
        metadata = new Metadata();
        parseContext = new ParseContext();
        tsdParser.parse(inputTxt2, handler, metadata, parseContext);
        assertNotNull(handler);
        assertNotNull(metadata);
        assertContains("Description=Time Stamped Data Envelope", metadata.toString());
        assertContains("Content-Type=application/timestamped-data", metadata.toString());
        assertContains("File-Parsed=true", metadata.toString());
        handler = new BodyContentHandler();
        metadata = new Metadata();
        parseContext = new ParseContext();
        tsdParser.parse(inputDocx, handler, metadata, parseContext);
        assertNotNull(handler);
        assertNotNull(metadata);
        assertContains("Description=Time Stamped Data Envelope", metadata.toString());
        assertContains("Content-Type=application/timestamped-data", metadata.toString());
        assertContains("File-Parsed=true", metadata.toString());
        handler = new BodyContentHandler();
        metadata = new Metadata();
        parseContext = new ParseContext();
        tsdParser.parse(inputPdf, handler, metadata, parseContext);
        assertNotNull(handler);
        assertNotNull(metadata);
        assertContains("Description=Time Stamped Data Envelope", metadata.toString());
        assertContains("Content-Type=application/timestamped-data", metadata.toString());
        assertContains("File-Parsed=true", metadata.toString());
        handler = new BodyContentHandler();
        metadata = new Metadata();
        parseContext = new ParseContext();
        tsdParser.parse(inputPng, handler, metadata, parseContext);
        assertNotNull(handler);
        assertNotNull(metadata);
        assertContains("Description=Time Stamped Data Envelope", metadata.toString());
        assertContains("Content-Type=application/timestamped-data", metadata.toString());
        assertContains("File-Parsed=true", metadata.toString());
    }
}