use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class ParameterDataServiceImpl method updateParameterSet.
@Override
public Set<Parameter> updateParameterSet(final Set<Parameter> paramSet, final Set<Parameter> paramsToUpdate) {
Set<Parameter> paramToReturn = new HashSet<>();
for (Parameter parameter : paramSet) {
boolean found = false;
for (Parameter paramToUpdate : paramsToUpdate) {
if (parameter.getParameterElement().getParameterElementCode().equals(paramToUpdate.getParameterElement().getParameterElementCode())) {
paramToReturn.add(paramToUpdate);
found = true;
break;
}
}
if (!found) {
paramToReturn.add(parameter);
}
}
return paramToReturn;
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class TestDataServiceImpl method getTestListFromParamSet.
/**
* The parameter set contains a unique parameter that combines the referential
* and the level parameters.
* This method extracts these parameters to retrieve the appropriate tests.
*
* @param paramSet
* @return
*/
@Override
@Transactional
public List<Test> getTestListFromParamSet(Set<Parameter> paramSet) {
Reference reference = null;
Level level = null;
for (Parameter param : paramSet) {
String paramElemcode = param.getParameterElement().getParameterElementCode();
if (paramElemcode.equals(levelParameterCode)) {
String[] referentialAndLevel = param.getValue().split(";");
reference = referenceDataService.getByCode(referentialAndLevel[0]);
level = levelDataService.getByCode(referentialAndLevel[1]);
break;
}
}
List<Test> testList = getAllByReferenceAndLevel(reference, level);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Retrieved " + testList.size() + " test for the referential " + reference.getLabel() + " and the level " + level.getLabel());
}
return testList;
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AsqatasunOrchestrator method auditPageUpload.
public Audit auditPageUpload(Contract contract, Map<String, String> fileMap, String clientIp, Set<Parameter> parameterSet, Locale locale) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("auditPage Upload on " + fileMap.size() + " files");
for (Parameter param : parameterSet) {
LOGGER.debug("param " + param.getValue() + " " + param.getParameterElement().getParameterElementCode());
}
}
Act act;
if (fileMap.size() > 1) {
act = createAct(contract, ScopeEnum.GROUPOFFILES, clientIp);
} else {
act = createAct(contract, ScopeEnum.FILE, clientIp);
}
AuditTimeoutThread auditPageUploadThread = new AuditPageUploadThread(fileMap, auditService, act, parameterSet, locale, delay);
return submitAuditAndLaunch(auditPageUploadThread);
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AsqatasunOrchestrator method auditScenario.
public void auditScenario(Contract contract, Long idScenario, String clientIp, Set<Parameter> parameterSet, Locale locale) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Scenarion audit on scenario with id" + idScenario);
for (Parameter param : parameterSet) {
LOGGER.debug("param " + param.getValue() + " " + param.getParameterElement().getParameterElementCode());
}
}
Act act = createAct(contract, ScopeEnum.SCENARIO, clientIp);
Scenario scenario = scenarioDataService.read(idScenario);
AuditThread auditScenarioThread = new AuditScenarioThread(scenario.getLabel(), scenario.getContent(), auditService, act, parameterSet, locale);
threadPoolTaskExecutor.submit(auditScenarioThread);
}
Aggregations