Package org.encuestame.persistence.domain.tweetpoll

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll


  public void testCreateTweetPollNotification()
      throws EnMeNoResultsFoundException {
    final Question question1 = createQuestion("Why the sea is salt? 6",
        "html");

    final TweetPoll tp = createTweetPollPublicated(true, true, new Date(),
        this.userAccount, question1);

    getTweetPollService().createTweetPollNotification(tp);
    final List<Notification> noti = getNotification()
        .loadNotificationByUserAndLimit(this.userAccount.getAccount(),
View Full Code Here


  @Category(DefaultTest.class)
  public void testCreateTweetPollPublishedNotification()
      throws EnMeNoResultsFoundException {


    final TweetPoll tp = createTweetPollPublicated(true, true, new Date(),
        this.userAccount, this.question);
    // Publish Tweetpoll on Social network
    // Social Accounts & Providers
    final SocialAccount socialAccount = createDefaultSettedSocialAccount(this.userAccount);
View Full Code Here

  @Test
  public void testgenerateTweetPollContent() throws EnMeExpcetion {
    final Question question1 = createQuestion("Why the sea is salt? 6",
        "html");

    final TweetPoll tp = createTweetPollPublicated(true, true, new Date(),
        this.userAccount, question1);
    final String tweetcontent = getTweetPollService()
        .generateTweetPollContent(tp);
  }
View Full Code Here

  @Test
  public void testremoveQuestionAnswer() throws EnMeNoResultsFoundException {
    final Question question1 = createQuestion("Why the sea is salt? 6",
        "html");

    final TweetPoll myTweetPoll = createTweetPollPublicated(true, true,
        new Date(), this.userAccount, question1);

    final QuestionAnswerBean qAnswerBean = createAnswersBean("26354",
        "Yes", question1.getQid());
    final QuestionAnswerBean qAnswerBean2 = createAnswersBean("26355",
View Full Code Here

  public void testSearchTweetsPollScheduled() throws EnMeExpcetion {

    final Question question1 = createQuestion("Why the sky is blue ?",
        "html");
    final DateTime dt = new DateTime();
    final TweetPoll tp = createTweetPollPublicated(true, true, dt.toDate(),
        this.userAccount, question1);
    tp.setScheduleTweetPoll(Boolean.TRUE);
    tp.setFavourites(Boolean.TRUE);
    getTweetPoll().saveOrUpdate(tp);

    final TweetPoll tp2 = createDefaultTweetPollPublicated(true, true,
        true, this.userAccount,
        createQuestion("Why the sky is red", "html"), dt.toDate());

    final TweetPollSearchBean tpbean222 = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, " ",
View Full Code Here

  public void testSearchTweetsPollFavourites() throws EnMeExpcetion {

    final Question question1 = createQuestion("Why the sea is big? ",
        "html");
    final DateTime dt = new DateTime();
    final TweetPoll tp = createTweetPollPublicated(true, true, dt.toDate(),
        this.userAccount, question1);

    tp.setScheduleTweetPoll(Boolean.TRUE);
    tp.setFavourites(Boolean.TRUE);
    getTweetPoll().saveOrUpdate(tp);

    final TweetPollSearchBean tpbean22 = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, " ",
        "7", 10, 0, TypeSearch.FAVOURITES);
View Full Code Here

  public void testsearchTweetsPollsLastWeek() throws EnMeExpcetion {

    final Question question1 = createQuestion("Why the sea is salad?",
        "html");
    final DateTime dt = new DateTime();
    final TweetPoll tp = createTweetPollPublicated(true, true, dt
        .minusDays(3).toDate(), this.userAccount, question1);
    tp.setTweetPollFolder(this.folder);
    tp.setScheduleTweetPoll(Boolean.TRUE);
    getTweetPoll().saveOrUpdate(tp);
    final TweetPollSearchBean tpbean = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, " ",
        "7", 10, 0, TypeSearch.LASTDAY);
    final List<SearchBean> tpLastWeek = getTweetPollService()
View Full Code Here

     * Test get comments by user.
     */
    @Test
    public void getCommentsbyUser(){
        final Question question2 = createQuestion("Who will win the supercopa", "");
        final TweetPoll tpoll2 = createPublishedTweetPoll(user.getAccount(), question2);
        createDefaultTweetPollComment("I was playing pc games", tpoll2, user);
        final List<CommentOptions> commentOpt = new ArrayList<>();
        commentOpt.add(CommentOptions.ALL);
        final List<Comment> commentList = getCommentsOperations().getCommentsbyUser(this.user, this.MAX_RESULTS, this.START, commentOpt);
        assertEquals("Should be equals", 2, commentList.size());
View Full Code Here

     * (non-Javadoc)
     * @see org.encuestame.persistence.dao.ITweetPoll#getTotalVotesByTweetPollIdAndDateRange(java.lang.Long, java.lang.Integer)
     */
    public Long getTotalVotesByTweetPollIdAndDateRange(final Long tweetPollId, final String period) {
        Long totalvotes = 0L;
        final TweetPoll tpoll = this.getTweetPollById(tweetPollId);
        final List<TweetPollSwitch> tpSwitchAnswers = this
                .getListAnswersByTweetPollAndDateRange(tpoll);
        final SearchPeriods searchPeriods = SearchPeriods.getPeriodString(period);
        for (TweetPollSwitch tweetPollSwitch : tpSwitchAnswers) {
            totalvotes += this.getTotalTweetPollResultByTweetPollSwitch(tweetPollSwitch, searchPeriods);
View Full Code Here

     @Test
     public void testComments(){
         final Comment comments = new Comment();
         final UserAccount user = createUserAccount("diana", createAccount());
         final Question question = createQuestion("Who I am?", "");
         final TweetPoll tpoll = createPublishedTweetPoll(user.getAccount(), question);
         comments.setComment("First comment");
         comments.setCreatedAt(new Date());
         comments.setLikeVote(1L);
         comments.setDislikeVote(2L);
         comments.setUser(user);
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.tweetpoll.TweetPoll

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.