Package de.timefinder.data

Examples of de.timefinder.data.Location


        return Location.class;
    }

    @Override
    public Location create() {
        return new Location();
    }
View Full Code Here


        Event ev1 = new Event(3, 1);
        eDao.attach(ev1);
        Event ev2 = new Event(2, 1);
        eDao.attach(ev2);

        Location loc1 = new Location("loc1", 10);
        lDao.attach(loc1);

        unitimer = new UniTimeOptimization();
        unitimer.setCondition(new AlgorithmConditionTime(1));
        unitimer.setInitialAssignment(true);
View Full Code Here

        eDao.attach(ev1);
       
        Event ev2 = new Event(1, 1);
        eDao.attach(ev2);

        Location loc1 = new Location("loc1", 10);
        lDao.attach(loc1);

        unitimer = new UniTimeOptimization();
        unitimer.setCondition(new AlgorithmConditionTime(1));
        unitimer.setInitialAssignment(true);
View Full Code Here

        ev4 = new Event();
        person1 = new Person();
        person2 = new Person();
        person3 = new Person();
        person4 = new Person();
        loc1 = new Location();
        loc1.setCapacity(20);
        loc2 = new Location();
        loc2.setCapacity(20);
        loc3 = new Location();
        loc3.setCapacity(20);
        loc4 = new Location();
        loc4.setCapacity(20);
        feature1 = new Feature();
        feature2 = new Feature();
        feature3 = new Feature();
        feature4 = new Feature();
View Full Code Here

    @Before
    @Override
    public void setUp() {
        super.setUp();
        instance = new Location();
    }
View Full Code Here

        assertEquals(instance.getCapacity(), capacity);
    }

    @Test
    public void addFeature() {
        Location room = newLocation("test");
        Feature f = newFeature("feature");
        room.addFeature(f);
        assertEquals(f, room.getFeatures().iterator().next());

        Feature feature = new Feature();
        instance.addFeature(feature);
        instance.addFeature(feature);
        assertEquals(1, instance.getFeatures().size());
View Full Code Here

        assertEquals(1, orderC1.getFollows().size());

        assertEquals(tmpEv1, orderC1.getBefores().iterator().next());
        assertEquals(tmpEv4, orderC1.getFollows().iterator().next());

        Location tmpLoc1 = tmpLDao.findFirstByName("location1");
        assertTrue(tmpLoc1.getEvents().contains(tmpEv1));
        assertEquals(tmpLoc1, tmpEv1.getLocation());

        DifferentDayConstraint ddc = tmpEv1.getConstraint(DifferentDayConstraint.class);
        assertTrue(ddc.getEvents().contains(tmpEv2));
View Full Code Here

        Event newEv1 = newEDao.findFirstByName("event1");
        Event newEv2 = newEDao.findFirstByName("event2");
        Event newEv3 = newEDao.findFirstByName("event3");
        Event newEv4 = newEDao.findFirstByName("event4");

        Location newLoc1 = newLDao.findFirstByName("location1");
        Location newLoc2 = newLDao.findFirstByName("location2");
        Location newLoc3 = newLDao.findFirstByName("location3");
        Location newLoc4 = newLDao.findFirstByName("location4");

        Feature newFeature1 = newFDao.findFirstByName("feature1");
        Feature newFeature2 = newFDao.findFirstByName("feature2");

        assertTrue(newPerson1.getEventsMap().containsKey(newEv1));
        assertTrue(newPerson1.getEventsMap().containsKey(newEv2));
        assertTrue(newPerson2.getEventsMap().containsKey(newEv3));
        assertTrue(newPerson2.getEventsMap().containsKey(newEv4));
        assertTrue(newPerson3.getEventsMap().containsKey(newEv3));
        assertTrue(newPerson4.getEventsMap().containsKey(newEv1));

        // the following could fail if we change the hashcode while
        // deserialization with xstream
        assertTrue(newEv1.getPersonsMap().containsKey(newPerson1));
        assertTrue(newEv1.getPersonsMap().containsKey(newPerson4));
        assertTrue(newEv2.getPersonsMap().containsKey(newPerson1));
        assertTrue(newEv3.getPersonsMap().containsKey(newPerson2));
        assertTrue(newEv3.getPersonsMap().containsKey(newPerson3));
        assertTrue(newEv4.getPersonsMap().containsKey(newPerson2));

        assertTrue(newLoc1.getEvents().contains(newEv1));
        assertTrue(newLoc1.getEvents().contains(newEv2));
        assertTrue(newLoc3.getEvents().contains(newEv4));
        assertTrue(newLoc4.getEvents().contains(newEv3));

        assertTrue(newLoc1.getFeatures().contains(newFeature1));
        assertTrue(newLoc4.getFeatures().contains(newFeature2));
    }
View Full Code Here

TOP

Related Classes of de.timefinder.data.Location

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.