Package models

Examples of models.Talk.validate()


    @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()));
    }

    @Test
    public void grantedSpeakerPadawan() {
View Full Code Here


        Talk t = new Talk();
        t.title = title;
        t.addSpeaker(speaker);
        t.save();
        if (valid) {
            t.validate();
        }
        return t;
    }
   
    @Test public void find() {
View Full Code Here

        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

       
        // No activity for the talk
        assertEquals(0, Activity.count("session = ?", t));
        assertNull(Activity.find("session = ?", t).first());
       
        t.validate();
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", t));
        Activity a = Activity.find("session = ?", t).first();
        assertActivity(a);
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.