@Test
public void endToEndTest() throws Exception {

    Tika tika = getTika("tika-config-sentiment-opennlp.xml");
    if (tika == null) {
        return;
    }
    String text = "What a wonderful thought it is that" +
            " some of the best days of our lives haven't happened yet.";
    ByteArrayInputStream stream = new ByteArrayInputStream(text.getBytes(Charset.defaultCharset()));
    Metadata md = new Metadata();
    tika.parse(stream, md);
    String sentiment = md.get("Sentiment");
    assertNotNull(sentiment);
    assertEquals("positive", sentiment);
}