Package org.libreplan.business.workreports.entities

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


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

        WorkReport workReport = WorkReport.create(workReportType);

        assertNull(workReport.getDate());
        assertNull(workReport.getOrderElement());
        assertNull(workReport.getResource());

        workReport.setDate(new Date());
        workReport.setOrderElement(givenOrderLine());
        workReport.setResource(givenWorker());

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


    @Test
    @Transactional
    public void testListWorkReport() {
        int previous = workReportDAO.list(WorkReport.class).size();

        WorkReport workReport1 = createValidWorkReport();
        workReportDAO.save(workReport1);
        WorkReport workReport2 = createValidWorkReport();
        workReportDAO.save(workReport1);
        workReportDAO.save(workReport2);

        List<WorkReport> list = workReportDAO
                .list(WorkReport.class);
View Full Code Here

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

        WorkReport workReport = WorkReport.create(workReportType);

        assertNull(workReport.getDate());
        assertNull(workReport.getOrderElement());
        assertNull(workReport.getResource());

        workReport.setDate(new Date());
        workReport.setOrderElement(givenOrderLine());
        workReport.setResource(givenWorker());

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

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

        WorkReport workReport = WorkReport.create(workReportType);

        assertNull(workReport.getDate());
        assertNull(workReport.getOrderElement());
        assertNull(workReport.getResource());

        workReport.setDate(new Date());
        workReport.setOrderElement(givenOrderLine());
        workReport.setResource(givenWorker());

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

TOP

Related Classes of org.libreplan.business.workreports.entities.WorkReport

Copyright © 2018 www.massapicom. 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.