use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements5_5.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements5_5() {
LOGGER.debug("selectElements5-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, 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_2.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements7_2() {
LOGGER.debug("selectElements7-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, 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_3.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements2_3() {
LOGGER.debug("selectElements2-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, 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 testSelectElements7_3.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements7_3() {
LOGGER.debug("selectElements7-3");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-composite-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.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 testSelectElementsWithSelectorAsConstructorArgument.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElementsWithSelectorAsConstructorArgument() {
LOGGER.debug("selectElementsWithSelectorAsConstructorArguement");
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(new SimpleElementSelector(HtmlElementStore.IMG_ELEMENT), true, true);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.isEmpty());
verifyMockContext();
}
Aggregations