use of org.asqatasun.entity.parameterization.ParameterImpl in project Asqatasun by Asqatasun.
the class ParameterFactoryImpl method createParameter.
@Override
public Parameter createParameter(ParameterElement parameterElement, String value) {
Parameter parameter = new ParameterImpl();
parameter.setDefaultParameterValue(false);
parameter.setParameterElement(parameterElement);
parameter.setValue(value);
return parameter;
}
use of org.asqatasun.entity.parameterization.ParameterImpl in project Asqatasun by Asqatasun.
the class ParameterFactoryImpl method createParameter.
@Override
public Parameter createParameter(ParameterElement parameterElement, String value) {
Parameter parameter = new ParameterImpl();
parameter.setDefaultParameterValue(false);
parameter.setParameterElement(parameterElement);
parameter.setValue(value);
return parameter;
}
use of org.asqatasun.entity.parameterization.ParameterImpl in project Asqatasun by Asqatasun.
the class AuditSetUpControllerTest method setUpMockParameterDataService.
private void setUpMockParameterDataService() {
ParameterElement mockParameterElementTextualFormField = new ParameterElementImpl() {
{
setParameterElementCode("TEXTUAL_FORMFIELD");
}
};
ParameterElement mockParameterElementLevel = new ParameterElementImpl() {
{
setParameterElementCode("LEVEL");
}
};
when(mockParameterElementDataService.getParameterElement("TEXTUAL_FORMFIELD")).thenReturn(mockParameterElementTextualFormField);
when(mockParameterElementDataService.getParameterElement("LEVEL")).thenReturn(mockParameterElementLevel);
Parameter param1 = new ParameterImpl() {
{
setValue("PARAMETER1");
}
};
Parameter param2 = new ParameterImpl() {
{
setValue("PARAMETER2");
}
};
Set<Parameter> paramSet = new HashSet<Parameter>() {
{
add(param1);
add(param2);
}
};
when(mockParameterDataService.getDefaultParameterSet()).thenReturn(paramSet);
when(mockParameterDataService.getDefaultParameter(mockParameterElementLevel)).thenReturn(param1);
when(mockParameterDataService.getDefaultParameter(mockParameterElementTextualFormField)).thenReturn(param2);
when(mockParameterDataService.getDefaultLevelParameter()).thenReturn(param1);
when(mockParameterDataService.getLastParameterValueFromUser(1L, mockParameterElementLevel, ScopeEnum.DOMAIN)).thenReturn("PARAMETER1");
when(mockParameterDataService.getLastParameterValueFromUser(2L, mockParameterElementLevel, ScopeEnum.DOMAIN)).thenReturn("PARAMETER1");
when(mockParameterDataService.getLastParameterValueFromUser(1L, mockParameterElementTextualFormField, ScopeEnum.DOMAIN)).thenReturn("PARAMETER2");
when(mockParameterDataService.getLastParameterValueFromUser(2L, mockParameterElementTextualFormField, ScopeEnum.DOMAIN)).thenReturn("PARAMETER2");
}
use of org.asqatasun.entity.parameterization.ParameterImpl in project Asqatasun by Asqatasun.
the class PageListControllerTest method setUpMockWebResourceDataService.
/**
*/
private void setUpMockWebResourceDataService(Long idAudit) {
when(mockSite.getAudit()).thenReturn(mockAudit);
when(mockSite.getURL()).thenReturn("http://www.test.org");
when(mockAudit.getDateOfCreation()).thenReturn(Calendar.getInstance().getTime());
when(mockStatisticsDataService.getWebResourceCountByAuditAndHttpStatusCode(idAudit, HttpStatusCodeFamily.f2xx, null, null)).thenReturn(1L);
when(mockStatisticsDataService.getWebResourceCountByAuditAndHttpStatusCode(idAudit, HttpStatusCodeFamily.f3xx, null, null)).thenReturn(2L);
when(mockStatisticsDataService.getWebResourceCountByAuditAndHttpStatusCode(idAudit, HttpStatusCodeFamily.f4xx, null, null)).thenReturn(3L);
when(mockStatisticsDataService.getWebResourceCountByAuditAndHttpStatusCode(idAudit, HttpStatusCodeFamily.f9xx, null, null)).thenReturn(4L);
when(mockStatisticsDataService.getMarkByWebResourceAndAudit(mockSite, false, false)).thenReturn(55.0f);
when(mockStatisticsDataService.getMarkByWebResourceAndAudit(mockSite, true, false)).thenReturn(75.0f);
when(mockWebResourceDataService.getChildWebResourceCount(mockSite)).thenReturn(10L);
when(mockStatisticsDataService.getResultCountByResultType(mockSite, mockAudit, TestSolution.PASSED)).thenReturn(3L);
when(mockStatisticsDataService.getResultCountByResultType(mockSite, mockAudit, TestSolution.FAILED)).thenReturn(3L);
when(mockStatisticsDataService.getResultCountByResultType(mockSite, mockAudit, TestSolution.NEED_MORE_INFO)).thenReturn(3L);
when(mockStatisticsDataService.getResultCountByResultType(mockSite, mockAudit, TestSolution.NOT_APPLICABLE)).thenReturn(1L);
setUpThemeDataService();
Set<Parameter> paramSet = new HashSet();
Parameter mockParameter = new ParameterImpl();
ParameterElement mockParameterElement = new ParameterElementImpl();
mockParameterElement.setParameterElementCode("LEVEL");
mockParameter.setParameterElement(mockParameterElement);
mockParameter.setValue("AW21");
paramSet.add(mockParameter);
when(mockParameterDataService.getParameterSetFromAudit(mockAudit)).thenReturn(paramSet);
when(mockParameterDataService.getReferentialKeyFromAudit(mockAudit)).thenReturn("AW21");
}
use of org.asqatasun.entity.parameterization.ParameterImpl in project Asqatasun by Asqatasun.
the class MockParameterDataService method getParameter.
@Override
public Parameter getParameter(Audit audit, String string) {
Parameter param = new ParameterImpl();
param.setValue("1000");
return param;
}
Aggregations