Package org.libreplan.ws.resources.api

Examples of org.libreplan.ws.resources.api.MachineDTO


    @Test
    @Transactional
    public void testAddResourceWithCriterionSatisfactionsWithNonExistentCriterionType() {

        /* Create a machine DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.criterionSatisfactions.add(
            new CriterionSatisfactionDTO(getUniqueName() , "c1",
                getDate(2000, 1, 1), null));

        /* Test. */
 
View Full Code Here


        /* Create a criterion type. */
        CriterionType ct = createCriterionType();

        /* Create a machine DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.criterionSatisfactions.add(
            new CriterionSatisfactionDTO(ct.getName(), getUniqueName(),
                getDate(2000, 1, 1), null));

        /* Test. */
 
View Full Code Here

    @Test
    @Transactional
    public void testAddResourceWithDefaultCalendar() {

        /* Create a machine DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");

        /* Test. */
        assertNoConstraintViolations(resourceService.
             addResources(createResourceListDTO(machineDTO)));
        Machine machine = machineDAO.findExistingEntityByCode(machineDTO.code);
View Full Code Here

                .newDerivedResourceCalendar();
        ResourceCalendarDTO resourceCalendarDTO = ResourceConverter
                .toDTO(resourceCalendar);

        /* Create a machine DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.calendar = resourceCalendarDTO;

        /* Test. */
        assertNoConstraintViolations(resourceService
                .addResources(createResourceListDTO(machineDTO)));
View Full Code Here

        /* Create invalid calendar */
        ResourceCalendarDTO calendarDTO = new ResourceCalendarDTO("",
                "ParentNoExist", null,
                null, null, null);
        /* Create a machine DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.calendar = calendarDTO;

        /* Test. */
        assertOneRecoverableError(resourceService
                .addResources(createResourceListDTO(machineDTO)));
View Full Code Here

        /* Create a CostCategory. */
        CostCategory costCategory = createCostCategory();

        /* Create resource DTOs. */
        MachineDTO m1 = new MachineDTO("name", "desc");
        ResourcesCostCategoryAssignmentDTO a1m1 = new ResourcesCostCategoryAssignmentDTO(
                ' ' + costCategory.getName().toUpperCase() + ' ', getDate(2001,
                        1, 1), null);
        m1.resourcesCostCategoryAssignments.add(a1m1);
        m1.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(costCategory
                        .getName(), getDate(2000, 1, 1), getDate(2000, 4, 1)));

        MachineDTO m2 = new MachineDTO("name", "desc");
        m2.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(a1m1.code,
                        costCategory.getName().toUpperCase(), getDate(2001, 1,
                                1), null)); // Repeated assignment code
        // (used by another machine).
        m2.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(null, costCategory
                        .getName().toUpperCase(), getDate(2000, 1, 1), getDate(
                        2000, 4, 1))); // Missing
        // assignment code (autogenerated code).

        MachineDTO m3 = new MachineDTO("name", "desc");
        ResourcesCostCategoryAssignmentDTO a1m3 = new ResourcesCostCategoryAssignmentDTO(
                costCategory.getName(), getDate(2001, 1, 1), null);
        m3.resourcesCostCategoryAssignments.add(a1m3);
        m3.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(a1m3.code, // Repeated
View Full Code Here

    @Test
    @Transactional
    public void testAddResourcesWithCostAssignmentWithMissingCostCategoryName() {

        /* Create a resource DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO("", null, getDate(
                        2000, 1, 1), null));

        /* Test. */
 
View Full Code Here

    @Test
    @Transactional
    public void testAddResourcesWithCostAssignmentWithNonExistentCostCategory() {

        /* Create a resource DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(getUniqueName(),
                        getDate(2000, 1, 1), null));

        /* Test. */
 
View Full Code Here

        /* Create a CostCategory. */
        CostCategory costCategory = createCostCategory();

        /* Create a resource DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(costCategory
                        .getName(), null, // Start date not specified.
                        getDate(2000, 1, 1)));

View Full Code Here

        /* Create a CostCategory. */
        CostCategory costCategory = createCostCategory();

        /* Create a resource DTO. */
        MachineDTO machineDTO = new MachineDTO("name", "desc");
        machineDTO.resourcesCostCategoryAssignments
                .add(new ResourcesCostCategoryAssignmentDTO(costCategory
                        .getName(), getDate(2000, 2, 1), getDate(2000, 1, 1)));

        /* Test. */
 
View Full Code Here

TOP

Related Classes of org.libreplan.ws.resources.api.MachineDTO

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.