Examples of HoursGroupDTO


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

        orderDTO.initDate = DateConverter.toXMLGregorianCalendar(new Date());

        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line " + UUID.randomUUID().toString();
        orderLineDTO.code = "order-line-code " + UUID.randomUUID().toString();
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO();
        hoursGroupDTO.resourceType = ResourceEnumDTO.WORKER;
        orderLineDTO.hoursGroups.add(hoursGroupDTO);
        orderDTO.children.add(orderLineDTO);

        OrderListDTO orderListDTO = createOrderListDTO(orderDTO);
View Full Code Here

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

        orderDTO.initDate = DateConverter.toXMLGregorianCalendar(new Date());

        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line " + UUID.randomUUID().toString();
        orderLineDTO.code = "order-line-code " + UUID.randomUUID().toString();
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO("hours-group",
                ResourceEnumDTO.WORKER, 1000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO);
        orderDTO.children.add(orderLineDTO);
View Full Code Here

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

                + UUID.randomUUID().toString();

        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line " + UUID.randomUUID().toString();
        orderLineDTO.code = "order-line-code " + UUID.randomUUID().toString();
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO("hours-group-"
                + UUID.randomUUID().toString(), ResourceEnumDTO.WORKER, 1000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO);
        orderLineGroupDTO.children.add(orderLineDTO);
View Full Code Here

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

        final String orderLineCode = "order-line-code"
                + UUID.randomUUID().toString();
        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line " + UUID.randomUUID().toString();
        orderLineDTO.code = orderLineCode;
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO("hours-groupYY",
                ResourceEnumDTO.WORKER, 1000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO);
        orderDTO.children.add(orderLineDTO);

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

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

        final OrderLine orderLine = transactionService
                .runOnTransaction(new IOnTransaction<OrderLine>() {
                    @Override
                    public OrderLine execute() {
                        try {
                            OrderLine line = (OrderLine) orderElementDAO
                                    .findUniqueByCode(orderLineCode);
                            line.getHoursGroups().size();
                            return line;
                        } catch (InstanceNotFoundException e) {
                            throw new RuntimeException(e);
                        }
                    }
                });
        assertNotNull(orderLine);
        assertThat(orderLine.getHoursGroups().size(), equalTo(1));

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

        orderLineDTO.hoursGroups.iterator().next().workingHours = 1500;
        HoursGroupDTO hoursGroupDTO2 = new HoursGroupDTO("hours-groupXX",
                ResourceEnumDTO.WORKER, 2000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO2);

        orderListDTO = createOrderListDTO(orderDTO);
View Full Code Here

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

        orderDTO.criterionRequirements.add(criterionRequirementDTO);

        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line " + UUID.randomUUID().toString();
        orderLineDTO.code = "order-line-code-AX";
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO("hours-group"
                + UUID.randomUUID().toString(), ResourceEnumDTO.WORKER, 1000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO);
        IndirectCriterionRequirementDTO indirectCriterionRequirementDTO = new IndirectCriterionRequirementDTO(
                name, type, false);
View Full Code Here

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

        orderDTO.criterionRequirements.add(criterionRequirementDTO);

        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line";
        orderLineDTO.code = "order-line-code-RR";
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO("hours-group-RR",
                ResourceEnumDTO.WORKER, 1000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO);
        orderDTO.children.add(orderLineDTO);
View Full Code Here

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

        orderDTO.criterionRequirements.add(criterionRequirementDTO);

        OrderLineDTO orderLineDTO = new OrderLineDTO();
        orderLineDTO.name = "Order line";
        orderLineDTO.code = "order-line-code-WW";
        HoursGroupDTO hoursGroupDTO = new HoursGroupDTO("hours-group-WW",
                ResourceEnumDTO.WORKER, 1000,
                new HashSet<CriterionRequirementDTO>());
        orderLineDTO.hoursGroups.add(hoursGroupDTO);

        IndirectCriterionRequirementDTO indirectCriterionRequirementDTO = new IndirectCriterionRequirementDTO(
View Full Code Here

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

        result.name = UUID.randomUUID().toString();
        return result;
    }

    private HoursGroupDTO createHoursGroupDTO(String code) {
        HoursGroupDTO result = new HoursGroupDTO();
        result.code = code;
        result.resourceType = ResourceEnumDTO.MACHINE;
        return result;
    }
View Full Code Here

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

                    .getCriterionRequirements()) {
                criterionRequirements.add(toDTO(criterionRequirement));
            }
        }

        return new HoursGroupDTO(hoursGroup.getCode(), resourceType, hoursGroup
                .getWorkingHours(), criterionRequirements);
    }
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.