Examples of WorkReportType


Examples of org.libreplan.business.workreports.entities.WorkReportType

        // Mandatory fields
        workReport.setCode(workReportDTO.code);

        try {
            WorkReportType workReportType = Registry.getWorkReportTypeDAO()
                    .findUniqueByCode(workReportDTO.workReportType);
            workReport.setWorkReportType(workReportType);
        } catch (InstanceNotFoundException e) {
            throw new ValidationException(
                    "There is no type of work report with this code");
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

* @author Manuel Rego Casasnovas <mrego@igalia.com>
*/
public class WorkReportTest {

    private WorkReportType givenBasicWorkReportType() {
        WorkReportType workReportType = WorkReportType.create();
        workReportType.setCode("type-of-work-hours-code-" + UUID.randomUUID());
        workReportType.setName("type-of-work-hours-name");

        return workReportType;
    }
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

        assertNull(workReport.getResource());
    }

    @Test
    public void checkSetDateAtWorkReportLevel() {
        WorkReportType workReportType = givenBasicWorkReportType();
        workReportType.setDateIsSharedByLines(true);

        WorkReport workReport = WorkReport.create(workReportType);

        assertNull(workReport.getDate());
        assertNull(workReport.getOrderElement());
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

        assertNull(workReport.getResource());
    }

    @Test
    public void checkSetOrderElementAtWorkReportLevel() {
        WorkReportType workReportType = givenBasicWorkReportType();
        workReportType.setOrderElementIsSharedInLines(true);

        WorkReport workReport = WorkReport.create(workReportType);

        assertNull(workReport.getDate());
        assertNull(workReport.getOrderElement());
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

        assertNull(workReport.getResource());
    }

    @Test
    public void checkSetResourceAtWorkReportLevel() {
        WorkReportType workReportType = givenBasicWorkReportType();
        workReportType.setResourceIsSharedInLines(true);

        WorkReport workReport = WorkReport.create(workReportType);

        assertNull(workReport.getDate());
        assertNull(workReport.getOrderElement());
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

        assertNotNull(workReport.getResource());
    }

    @Test
    public void checkDataKeptAtAllWorkReportLines() {
        WorkReportType workReportType = givenBasicWorkReportType();
        workReportType.setDateIsSharedByLines(true);
        workReportType.setOrderElementIsSharedInLines(true);
        workReportType.setResourceIsSharedInLines(true);

        WorkReport workReport = givenBasicWorkReport();
        workReport.setWorkReportType(workReportType);

        WorkReportLine workReportLine1 = givenBasicWorkReportLine(workReport);
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @Test
    public void checkHoursCalculatedByClock() {
        WorkReportType workReportType = givenBasicWorkReportType();
        workReportType
                .setHoursManagement(HoursManagementEnum.HOURS_CALCULATED_BY_CLOCK);

        WorkReport workReport = WorkReport.create(workReportType);
        WorkReportLine workReportLine = givenBasicWorkReportLine(workReport);
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @Test
    public void checkHoursCalculatedByClock2() {

        WorkReportType workReportType = givenBasicWorkReportType();
        workReportType
                .setHoursManagement(HoursManagementEnum.HOURS_CALCULATED_BY_CLOCK);

        WorkReport workReport = WorkReport.create(workReportType);

        WorkReportLine workReportLine = givenBasicWorkReportLine(workReport);
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    @Test
    @Transactional
    public void checkInvalidNameWorkReportType()
            throws ValidationException {
        WorkReportType workReportType = createValidWorkReportType();
        workReportType.setName("");
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
            // It should throw an exception
        }

        workReportType = createValidWorkReportType();
        workReportType.setName(null);
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
            // It should throw an exception
View Full Code Here

Examples of org.libreplan.business.workreports.entities.WorkReportType

    }

    @Test
    @Transactional
    public void checkInvalidCodeWorkReportType() throws ValidationException {
        WorkReportType workReportType = createValidWorkReportType();
        workReportType.setCode("");
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
            // It should throw an exception
        }

        workReportType = createValidWorkReportType();
        workReportType.setCode(null);
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
            // It should throw an exception
        }

        workReportType.setCode("invalid_code");
        try {
            workReportTypeDAO.save(workReportType);
            fail("It should throw an exception");
        } catch (ValidationException e) {
            // It should throw an exception
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.