Package org.libreplan.ws.materials.api

Examples of org.libreplan.ws.materials.api.MaterialDTO


        String unitTypeCode = null;
        if (material.getUnitType() != null) {
            unitTypeCode = material.getUnitType().getCode();
        }

        return new MaterialDTO(material.getCode(), material.getDescription(),
                material.getDefaultUnitPrice(), unitTypeCode, material
                        .getDisabled());

    }
View Full Code Here


    @Test
    @Transactional
    public void testAddAndGetMaterialCategories() {
        /* Build materialCategory (0 constraint violations). */
        // Missing material name and the unit type.
        MaterialDTO m1 = new MaterialDTO(null, new BigDecimal(13),
                getUnitTypeCodeA(), true);
        // Missing default unit price
        MaterialDTO m2 = new MaterialDTO("material 2", null, getUnitTypeCodeA(),
                true);
        // Missing unit type
        MaterialDTO m3 = new MaterialDTO("material 3", new BigDecimal(13),
                null, true);
        // Missing unit type, same name
        MaterialDTO m4 = new MaterialDTO("material 3", new BigDecimal(13),
                getUnitTypeCodeA(), null);

        List<MaterialDTO> materialDTOs = new ArrayList<MaterialDTO>();
        materialDTOs.add(m1);
        materialDTOs.add(m2);
View Full Code Here

    @Test
    @Transactional
    public void testAddMaterialRepeatedCodes() {
        /* Build material with same code (1 constraint violations). */
        MaterialDTO m1 = new MaterialDTO("CodeA", "material1", new BigDecimal(
                13), getUnitTypeCodeA(), true);
        MaterialDTO m2 = new MaterialDTO("CodeA", "material2", new BigDecimal(
                13), getUnitTypeCodeA(), true);

        List<MaterialDTO> materialDTOs = new ArrayList<MaterialDTO>();
        materialDTOs.add(m1);
        materialDTOs.add(m2);
View Full Code Here

    @Test
    @Transactional
    public void testAddValidMaterialCategory() {
        /* Build material (0 constraint violations). */
        MaterialDTO m1 = new MaterialDTO("CodeM1", "material1", new BigDecimal(
                13), getUnitTypeCodeA(), true);
        MaterialDTO m2 = new MaterialDTO("CodeM2", "material2", new BigDecimal(
                13), getUnitTypeCodeA(), true);

        List<MaterialDTO> materialDTOs1 = new ArrayList<MaterialDTO>();
        List<MaterialDTO> materialDTOs2 = new ArrayList<MaterialDTO>();
        materialDTOs1.add(m1);
View Full Code Here

    @Test
    @Transactional
    public void testAddAndUpdateMaterialCategory() {

        /* Build material (0 constraint violations). */
        MaterialDTO m1 = new MaterialDTO("M-1", "tornillos",
                new BigDecimal(13), UnitTypeBootstrap.getDefaultUnitType()
                        .getCode(), true);

        List<MaterialDTO> materialDTOs1 = new ArrayList<MaterialDTO>();
        materialDTOs1.add(m1);
View Full Code Here

TOP

Related Classes of org.libreplan.ws.materials.api.MaterialDTO

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.