Package org.libreplan.business.materials.entities

Examples of org.libreplan.business.materials.entities.Material


    }

    @Test
    @Transactional
    public void testRemoveMaterial() throws InstanceNotFoundException {
        Material material = createValidMaterial();
        materialDAO.save(material);
        materialDAO.remove(material.getId());
        assertFalse(materialDAO.exists(material.getId()));
    }
View Full Code Here


    @Test
    @Transactional
    public void testListMaterials() {
        int previous = materialDAO.list(Material.class).size();
        Material material = createValidMaterial();
        materialDAO.save(material);
        List<Material> list = materialDAO.list(Material.class);
        assertEquals(previous + 1, list.size());
    }
View Full Code Here

    @Test
    @Transactional
    public void testListMaterialsFromCategory() {
        MaterialCategory category = createValidMaterialCategory();
        int previous = category.getMaterials().size();
        Material material = createValidMaterial();
        category.addMaterial(material);

        materialCategoryDAO.save(category);
        try {
            category = materialCategoryDAO.find(category.getId());
View Full Code Here

    private Material createValidMaterial() {
        MaterialCategory materialCategory = MaterialCategory.create(UUID.randomUUID().toString());
        materialCategoryDAO.save(materialCategory);
        UnitType unitType = UnitType.create("m");
        unitTypeDAO.save(unitType);
        Material material = Material.create(UUID.randomUUID().toString());
        material.setDescription("material");
        material.setCategory(materialCategory);
        material.setUnitType(unitType);
        materialDAO.save(material);
        return material;
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.materials.entities.Material

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.