Package models

Examples of models.Session


        assertNotNull(Activity.notifiablesForBetween(m, null, null));
    }

    @Test
    public void recentsBySession() {
        final Session s = Session.all().first();
        assertNotNull(Activity.recentsBySession(s, 1, 10));
    }
View Full Code Here


        assertNotNull(Activity.deleteForArticle(article));
    }
   
    @Test
    public void deleteForSession() {
        final Session session = Session.all().first();
        assertNotNull(Activity.deleteForSession(session));
    }
View Full Code Here

        List<Activity> _activities = Activity.recentsForMember(member, providers, page, size);
        render("tags/activities.html", _activities);
    }

    public static void session(long sessionId, Integer page, Integer size) {
        Session talk = Session.findById(sessionId);
        List<Activity> _activities = Activity.recentsBySession(talk, page, size);
        render("tags/activities.html", _activities);
    }
View Full Code Here

    }
   
    @Test
    public void grantedBrave() {
        // Member add one comment
        final Session s = Session.all().first();
        comment(member, s, 1);
        final Set<Badge> actualBadges = computer.compute(member, new BadgeComputationContext());
        assertEquals(EnumSet.of(Badge.Brave), actualBadges);
    }
View Full Code Here

@With(SecureLinkIt.class)
public class Votes extends Controller {

    public static long vote(Long talkId, Boolean value) {
        Session talk = Session.findById(talkId);
        Member member = Member.findByLogin(Security.connected());
        if (member != null && talk != null) {
            // Can't vote on a passed event
            if (talk.event.isCurrent()) {
                Vote vote = Vote.findVote(talk, member);
View Full Code Here

    }
   
    @Test
    public void grantedTroller() {
        // Member add five comments
        final Session s = Session.all().first();
        final Article a = Article.all().first();
        comment(member, s, 5)// 5 comments on a session
        comment(member, a, 5)// 5 comments on an article
        final Set<Badge> actualBadges = computer.compute(member, new BadgeComputationContext());
        assertEquals(EnumSet.of(Badge.Brave, Badge.Troller), actualBadges);
View Full Code Here

public class LookSessionActivityTest extends AbstractActivityTest {

    @Test
    public void lookSession() {
       
        Session s = Session.all().first();
       
        // No activity for the session
        assertEquals(0, Activity.count("session = ?", s));
        assertNull(Activity.find("session = ?", s).first());
       
        s.lookedBy(member);
       
        // One activity for the session
        assertEquals(1, Activity.count("session = ?", s));
        Activity a = Activity.find("session = ?", s).first();
        assertActivity(a);
View Full Code Here

    }

    @Test
    public void lookSessionBySpeaker() {
       
        Session s = Session.all().first();
       
        // No activity for the session
        assertEquals(0, Activity.count("session = ?", s));
        assertNull(Activity.find("session = ?", s).first());
       
        // Session looked by one of speakers
        s.lookedBy(s.speakers.iterator().next());
       
        // Still no activity for the session
        assertEquals(0, Activity.count("session = ?", s));
        assertNull(Activity.find("session = ?", s).first());
    }
View Full Code Here

    }

    @Test
    public void lookSessionByNull() {
       
        Session s = Session.all().first();
       
        // No activity for the session
        assertEquals(0, Activity.count("session = ?", s));
        assertNull(Activity.find("session = ?", s).first());
       
        // A not connected user looked at the session
        s.lookedBy(null);
       
        // Still no activity for the session
        assertEquals(0, Activity.count("session = ?", s));
        assertNull(Activity.find("session = ?", s).first());
    }
View Full Code Here

                Logger.info("Generating dummy session comments for member "+m);

                final int nbComments = Dummy.randomInt(2*averageCommentsPerMember);
                for (int i = 0; i < nbComments; i++) {
                    Session s = sessions.get(Dummy.randomInt(sessions.size()));
                    s.addComment(new SessionComment(m, s, Dummy.randomText(3000)));
                    s.save();
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of models.Session

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.