Search in sources :

Example 56 with Parameter

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;
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter) HashSet(java.util.HashSet)

Example 57 with Parameter

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;
}
Also used : Test(org.asqatasun.entity.reference.Test) Reference(org.asqatasun.entity.reference.Reference) Parameter(org.asqatasun.entity.parameterization.Parameter) Level(org.asqatasun.entity.reference.Level) Transactional(javax.transaction.Transactional)

Example 58 with Parameter

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);
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter)

Example 59 with Parameter

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);
}
Also used : Parameter(org.asqatasun.entity.parameterization.Parameter) Scenario(org.asqatasun.entity.scenario.Scenario)

Aggregations

Parameter (org.asqatasun.entity.parameterization.Parameter)59 ParameterElement (org.asqatasun.entity.parameterization.ParameterElement)13 Audit (org.asqatasun.entity.audit.Audit)8 ParameterImpl (org.asqatasun.entity.parameterization.ParameterImpl)6 NoResultException (javax.persistence.NoResultException)5 Query (javax.persistence.Query)5 HashSet (java.util.HashSet)4 AuditCommand (org.asqatasun.service.command.AuditCommand)4 AuditCommandFactory (org.asqatasun.service.command.factory.AuditCommandFactory)4 Test (org.junit.Test)4 File (java.io.File)3 IOException (java.io.IOException)3 Crawler (org.asqatasun.crawler.Crawler)3 ParameterElementImpl (org.asqatasun.entity.parameterization.ParameterElementImpl)3 LinkedHashSet (java.util.LinkedHashSet)2 ParameterFamily (org.asqatasun.entity.parameterization.ParameterFamily)2 WebResourceStatisticsDataService (org.asqatasun.entity.service.statistics.WebResourceStatisticsDataService)2 WebResourceStatisticsDataServiceImpl (org.asqatasun.entity.service.statistics.WebResourceStatisticsDataServiceImpl)2 WebResourceStatistics (org.asqatasun.entity.statistics.WebResourceStatistics)2 WebResourceStatisticsFactory (org.asqatasun.entity.statistics.factory.WebResourceStatisticsFactory)2