Package models

Examples of models.Talk


    public SpeakerBadgeComputerTest() {
        super(new SpeakerBadgeComputer());
    }

    private Talk createTalk(Member... speakers) {
        Talk t = new Talk();
        for (Member s : speakers) {
            t.addSpeaker(s);
        }
        return t.save();
    }
View Full Code Here


    }

    @Test
    public void grantedSpeaker() {
        // Member become speaker of a validated talk
        final Talk t = createTalk(member);
        assertEquals(EnumSet.noneOf(Badge.class), computer.compute(member, new BadgeComputationContext()));
        t.validate();
        assertEquals(EnumSet.of(Badge.Speaker), computer.compute(member, new BadgeComputationContext()));
    }
View Full Code Here

public class UpdateSessionActivityTest extends AbstractActivityTest {
   
    @Test
    public void updateSessionTalk() {
       
        Talk t = createTalk("test");
       
        // No activity for the talk
        assertEquals(0, Activity.count("session = ?", t));
        assertNull(Activity.find("session = ?", t).first());
       
        t.summary = "Un nouveau résumé";
        t.update();
       
        // Still no activity for the unvalidated talk
        assertEquals(0, Activity.count("session = ?", t));
        assertNull(Activity.find("session = ?", t).first());
       
        t.valid=true;
        t.summary = "Un nouveau nouveau résumé";
        t.update();
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", t));
        Activity a = Activity.find("session = ?", t).first();
        assertActivity(a);
View Full Code Here

        test("/api/talks");
    }

    @Test
    public void testTalk() {
        Talk t = Talk.all().first();
        test("/api/talks/"+t.id);
    }
View Full Code Here

        List<String> errors = new ArrayList<String>();
        Map<Slot, Talk> planning = new EnumMap<Slot, Talk>(Slot.class);
        for (int i = 0; i < slots.size(); ++i) {
            if (talkIds.get(i) >= 0) {

                final Talk talk = Talk.findById(talkIds.get(i));
                if (talk == null) {
                    errors.add("Talk id " + talkIds.get(i) + " unknoww");
                } else if (planning.containsValue(talk)) {
                    errors.add("Talk " + talk + " planifié en double");
                }
View Full Code Here

        Planning planning = PlanedSlot.on(ConferenceEvent.CURRENT, true);
        renderJSON(planning.getSlots(), getSerializers(details));
    }

    public static void talk(long id, boolean details) {
        Talk talk = Talk.findById(id);
        notFoundIfNull(talk);
        PlanedSlot slot = PlanedSlot.forTalkOn(talk, ConferenceEvent.CURRENT);
        if (slot == null) {
            slot = new PlanedSlot(talk);
        }
View Full Code Here

        m.lastname = login;
        return m.save();
    }
   
    private static Talk createTalk(final String title, Member speaker, boolean valid){
        Talk t = new Talk();
        t.title = title;
        t.addSpeaker(speaker);
        t.save();
        if (valid) {
            t.validate();
        }
        return t;
    }
View Full Code Here

*/
public class CommentSessionActivityTest extends AbstractActivityTest {

    @Test
    public void addCommentValid() {
        Talk t = createTalk("test");
        // Ensure the talk is valid
        t.valid = true;
        t.save();
       
        // Non activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        SessionComment c = new SessionComment(member, t, "Un commentaire");
        t.addComment(c);
        t.save();
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", t));
        Activity a = Activity.find("session = ?", t).first();
        assertActivity(a);
View Full Code Here

        assertEquals(c, ca.comment);
    }

    @Test
    public void addCommentNonValid() {
        Talk t = createTalk("test");
        // Ensure the talk is unvalid
        t.valid = false;
        t.save();
       
        // Non activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        SessionComment c = new SessionComment(member, t, "Un commentaire");
        t.addComment(c);
        t.save();
       
        // Still no activity for the session
        assertEquals(0, Activity.count("session = ?", t));
       
        t.validate();
        // 1 comment activity amongst others
        assertEquals(1, CommentSessionActivity.count("session = ?", t));
        Activity a = CommentSessionActivity.find("session = ?", t).first();
        assertActivity(a);
        assertTrue(a instanceof CommentSessionActivity);
View Full Code Here

    protected Article createArticle(String title) {
        return new Article(member, title).save();
    }

    protected Talk createTalk(String title) {
        Talk t = new Talk();
        t.title = title;
        return t.save();
    }
View Full Code Here

TOP

Related Classes of models.Talk

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.