@Test
    public void testOO2Metadata() throws Exception {
        try (InputStream input = getResourceAsStream("/test-documents/testOpenOffice2.odf")) {
            Metadata metadata = new Metadata();
            ContentHandler handler = new BodyContentHandler();
            new OpenDocumentParser().parse(input, handler, metadata, new ParseContext());

            assertEquals("application/vnd.oasis.opendocument.formula",
                    metadata.get(Metadata.CONTENT_TYPE));
            assertEquals(null, metadata.get(TikaCoreProperties.MODIFIED));
            assertEquals("2006-01-27T11:55:22", metadata.get(TikaCoreProperties.CREATED));
            assertEquals("The quick brown fox jumps over the lazy dog",
                    metadata.get(TikaCoreProperties.TITLE));
            assertEquals("Gym class featuring a brown fox and lazy dog",
                    metadata.get(OfficeOpenXMLCore.SUBJECT));
            assertContains("Gym class featuring a brown fox and lazy dog",
                    Arrays.asList(metadata.getValues(TikaCoreProperties.SUBJECT)));
            assertEquals("PT0S", metadata.get(OfficeOpenXMLExtended.TOTAL_TIME));
            assertEquals("1", metadata.get("editing-cycles"));
            assertEquals("OpenOffice.org/2.2$Win32 OpenOffice.org_project/680m14$Build-9134",
                    metadata.get("generator"));
            assertEquals("Pangram, fox, dog", metadata.get(TikaCoreProperties.SUBJECT));

            // User defined metadata
            assertEquals("Text 1", metadata.get("custom:Info 1"));
            assertEquals("2", metadata.get("custom:Info 2"));
            assertEquals("false", metadata.get("custom:Info 3"));
            assertEquals("true", metadata.get("custom:Info 4"));

            // No statistics present
            assertEquals(null, metadata.get(Office.PAGE_COUNT));
            assertEquals(null, metadata.get(Office.PARAGRAPH_COUNT));
            assertEquals(null, metadata.get(Office.WORD_COUNT));
            assertEquals(null, metadata.get(Office.CHARACTER_COUNT));
            assertEquals(null, metadata.get(Office.TABLE_COUNT));
            assertEquals(null, metadata.get(Office.OBJECT_COUNT));
            assertEquals(null, metadata.get(Office.IMAGE_COUNT));
            assertEquals(null, metadata.get("nbTab"));
            assertEquals(null, metadata.get("nbObject"));
            assertEquals(null, metadata.get("nbImg"));
            assertEquals(null, metadata.get("nbPage"));
            assertEquals(null, metadata.get("nbPara"));
            assertEquals(null, metadata.get("nbWord"));
            assertEquals(null, metadata.get("nbCharacter"));
            assertEquals("1.0", metadata.get(OpenDocumentMetaParser.ODF_VERSION_KEY));


            // Note - contents of maths files not currently supported
            String content = handler.toString().trim();
            assertEquals("", content.trim());
        }
    }
Similar to {@link #testOO2()}, but using a different
OO2 file with different metadata in it
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/test/java/org/apache/tika/parser/odf/ODFParserTest.java