Search in sources :

Example 1 with DefiniteResult

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

the class ProcessResultDataServiceImpl method getDefiniteResult.

@Override
public DefiniteResult getDefiniteResult(Test test, TestSolution solution) {
    DefiniteResult definiteResult = definiteResultFactory.create();
    definiteResult.setTest(test);
    definiteResult.setDefiniteValue(solution);
    return definiteResult;
}
Also used : DefiniteResult(org.asqatasun.entity.audit.DefiniteResult)

Example 2 with DefiniteResult

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

the class DefiniteResultFactoryImpl method create.

@Override
public DefiniteResult create(Test test, WebResource subject, TestSolution value, int elementCounter) {
    DefiniteResult definiteResult = create(test, subject, value, null);
    definiteResult.setElementCounter(elementCounter);
    return definiteResult;
}
Also used : DefiniteResult(org.asqatasun.entity.audit.DefiniteResult)

Example 3 with DefiniteResult

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

the class DefiniteResultFactoryImpl method create.

@Override
public DefiniteResult create(Test test, WebResource subject) {
    DefiniteResult definiteResult = this.create();
    definiteResult.setTest(test);
    definiteResult.setSubject(subject);
    return definiteResult;
}
Also used : DefiniteResult(org.asqatasun.entity.audit.DefiniteResult)

Example 4 with DefiniteResult

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

the class RuleHelper method synthesizeProcessResultCollection.

/**
     *
     * @param processResultCollection
     *            the process result collection to synthesize
     * @return the synthesis of the process result collection
     */
public static TestSolution synthesizeProcessResultCollection(Collection<ProcessResult> processResultCollection) {
    boolean hasPassed = false;
    boolean hasFailed = false;
    boolean hasNMI = false;
    for (ProcessResult testResult : processResultCollection) {
        DefiniteResult definiteResult = (DefiniteResult) testResult;
        switch(definiteResult.getDefiniteValue()) {
            case PASSED:
                hasPassed = true;
                break;
            case FAILED:
                hasFailed = true;
                break;
            case NEED_MORE_INFO:
                hasNMI = true;
                break;
            default:
        }
    }
    if (hasFailed) {
        return TestSolution.FAILED;
    }
    if (hasNMI) {
        return TestSolution.NEED_MORE_INFO;
    }
    if (hasPassed) {
        return TestSolution.PASSED;
    }
    return TestSolution.NOT_APPLICABLE;
}
Also used : ProcessResult(org.asqatasun.entity.audit.ProcessResult) DefiniteResult(org.asqatasun.entity.audit.DefiniteResult)

Example 5 with DefiniteResult

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

the class AbstractGroupRuleWithPageResultImplementation method consolidateImpl.

/**
     * This is the implementation of the method declared in
     * {@link AbstractRuleImplementation}. It encapsulates the main algorithm of
     * the consolidation operation of concrete {@link RuleImplementation}
     * classes for tests with group scope. It calls the method
     * {@link #consolidateGroup(org.asqatasun.entity.subject.Site, java.util.Set)}
     * which should consolidate gross results by group. In common cases, this
     * method should not be overriden.
     *
     * @param grossResultMap
     *            the gross result map to consolidate.
     * @return the list of net results from the gross result list.
     */
@Override
protected List<ProcessResult> consolidateImpl(Map<WebResource, List<ProcessResult>> grossResultMap, ProcessRemarkService processRemarkService) {
    List<ProcessResult> netResultList = new ArrayList<>();
    for (Map.Entry<WebResource, List<ProcessResult>> entry : grossResultMap.entrySet()) {
        WebResource key = entry.getKey();
        List<ProcessResult> grossResultList = entry.getValue();
        if (entry.getKey() instanceof Page) {
            DefiniteResult netResult = processResultDataService.getDefiniteResult(test, key);
            netResult.setDefiniteValue(TestSolution.NOT_APPLICABLE);
            for (ProcessResult grossResult : grossResultList) {
                //                    netResult.addChildResult(grossResult);
                netResult.setNetResultAudit(grossResult.getGrossResultAudit());
            }
            netResultList.add(netResult);
            continue;
        } else {
            netResultList.addAll(consolidateGroup((Site) key, grossResultList, processRemarkService));
        }
    }
    return consolidateSite(netResultList, processRemarkService);
}
Also used : Site(org.asqatasun.entity.subject.Site) ArrayList(java.util.ArrayList) ProcessResult(org.asqatasun.entity.audit.ProcessResult) WebResource(org.asqatasun.entity.subject.WebResource) List(java.util.List) ArrayList(java.util.ArrayList) Page(org.asqatasun.entity.subject.Page) Map(java.util.Map) DefiniteResult(org.asqatasun.entity.audit.DefiniteResult)

Aggregations

DefiniteResult (org.asqatasun.entity.audit.DefiniteResult)9 ProcessResult (org.asqatasun.entity.audit.ProcessResult)4 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2 Page (org.asqatasun.entity.subject.Page)2 Site (org.asqatasun.entity.subject.Site)2 WebResource (org.asqatasun.entity.subject.WebResource)2