@Test
public void testExtractScript() throws Exception {

    HtmlParser p = new HtmlParser();
    p.setExtractScripts(true);
    //TIKA-2550 -- make absolutely sure that macros are still extracted
    //with the ToTextHandler
    List<Metadata> metadataList = getRecursiveMetadata("testHTMLGoodScript.html",
            p, BasicContentHandlerFactory.HANDLER_TYPE.TEXT);
    assertEquals(2, metadataList.size());
    assertEquals("MACRO", metadataList.get(1).get(TikaCoreProperties.EMBEDDED_RESOURCE_TYPE));
    assertContains("cool",
            metadataList.get(1).get(AbstractRecursiveParserWrapperHandler.TIKA_CONTENT));
    assertNotContained("cool", metadataList.get(0).get(AbstractRecursiveParserWrapperHandler.TIKA_CONTENT));
}