@Test
public void testParse() throws Exception {

    //test config is added to resources directory
    try (InputStream is = getClass().getResourceAsStream(CONFIG_FILE)) {
        TikaConfig config = new TikaConfig(is);
        Tika tika = new Tika(config);
        String text = "I am student at University of Southern California (USC)," +
                " located in Los Angeles . USC's football team is called by name Trojans." +
                " Mr. John McKay was a head coach of the team from 1960 - 1975";
        Metadata md = new Metadata();
        tika.parse(new ByteArrayInputStream(text.getBytes(Charset.defaultCharset())), md);
        HashSet<String> set = new HashSet<String>();
        set.addAll(Arrays.asList(md.getValues("X-Parsed-By")));
        assumeTrue(set.contains(NamedEntityParser.class.getName()));
        set.clear();
        set.addAll(Arrays.asList(md.getValues("NER_PERSON")));
        assumeTrue(set.contains("John McKay"));
        set.clear();
        set.addAll(Arrays.asList(md.getValues("NER_LOCATION")));
        assumeTrue(set.contains("Los Angeles"));
        set.clear();
        set.addAll(Arrays.asList(md.getValues("NER_ORGANIZATION")));
        assumeTrue(set.contains("University of Southern California"));
        set.clear();
        set.addAll(Arrays.asList(md.getValues("NER_DATE")));
        assumeTrue(set.contains("1960 - 1975"));
    }
}