Examples of WorkReportListDTO


Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        workReportDTO.labels.add(labelDTO1);
        for (WorkReportLineDTO lineDTO : workReportDTO.workReportLines) {
            lineDTO.labels.add(labelDTO2);
        }

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = workReportService
                .addWorkReports(workReportListDTO).instanceConstraintViolationsList;

        // Test
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        workReportDTO.labels.add(labelDTO1);
        for (WorkReportLineDTO lineDTO : workReportDTO.workReportLines) {
            lineDTO.labels.add(labelDTO2);
        }

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = workReportService
                .addWorkReports(workReportListDTO).instanceConstraintViolationsList;

        // Test
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        workReportDTO.descriptionValues.add(valueDTO1);
        for (WorkReportLineDTO lineDTO : workReportDTO.workReportLines) {
            lineDTO.descriptionValues.add(valueDTO2);
        }

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = workReportService
                .addWorkReports(workReportListDTO).instanceConstraintViolationsList;

        // Test
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        workReportDTO.descriptionValues.add(valueDTO1);
        for (WorkReportLineDTO lineDTO : workReportDTO.workReportLines) {
            lineDTO.descriptionValues.add(valueDTO2);
        }

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = workReportService
                .addWorkReports(workReportListDTO).instanceConstraintViolationsList;

        // Test
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        transactionService.runOnTransaction(new IOnTransaction<Void>() {
            @Override
            public Void execute() {

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(createWorkReportDTO(workReportTypeCode)));

        InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO);
        assertThat(
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

    @Test
    @Transactional
    public void importInvalidWorkReportWithoutDateAtWorkReportLevel() {
        int previous = workReportDAO.getAll().size();

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(createWorkReportDTO(workReportTypeCode2)));

        InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO);
        assertThat(
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        WorkReportDTO workReportDTO = createWorkReportDTO(workReportTypeCode2);
        Date date = new LocalDate().toDateTimeAtStartOfDay().toDate();
        workReportDTO.date = DateConverter.toXMLGregorianCalendar(date);

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));

        InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO);
        assertThat(
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

    @Test
    @Transactional
    public void importInvalidWorkReportCalculatedHours() {
        int previous = workReportDAO.getAll().size();

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(createWorkReportDTO(workReportTypeCode3)));

        InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO);
        assertThat(
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

        workReportLineDTO.clockStart = DateConverter
                .toXMLGregorianCalendar(start);
        workReportLineDTO.clockFinish = DateConverter
                .toXMLGregorianCalendar(end);

        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));

        InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO);
        assertThat(
View Full Code Here

Examples of org.libreplan.ws.workreports.api.WorkReportListDTO

                        return workReportDAO.getAll().size();
                    }
                });

        WorkReportDTO workReportDTO = createWorkReportDTO(workReportTypeCode);
        WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
                .asList(workReportDTO));

        InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO);
        assertThat(
                instanceConstraintViolationsListDTO.instanceConstraintViolationsList
                        .size(), equalTo(0));
        List<WorkReport> workReports = transactionService
                .runOnTransaction(new IOnTransaction<List<WorkReport>>() {
                    @Override
                    public List<WorkReport> execute() {
                        List<WorkReport> list = workReportDAO.getAll();
                        for (WorkReport workReport : list) {
                            Set<WorkReportLine> workReportLines = workReport
                                    .getWorkReportLines();
                            for (WorkReportLine line : workReportLines) {
                                line.getEffort().getHours();
                            }
                        }
                        return list;
                    }
                });
        assertThat(workReports.size(), equalTo(previous + 1));

        Set<WorkReportLine> workReportLines = workReports.get(previous)
                .getWorkReportLines();
        assertThat(workReportLines.size(), equalTo(1));

        assertThat(workReportLines.iterator().next().getEffort(),
                equalTo(EffortDuration.sum(EffortDuration.hours(8),
                        EffortDuration.minutes(15))));

        workReportDTO.workReportLines.add(createWorkReportLineDTO());
        WorkReportListDTO workReportListDTO2 = new WorkReportListDTO(Arrays
                .asList(workReportDTO));
        instanceConstraintViolationsListDTO = workReportService
                .addWorkReports(workReportListDTO2);

        assertThat(
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.