Package org.libreplan.business.resources.entities

Examples of org.libreplan.business.resources.entities.CriterionType


        };

        IOnTransaction<Void> updateCriterionType1 = new IOnTransaction<Void>() {
            @Override
            public Void execute() {
                CriterionType criterionType = null;
                try {
                    criterionType = criterionTypeDAO.findUniqueByName(name1);
                } catch (InstanceNotFoundException e) {
                    fail("InstanceNotFoundException not expected");
                }
                criterionType.setName(name2);
                criterionTypeDAO.save(criterionType);
                return null;
            }
        };
View Full Code Here


        };

        IOnTransaction<Void> updateCriterionType1 = new IOnTransaction<Void>() {
            @Override
            public Void execute() {
                CriterionType criterionType = null;
                try {
                    criterionType = criterionTypeDAO.findUniqueByName(name1);
                } catch (InstanceNotFoundException e) {
                    fail("InstanceNotFoundException not expected");
                }
                criterionType.setDescription("New description");
                criterionTypeDAO.save(criterionType);
                return null;
            }
        };
View Full Code Here

    }

    @Test
    @Transactional
    public void testRemove() throws InstanceNotFoundException {
        CriterionType criterionType = createValidCriterionType();
        criterionTypeDAO.save(criterionType);
        criterionTypeDAO.remove(criterionType.getId());
        assertFalse(criterionTypeDAO.exists(criterionType.getId()));
    }
View Full Code Here

    @Test
    @Transactional
    public void testList() {
        int previous = criterionTypeDAO.list(CriterionType.class).size();
        CriterionType criterion1 = createValidCriterionType();
        CriterionType criterion2 = createValidCriterionType();
        criterionTypeDAO.save(criterion1);
        criterionTypeDAO.save(criterion2);
        List<CriterionType> list = criterionTypeDAO.list(CriterionType.class);
        assertEquals(previous + 2, list.size());
    }
View Full Code Here

    @Test
    @Transactional
    public void testGetCriterionTypes() {
        int previous = criterionTypeDAO.list(CriterionType.class).size();
        CriterionType criterion1 = createValidCriterionType();
        CriterionType criterion2 = createValidCriterionType();
        criterionTypeDAO.save(criterion1);
        criterionTypeDAO.save(criterion2);
        List<CriterionType> list = criterionTypeDAO.getCriterionTypes();
        assertEquals(previous + 2, list.size());
    }
View Full Code Here

    @Test
    @Transactional
    public void testGetCriterionTypesByResourceType() {
        // Add RESOURCE criterionType
        CriterionType criterionType = createValidCriterionType();
        criterionType.setResource(ResourceEnum.WORKER);
        criterionTypeDAO.save(criterionType);

        // Add WORKER criterionType
        criterionType = createValidCriterionType();
        criterionType.setResource(ResourceEnum.WORKER);
        criterionTypeDAO.save(criterionType);

        // Get number of criterionTypes of type RESOURCE
        List<ResourceEnum> resources = new ArrayList<ResourceEnum>();
        resources.add(ResourceEnum.WORKER);
View Full Code Here

            item.setValue(resource);
        }
    }

    private void setResourceComboboxValue(Combobox combo) {
        CriterionType criterionType = (CriterionType) getCriterionType();
        for (Object object : combo.getItems()) {
            Comboitem item = (Comboitem) object;
            if (criterionType != null
                    && item.getValue().equals(criterionType.getResource())) {
                combo.setSelectedItem(item);
            }
        }
    }
View Full Code Here

    private List<FilterPair> fillWithFirstTenFiltersCriterions() {
        SortedMap<CriterionType, List<Criterion>> criterionsMap = getCriterionsMap();
        Iterator<CriterionType> iteratorCriterionType = criterionsMap.keySet()
                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < criterionsMap.get(type).size(); i++) {
                Criterion criterion = criterionsMap.get(type).get(i);
                addCriterion(type, criterion);
            }
View Full Code Here

    private List<FilterPair> fillWithFirstTenFiltersCriterions() {
        SortedMap<CriterionType, List<Criterion>> mapCriterions = getMapCriterions();
        Iterator<CriterionType> iteratorCriterionType = mapCriterions.keySet()
                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapCriterions.get(type).size(); i++) {
                Criterion criterion = mapCriterions.get(type).get(i);
                addCriterion(type, criterion);
            }
View Full Code Here

    private List<FilterPair> fillWithFirstTenFiltersCriterions() {
        SortedMap<CriterionType, List<Criterion>> mapCriterions = getMapCriterions();
        Iterator<CriterionType> iteratorCriterionType = mapCriterions.keySet()
                .iterator();
        while (iteratorCriterionType.hasNext() && getListMatching().size() < 10) {
            CriterionType type = iteratorCriterionType.next();
            for (int i = 0; getListMatching().size() < 10
                    && i < mapCriterions.get(type).size(); i++) {
                Criterion criterion = mapCriterions.get(type).get(i);
                addCriterion(type, criterion);
            }
View Full Code Here

TOP

Related Classes of org.libreplan.business.resources.entities.CriterionType

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.