@Test
public void testSimpleFile() throws Exception {

    ContentHandler handler = new BodyContentHandler();
    Metadata metadata = new Metadata();
    try (InputStream stream = SAS7BDATParserTest.class.getResourceAsStream(
            "/test-documents/testSAS.sas7bdat")) {
        parser.parse(stream, handler, metadata, new ParseContext());
    }
    assertEquals("application/x-sas-data", metadata.get(Metadata.CONTENT_TYPE));
    assertEquals("TESTING", metadata.get(TikaCoreProperties.TITLE));
    // Mon Jan 30 07:31:47 GMT 2017
    assertEquals("2017-01-30T07:31:47Z", metadata.get(TikaCoreProperties.CREATED));
    assertEquals("2017-01-30T07:31:47Z", metadata.get(TikaCoreProperties.MODIFIED));
    
    assertEquals("1", metadata.get(PagedText.N_PAGES));
    assertEquals("2", metadata.get(Database.COLUMN_COUNT));
    assertEquals("11", metadata.get(Database.ROW_COUNT));
    assertEquals("windows-1252", metadata.get(HttpHeaders.CONTENT_ENCODING));
    assertEquals("W32_7PRO", metadata.get(OfficeOpenXMLExtended.APPLICATION));
    assertEquals("9.0301M2", metadata.get(OfficeOpenXMLExtended.APP_VERSION));
    assertEquals("32", metadata.get(MachineMetadata.ARCHITECTURE_BITS));
    assertEquals("Little", metadata.get(MachineMetadata.ENDIAN));
    assertEquals(Arrays.asList("recnum","label"),
                 Arrays.asList(metadata.getValues(Database.COLUMN_NAME)));
    
    String content = handler.toString();
    assertContains("TESTING", content);
    assertContains("\t3\t", content);
    assertContains("\t10\t", content);
    assertContains("\tThis is row", content);
    assertContains(" of ", content);
}