Examples of addSatisfaction()


Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

                .range(year(2000),year(2020)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(1));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(2020)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(1));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));
        assertThat(worker.getCurrentCriterionsFor(type).size(), equalTo(2));
    }

    public static CriterionTypeBase createTypeThatMatches(
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
        CriterionWithItsType otherCriterionWithItsType = new CriterionWithItsType(
                createTypeThatMatches(otherCriterion), otherCriterion);

        Worker worker = Worker.create("firstName", "surName", "2333232");
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(2002)));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(2003)));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

                createTypeThatMatches(otherCriterion), otherCriterion);

        Worker worker = Worker.create("firstName", "surName", "2333232");
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(2002)));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(2003)));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));

        assertEquals(2, worker.getSatisfactionsFor(criterionType).size());
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Worker worker = Worker.create("firstName", "surName", "2333232");
        worker.addSatisfaction(criterionWithItsType, Interval
                .range(year(2000),year(2002)));
        worker.addSatisfaction(criterionWithItsType, Interval
                .from(year(2003)));
        worker.addSatisfaction(otherCriterionWithItsType, Interval
                .from(year(2000)));

        assertEquals(2, worker.getSatisfactionsFor(criterionType).size());
        assertEquals(0, worker.query().from(criterionType).enforcedInAll(
                Interval.range(year(2001), year(2005))).current().result()
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

                equalTo(0));
        assertFalse(criterion.isSatisfiedBy(worker));
        Interval fromNow = Interval.from(new LocalDate());
        assertTrue(worker.canAddSatisfaction(new CriterionWithItsType(
                criterionType, criterion), fromNow));
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), fromNow);
        assertTrue(criterion.isSatisfiedBy(worker));
        assertThat(worker.getCurrentSatisfactionsFor(criterion).size(),
                equalTo(1));
        assertFalse(worker.canAddSatisfaction(new CriterionWithItsType(
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        assertThat(worker.getCurrentSatisfactionsFor(criterion).size(),
                equalTo(1));
        assertFalse(worker.canAddSatisfaction(new CriterionWithItsType(
                criterionType, otherCriterion), fromNow));
        try {
            worker.addSatisfaction(new CriterionWithItsType(criterionType,
                    otherCriterion));
            fail("must send exception since it already is activated for a criterion of the same type and the type doesn't allow repeated criterions per resource");
        } catch (IllegalStateException e) {
            // ok
        }
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Criterion criterion = CriterionDAOTest.createValidCriterion();
        Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
        Worker worker = Worker.create("firstName", "surName", "2333232");
        ICriterionType<Criterion> criterionType = createTypeThatMatches(false,
                criterion, otherCriterion);
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), Interval.range(year(5000), year(6000)));
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), Interval.range(year(4000),year(5000)));

        assertThat(worker.query().from(criterion).enforcedInAll(
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Worker worker = Worker.create("firstName", "surName", "2333232");
        ICriterionType<Criterion> criterionType = createTypeThatMatches(false,
                criterion, otherCriterion);
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), Interval.range(year(5000), year(6000)));
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), Interval.range(year(4000),year(5000)));

        assertThat(worker.query().from(criterion).enforcedInAll(
                Interval.range(year(4001), year(4999))).result().size(),
                equalTo(1));
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Criterion criterion = CriterionDAOTest.createValidCriterion();
        Criterion otherCriterion = CriterionDAOTest.createValidCriterion();
        Worker worker = Worker.create("firstName", "surName", "2333232");
        ICriterionType<Criterion> criterionType = createTypeThatMatches(false,
                criterion, otherCriterion);
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), Interval.from(year(4000)));
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                otherCriterion), Interval.range(year(3500),year(4000)));
        assertThat(worker.getSatisfactionsFor(otherCriterion).size(),
                equalTo(1));
View Full Code Here

Examples of org.libreplan.business.resources.entities.Worker.addSatisfaction()

        Worker worker = Worker.create("firstName", "surName", "2333232");
        ICriterionType<Criterion> criterionType = createTypeThatMatches(false,
                criterion, otherCriterion);
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                criterion), Interval.from(year(4000)));
        worker.addSatisfaction(new CriterionWithItsType(criterionType,
                otherCriterion), Interval.range(year(3500),year(4000)));
        assertThat(worker.getSatisfactionsFor(otherCriterion).size(),
                equalTo(1));
        CriterionSatisfaction satisfaction = worker.getSatisfactionsFor(
                otherCriterion).iterator().next();
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.