use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AnalyserImplTest method testComputeMark.
public void testComputeMark() {
WebResourceStatisticsFactory webResourceStatisticsFactory = new WebResourceStatisticsFactoryImpl();
WebResourceStatisticsDataService webResourceStatisticsDataService = new WebResourceStatisticsDataServiceImpl();
webResourceStatisticsDataService.setEntityFactory(webResourceStatisticsFactory);
AnalyserImpl analyser = new AnalyserImpl(null, null, null, webResourceStatisticsDataService, null, null, null, new ArrayList<Parameter>(), 1);
WebResourceStatistics wrStats = analyser.getWebResourceStatisticsDataService().create();
wrStats.setNbOfPassed(89330);
wrStats.setNbOfFailed(84541);
wrStats.setNbOfNmi(97541);
assertEquals(Double.valueOf(45.828712).floatValue(), analyser.computeMark(wrStats).getMark());
wrStats.setNbOfPassed(0);
wrStats.setNbOfFailed(0);
wrStats.setNbOfNmi(0);
assertEquals(Double.valueOf(0).floatValue(), analyser.computeMark(wrStats).getMark());
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AuditStatisticsFactory method getAuditParameters.
/**
* Retrieves all the parameters of the audit and prepares the data depending
* on the wished displayed parameters of the view.
*
*
* @param audit
* @param parametersToDisplay
* @return
*/
private Map<String, String> getAuditParameters(Audit audit, Map<String, String> parametersToDisplay) {
Map<String, String> auditParameters = new LinkedHashMap();
Set<Parameter> auditParamSet = parameterDataService.getParameterSetFromAudit(audit);
// the parameter management has been integrated
if (auditParamSet.isEmpty()) {
return auditParameters;
}
for (Map.Entry<String, String> entry : parametersToDisplay.entrySet()) {
for (Parameter param : auditParamSet) {
if (entry.getKey().equals(param.getParameterElement().getParameterElementCode())) {
auditParameters.put(entry.getValue(), param.getValue());
}
}
}
if (!parametersToDisplay.isEmpty()) {
auditParameters.put(TgolKeyStore.REFERENTIAL_PARAM_KEY, parameterDataService.getReferentialKeyFromAudit(audit));
}
return auditParameters;
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AsqatasunOrchestratorImpl method auditPageUpload.
@Override
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);
Audit audit = submitAuditAndLaunch(auditPageUploadThread, act);
return audit;
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AsqatasunOrchestratorImpl method auditSite.
@Override
public void auditSite(Contract contract, String siteUrl, String clientIp, Set<Parameter> parameterSet, Locale locale) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Site audit on " + siteUrl);
for (Parameter param : parameterSet) {
LOGGER.debug("param " + param.getValue() + " " + param.getParameterElement().getParameterElementCode());
}
}
Act act = createAct(contract, ScopeEnum.DOMAIN, clientIp);
AuditThread auditSiteThread = new AuditSiteThread(siteUrl, auditService, act, parameterSet, locale);
threadPoolTaskExecutor.submit(auditSiteThread);
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AsqatasunOrchestratorImpl method auditScenario.
@Override
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