Examples of LabelReferenceDTO


Examples of org.libreplan.ws.common.api.LabelReferenceDTO

    public void importInvalidLabelsToWorkReport() {
        // create work report with a work report line
        WorkReportDTO workReportDTO = createWorkReportDTO(workReportTypeCode5);

        // create invalid description value to add into head and lines.
        LabelReferenceDTO labelDTO1 = new LabelReferenceDTO("codeLabelNoexiste");
        LabelReferenceDTO labelDTO2 = new LabelReferenceDTO(labelA1);

        // it assigne a label type LabelTypeA, but it should be a label type
        // LabelTypeB
        workReportDTO.labels.add(labelDTO1);
        for (WorkReportLineDTO lineDTO : workReportDTO.workReportLines) {
View Full Code Here

Examples of org.libreplan.ws.common.api.LabelReferenceDTO

    public void importValidLabelsToWorkReport() {
        // create work report with a work report line
        WorkReportDTO workReportDTO = createWorkReportDTO(workReportTypeCode5);

        // create invalid description value to add into head and lines.
        LabelReferenceDTO labelDTO1 = new LabelReferenceDTO(labelA1);
        LabelReferenceDTO labelDTO2 = new LabelReferenceDTO(labelB1);

        // it assigne a label type LabelTypeA, but it should be a label type
        // LabelTypeB
        workReportDTO.labels.add(labelDTO1);
        for (WorkReportLineDTO lineDTO : workReportDTO.workReportLines) {
View Full Code Here

Examples of org.libreplan.ws.common.api.LabelReferenceDTO

        OrderDTO orderDTO = new OrderDTO();
        orderDTO.name = "Order name " + UUID.randomUUID().toString();
        orderDTO.code = "order-code " + UUID.randomUUID().toString();
        orderDTO.initDate = DateConverter.toXMLGregorianCalendar(new Date());

        LabelReferenceDTO labelReferenceDTO = new LabelReferenceDTO();
        orderDTO.labels.add(labelReferenceDTO);

        OrderListDTO orderListDTO = createOrderListDTO(orderDTO);
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = orderElementService
                .addOrders(orderListDTO).instanceConstraintViolationsList;
View Full Code Here

Examples of org.libreplan.ws.common.api.LabelReferenceDTO

                    public String execute() {
                        return givenLabelStored().getCode();
                    }
                });

        LabelReferenceDTO labelReferenceDTO = new LabelReferenceDTO();
        labelReferenceDTO.code = labelCode;
        orderDTO.labels.add(labelReferenceDTO);

        OrderListDTO orderListDTO = createOrderListDTO(orderDTO);
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = orderElementService
View Full Code Here

Examples of org.libreplan.ws.common.api.LabelReferenceDTO

                    @Override
                    public String execute() {
                        return givenLabelStored().getCode();
                    }
                });
        LabelReferenceDTO labelReferenceDTO = new LabelReferenceDTO(labelCode);
        orderDTO.labels.add(labelReferenceDTO);

        OrderListDTO orderListDTO = createOrderListDTO(orderDTO);
        List<InstanceConstraintViolationsDTO> instanceConstraintViolationsList = orderElementService
                .addOrders(orderListDTO).instanceConstraintViolationsList;
        assertThat(instanceConstraintViolationsList.size(), equalTo(0));

        final OrderElement orderElement = transactionService
                .runOnTransaction(new IOnTransaction<OrderElement>() {
                    @Override
                    public OrderElement execute() {
                        try {
                            OrderElement element = orderElementDAO
                                    .findUniqueByCode(code);
                            element.getLabels().size();
                            return element;
                        } catch (InstanceNotFoundException e) {
                            throw new RuntimeException(e);
                        }
                    }
                });

        assertNotNull(orderElement);
        assertThat(orderElement.getLabels().size(), equalTo(1));

        transactionService.runOnTransaction(new IOnTransaction<Void>() {
            @Override
            public Void execute() {
                orderElementDAO.flush();
                sessionFactory.getCurrentSession().evict(orderElement);
                return null;
            }
        });

        LabelReferenceDTO labelReferenceDTO2 = new LabelReferenceDTO(labelCode);
        orderDTO.labels.add(labelReferenceDTO2);

        orderListDTO = createOrderListDTO(orderDTO);
        instanceConstraintViolationsList = orderElementService
                .addOrders(orderListDTO).instanceConstraintViolationsList;
View Full Code Here

Examples of org.libreplan.ws.common.api.LabelReferenceDTO

        }
        return labelDTOs;
    }

    public final static LabelReferenceDTO toDTO(Label label) {
        return new LabelReferenceDTO(label.getCode());
    }
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.