use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements7_5.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements7_5() {
LOGGER.debug("selectElements7-5");
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 testSelectElements4_4.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements4_4() {
LOGGER.debug("selectElements4-4");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-link-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 testSelectElements6_5.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements6_5() {
LOGGER.debug("selectElements6-5");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-composite-5.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.isEmpty());
verifyMockContext();
}
use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements4_1.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements4_1() {
LOGGER.debug("selectElements4-1");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-link-1.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 testSelectElements3_3.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements3_3() {
LOGGER.debug("selectElements3-3");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-link-3.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.isEmpty());
verifyMockContext();
}
Aggregations