Examples of TypeOfWorkHours


Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    public void testInSpringContainer() {
        assertNotNull(typeOfWorkHoursDAO);
    }

    private TypeOfWorkHours createValidTypeOfWorkHours() {
        TypeOfWorkHours typeOfWorkHours =
            TypeOfWorkHours.create(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        typeOfWorkHours.setDefaultPrice(BigDecimal.TEN);
        return typeOfWorkHours;
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    }

    @Test
    @Transactional
    public void testSaveTypeOfWorkHours() {
        TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
        typeOfWorkHoursDAO.save(typeOfWorkHours);
        assertTrue(typeOfWorkHours.getId() != null);
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    }

    @Test
    @Transactional
    public void testRemoveTypeOfWorkHours() throws InstanceNotFoundException {
        TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
        typeOfWorkHoursDAO.save(typeOfWorkHours);
        typeOfWorkHoursDAO.remove(typeOfWorkHours.getId());
        assertFalse(typeOfWorkHoursDAO.exists(typeOfWorkHours.getId()));
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    @Test
    @Transactional
    public void testListTypesOfWorkHours() {
        int previous = typeOfWorkHoursDAO.list(TypeOfWorkHours.class).size();
        TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
        typeOfWorkHoursDAO.save(typeOfWorkHours);
        List<TypeOfWorkHours> list = typeOfWorkHoursDAO.list(TypeOfWorkHours.class);
        assertEquals(previous + 1, list.size());
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    }

    @Test
    @Transactional
    public void testFindTypesOfWorkHoursByCode() {
        TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
        typeOfWorkHoursDAO.save(typeOfWorkHours);
        try {
            TypeOfWorkHours found = typeOfWorkHoursDAO.findUniqueByCode(typeOfWorkHours.getCode());
            assertNotNull(found);
            assertTrue(found.equals(typeOfWorkHours));
        }
        catch (InstanceNotFoundException e) {

        }
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    }

    @Test(expected=InstanceNotFoundException.class)
    @Transactional
    public void testFindTypesOfWorkHoursByCodeException() throws InstanceNotFoundException{
        TypeOfWorkHours typeOfWorkHours = createValidTypeOfWorkHours();
        typeOfWorkHoursDAO.save(typeOfWorkHours);

        typeOfWorkHoursDAO.remove(typeOfWorkHours.getId());

        //this call should throw the exception
        typeOfWorkHoursDAO.findUniqueByCode(typeOfWorkHours.getCode());
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

    }

    private HourCost createValidHourCost() {
        HourCost hourCost = HourCost.create(BigDecimal.ONE, new LocalDate());

        TypeOfWorkHours type =
                TypeOfWorkHours.create(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        type.setDefaultPrice(BigDecimal.TEN);
        hourCost.setType(type);
        typeOfWorkHoursDAO.save(type);

        CostCategory costCategory = CostCategory.create(UUID.randomUUID().toString());
        hourCost.setCategory(costCategory);
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

            throws InstanceNotFoundException {

        Criteria c = getSession().createCriteria(TypeOfWorkHours.class);
        c.add(Restrictions.eq("code", code));

        TypeOfWorkHours found = (TypeOfWorkHours) c.uniqueResult();
        if (found == null) {
            throw new InstanceNotFoundException(code, TypeOfWorkHours.class.getName());
        }
        return found;
    }
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

            throws InstanceNotFoundException {

        Criteria c = getSession().createCriteria(TypeOfWorkHours.class);
        c.add(Restrictions.eq("name", name.trim()).ignoreCase());

        TypeOfWorkHours found = (TypeOfWorkHours) c.uniqueResult();
        if (found == null) {
            throw new InstanceNotFoundException(name, TypeOfWorkHours.class
                    .getName());
        }
        return found;
View Full Code Here

Examples of org.libreplan.business.costcategories.entities.TypeOfWorkHours

            row.appendChild(lbHoursType);
            return;
        }

        // First time is rendered, select first item
        TypeOfWorkHours type = workReportLine.getTypeOfWorkHours();
        if (workReportLine.isNewObject() && type == null) {
            Listitem item = lbHoursType.getItemAtIndex(0);
            item.setSelected(true);
            setHoursType(workReportLine, item);
        } else {
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.