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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations