use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements1_2.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements1_2() {
LOGGER.debug("selectElements1-2");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-link-2.html"), Charset.defaultCharset().displayName());
} catch (IOException ex) {
}
initMockContext(HtmlElementStore.IMG_ELEMENT, doc);
ElementHandler<Element> elementHandler = new ElementHandlerImpl();
ImageElementSelector instance = new ImageElementSelector(HtmlElementStore.IMG_ELEMENT, true, true);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.isEmpty());
verifyMockContext();
}
use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements7_4.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements7_4() {
LOGGER.debug("selectElements7-4");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-composite-4.html"), Charset.defaultCharset().displayName());
} catch (IOException ex) {
}
initMockContext(HtmlElementStore.IMG_ELEMENT, doc);
ElementHandler<Element> elementHandler = new ElementHandlerImpl();
ImageElementSelector instance = new ImageElementSelector(HtmlElementStore.IMG_ELEMENT, true, false);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.get().size() == 1);
assertTrue(elementHandler.get().iterator().next().nodeName().equals(HtmlElementStore.IMG_ELEMENT));
verifyMockContext();
}
use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements2_2.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements2_2() {
LOGGER.debug("selectElements2-2");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-link-2.html"), Charset.defaultCharset().displayName());
} catch (IOException ex) {
}
initMockContext(HtmlElementStore.IMG_ELEMENT, doc);
ElementHandler<Element> elementHandler = new ElementHandlerImpl();
ImageElementSelector instance = new ImageElementSelector(HtmlElementStore.IMG_ELEMENT, false, true);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.get().size() == 1);
assertTrue(elementHandler.get().iterator().next().nodeName().equals(HtmlElementStore.IMG_ELEMENT));
verifyMockContext();
}
use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements8_4.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements8_4() {
LOGGER.debug("selectElements8-4");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-composite-4.html"), Charset.defaultCharset().displayName());
} catch (IOException ex) {
}
initMockContext(HtmlElementStore.IMG_ELEMENT, doc);
ElementHandler<Element> elementHandler = new ElementHandlerImpl();
ImageElementSelector instance = new ImageElementSelector(HtmlElementStore.IMG_ELEMENT, false, false);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.get().size() == 1);
assertTrue(elementHandler.get().iterator().next().nodeName().equals(HtmlElementStore.IMG_ELEMENT));
verifyMockContext();
}
use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements5_2.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements5_2() {
LOGGER.debug("selectElements5-2");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-composite-2.html"), Charset.defaultCharset().displayName());
} catch (IOException ex) {
}
initMockContext(HtmlElementStore.IMG_ELEMENT, doc);
ElementHandler<Element> elementHandler = new ElementHandlerImpl();
ImageElementSelector instance = new ImageElementSelector(HtmlElementStore.IMG_ELEMENT, true, true);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.isEmpty());
verifyMockContext();
}
Aggregations