Search in sources :

Example 36 with TestSolution

use of org.asqatasun.entity.audit.TestSolution in project Asqatasun by Asqatasun.

the class LangChangeChecker method checkLanguageChange.

/**
     * 
     * @param element
     * @param sspHandler
     * @return 
     */
private TestSolution checkLanguageChange(Element element, SSPHandler sspHandler) {
    String langDefinition = extractLangDefinitionFromElement(element, sspHandler);
    defaultLang = extractEffectiveLang(langDefinition);
    TestSolution declarationValidity = checkLanguageDeclarationValidity(element, langDefinition, defaultLang, false);
    if (declarationValidity.equals(TestSolution.FAILED)) {
        return TestSolution.NOT_APPLICABLE;
    }
    // the handler may contain the html element or nothing
    return checkLanguageRelevancyRecursively(sspHandler, element, null);
}
Also used : TestSolution(org.asqatasun.entity.audit.TestSolution)

Example 37 with TestSolution

use of org.asqatasun.entity.audit.TestSolution in project Asqatasun by Asqatasun.

the class ElementUnicityChecker method checkElementPresence.

/**
     * This methods checks whether a given element is present on the page.
     *
     * @param elements
     * @param testSolutionHandler
     */
private void checkElementPresence(Elements elements, TestSolutionHandler testSolutionHandler) {
    TestSolution checkResult = getSuccessSolution();
    if (elements.size() == 1) {
        for (Element el : elements) {
            addSourceCodeRemark(getSuccessSolution(), el, getSuccessMsgCode());
        }
    } else {
        checkResult = getFailureSolution();
        for (Element el : elements) {
            addSourceCodeRemark(getFailureSolution(), el, getFailureMsgCode());
        }
    }
    testSolutionHandler.addTestSolution(checkResult);
}
Also used : TestSolution(org.asqatasun.entity.audit.TestSolution) Element(org.jsoup.nodes.Element)

Aggregations

TestSolution (org.asqatasun.entity.audit.TestSolution)37 Node (org.w3c.dom.Node)13 Element (org.jsoup.nodes.Element)11 IncoherentValueDomainsException (org.asqatasun.exception.IncoherentValueDomainsException)3 MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 ProcessResult (org.asqatasun.entity.audit.ProcessResult)2 CriterionStatistics (org.asqatasun.entity.statistics.CriterionStatistics)2 ThemeStatistics (org.asqatasun.entity.statistics.ThemeStatistics)2 DomElement (org.asqatasun.rules.domelement.DomElement)2 ProcessRemarkService (org.asqatasun.service.ProcessRemarkService)2 NodeList (org.w3c.dom.NodeList)2 DecimalFormat (java.text.DecimalFormat)1 DecimalFormatSymbols (java.text.DecimalFormatSymbols)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 NoResultException (javax.persistence.NoResultException)1 Query (javax.persistence.Query)1 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)1 EvidenceElement (org.asqatasun.entity.audit.EvidenceElement)1