use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements8_1.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements8_1() {
LOGGER.debug("selectElements8-1");
Document doc = null;
try {
doc = Jsoup.parse(new File("src/test/resources/images/image-composite-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 testSelectElements1_4.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements1_4() {
LOGGER.debug("selectElements1-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, 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 testSelectElements4_2.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements4_2() {
LOGGER.debug("selectElements4-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, 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 SimpleElementSelectorTest method testSelectElements.
/**
* Test of selectElements method, of class SimpleElementSelector.
*/
public void testSelectElements() {
LOGGER.debug("select fieldset not within form");
Document doc = Jsoup.parse("<form action=\"action\"><fieldset>FieldSet</fieldset></form>");
initMockContext(CssLikeQueryStore.FIELDSET_NOT_WITHIN_FORM_CSS_LIKE_QUERY, doc);
ElementHandler<Element> elementHandler = new ElementHandlerImpl();
SimpleElementSelector instance = new SimpleElementSelector(CssLikeQueryStore.FIELDSET_NOT_WITHIN_FORM_CSS_LIKE_QUERY);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.isEmpty());
verifyMockContext();
}
use of org.asqatasun.ruleimplementation.ElementHandlerImpl in project Asqatasun by Asqatasun.
the class ImageElementSelectorTest method testSelectElements6_3.
/**
* Test of selectElements method, of class ImageElementSelector.
*/
public void testSelectElements6_3() {
LOGGER.debug("selectElements6-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, false, true);
instance.selectElements(sspHandler, elementHandler);
assertTrue(elementHandler.isEmpty());
verifyMockContext();
}
Aggregations