Package org.encuestame.utils.json

Examples of org.encuestame.utils.json.TweetPollBean


    final TweetPoll tweetPollPublicate = createTweetPollPublicated(true,
        true, new Date(), this.userAccount, this.question);
    createQuestionAnswer("Yes", this.question, "EEEE");
    createQuestionAnswer("No", this.question, "FFFF");
    final String tweetUrl = "http://www.encuestame.org";
    final TweetPollBean uniTweetPoll = createUnitTweetPollPublicated(
        new Date(), true, tweetUrl, this.user.getUid(),
        this.questionBean, "testtweetuser");
    uniTweetPoll.setId(tweetPollPublicate.getTweetPollId());
    // final String twettQuestionText =
    // this.tweetPollService.generateTweetPollText(uniTweetPoll, tweetUrl);
    final String twettQuestionText = "test";
    assertNotNull(twettQuestionText);
    final Integer textLength = twettQuestionText.length();
View Full Code Here


   */
  @Test
  @Category(DefaultTest.class)
  public void testValidateIp() throws EnMeExpcetion {
    final String ipVote = EnMeUtils.ipGenerator();
    final TweetPollBean myTpBean = createUnitTweetPoll(Boolean.TRUE,
        "tweetPollUrl", getSpringSecurityLoggedUserAccount().getUid(),
        questionBean);
    final TweetPoll myTweetPoll = tweetPollService.createTweetPoll(
        myTpBean, "What is your favourite city?",
        getSpringSecurityLoggedUserAccount(), null);
View Full Code Here

    final TweetPoll tp = createTweetPollPublicated(true, true, dt.toDate(),
        this.userAccount, question1);

    final QuestionBean questionBean = createUnitQuestionBean(
        " Mi nueva pregunta", null, null, null);
    final TweetPollBean tpBeanToUpdate = createTweetPoll(Boolean.FALSE,
        Boolean.FALSE, Boolean.FALSE, new Date(), Boolean.FALSE,
        Boolean.FALSE, Boolean.FALSE, new Date(), " ",
        this.userAccount.getUid(), questionBean, "twitterAccoint",
        tp.getTweetPollId());
View Full Code Here

     *            tweet poll.
     * @return {@link TweetPollBean}
     */
    public static final TweetPollBean convertTweetPollToBean(
            final TweetPoll tweetPoll) {
        final TweetPollBean unitTweetPoll = new TweetPollBean();
        unitTweetPoll.setId(tweetPoll.getTweetPollId());
        unitTweetPoll.setScheduleDate(tweetPoll.getScheduleDate());
        unitTweetPoll.setCreateDate(DateUtil.getFormatDate(tweetPoll.getCreateDate()));
        unitTweetPoll.setCreateDateComparable(tweetPoll.getCreateDate());
        unitTweetPoll.setAllowLiveResults(tweetPoll.getAllowLiveResults() == null ? false
                        : tweetPoll.getAllowLiveResults());
        unitTweetPoll.setResumeLiveResults(tweetPoll.getResumeLiveResults() == null ? false
                        : tweetPoll.getResumeLiveResults());
        unitTweetPoll.setSchedule(tweetPoll.getScheduleTweetPoll() == null ? false
                        : tweetPoll.getScheduleTweetPoll());
        unitTweetPoll.setResultNotification(tweetPoll.getResultNotification() == null ? false
                        : tweetPoll.getResultNotification());
        unitTweetPoll.setUserId(tweetPoll.getTweetOwner().getUid());
        unitTweetPoll.setOwnerUsername(tweetPoll.getEditorOwner() == null ? null
                        : tweetPoll.getEditorOwner().getUsername());
        unitTweetPoll.setCaptcha(tweetPoll.getCaptcha() == null ? false
                : tweetPoll.getCaptcha());
        unitTweetPoll.setCloseNotification(tweetPoll.getCloseNotification() == null ? false
                        : tweetPoll.getCloseNotification());
        unitTweetPoll.setFavourites(tweetPoll.getFavourites() == null ? false : tweetPoll.getFavourites());
        unitTweetPoll.setCompleted(tweetPoll.getCompleted() == null ? false : tweetPoll.getCompleted());
        unitTweetPoll.setQuestionBean(convertQuestionsToBean(tweetPoll.getQuestion()));
        unitTweetPoll.setHits(tweetPoll.getHits() == null ? EnMeUtils.VOTE_MIN
                : tweetPoll.getHits());
        unitTweetPoll.setAllowRepeatedVotes(tweetPoll.getAllowRepatedVotes() == null ? false
                        : tweetPoll.getAllowRepatedVotes());
        unitTweetPoll.setHashTags(ConvertDomainBean.convertListHashTagsToBean(new ArrayList<HashTag>(tweetPoll
                        .getHashTags())));
        unitTweetPoll.setTotalVotes(tweetPoll.getNumbervotes() == null ? EnMeUtils.VOTE_MIN
                        : Long.valueOf(tweetPoll.getNumbervotes()));
        unitTweetPoll.setCreatedDateAt(tweetPoll.getCreateDate());
        unitTweetPoll.setLimitVotesDate(tweetPoll.getDateLimit() == null ? false
                        : tweetPoll.getDateLimit());
        unitTweetPoll.setUpdateDate(tweetPoll.getUpdatedDate());
        if (tweetPoll.getDateLimit() != null
                && tweetPoll.getDateLimited() != null) {
            unitTweetPoll.setDateToLimit(tweetPoll.getDateLimited() == null ? null
                            : DateUtil.DOJO_DATE_FORMAT.format(tweetPoll
                                    .getDateLimited()));
        }
        unitTweetPoll
                .setRelevance(tweetPoll.getRelevance() == null ? EnMeUtils.RATE_DEFAULT
                        : tweetPoll.getRelevance());
        unitTweetPoll.setItemType(TypeSearchResult.TWEETPOLL.toString()
                .toLowerCase());
        return unitTweetPoll;
    }
View Full Code Here

             final Long userId,
             final QuestionBean questionBean,
             final String userTwitterAccount

             ){
         TweetPollBean unitTweetPoll = new TweetPollBean();
         unitTweetPoll.setUserId(userId);
         unitTweetPoll.setAllowLiveResults(allowLiveResults);
         unitTweetPoll.setCloseNotification(closeNotification);
         unitTweetPoll.setCompleted(completed);
         unitTweetPoll.setPublishPoll(publishPoll);
         unitTweetPoll.setQuestionBean(createUnitQuestionBean("", 1L, 1L, null));
         unitTweetPoll.setResultNotification(resultNotification);
         unitTweetPoll.setResults(null);
         unitTweetPoll.setSchedule(schedule);
         unitTweetPoll.setScheduleDate(scheduleDate);
         unitTweetPoll.setTweetUrl(tweetUrl);
        // unitTweetPoll.setTwitterUserAccount(null);
        return unitTweetPoll;
     }
View Full Code Here

        final Long userId,
        final QuestionBean questionBean,
        final String userTwitterAccount,
        final Long tpollId
        ){
    final TweetPollBean tpollBean = this.createTweetPoll(allowLiveResults,
        closeNotification, completed, publicationDateTweet,
        publishPoll, resultNotification, schedule, scheduleDate,
        tweetUrl, userId, questionBean, userTwitterAccount);
    return tpollBean;
View Full Code Here

            final Boolean resultNotification, final Integer limitVotes,
            final Long relevance, final Long hits, final Long likeVote,
            final Long dislikeVote, final String createDate,
            final Date scheduleDate, final Date updateDate,
            final String dateToLimit) {
        TweetPollBean unitTweetPoll = new TweetPollBean();
        unitTweetPoll.getCloseNotification();
        unitTweetPoll.setCaptcha(captcha);
        unitTweetPoll.setAllowLiveResults(allowLiveResults);
        unitTweetPoll.setLimitVotes(limitVotes);
        unitTweetPoll.setResultNotification(resultNotification);
        unitTweetPoll.setRelevance(relevance);
        unitTweetPoll.setHits(hits);
        unitTweetPoll.setLikeVote(likeVote);
        unitTweetPoll.setDislikeVote(dislikeVote);
        unitTweetPoll.setCreateDate(createDate);
        unitTweetPoll.setScheduleDate(scheduleDate);
        unitTweetPoll.setUpdateDate(updateDate);
        unitTweetPoll.setDateToLimit(dateToLimit);
        unitTweetPoll.setUpdateDate(updateDate);
        unitTweetPoll.setUserId(userId);
        unitTweetPoll.setPublishPoll(publishPoll);
        unitTweetPoll.setQuestionBean(createUnitQuestionBean("", 1L, 1L,
                null));
        unitTweetPoll.setResults(null);
        unitTweetPoll.setTweetUrl(tweetUrl);

        // unitTweetPoll.setTwitterUserAccount(null);
        return unitTweetPoll;
    }
View Full Code Here

     */
    public TweetPollBean createUnitTweetPollPublicated(
            final Date publicationDateTweet, final Boolean publishPoll,
            final String tweetUrl, final Long userId,
            final QuestionBean questionBean, final String userTwitterAccount) {
        TweetPollBean unitTweetPoll = new TweetPollBean();
        unitTweetPoll.setUserId(userId);
        unitTweetPoll.setPublishPoll(publishPoll);
        unitTweetPoll.setQuestionBean(createUnitQuestionBean("", 1L, 1L,
                null));
        unitTweetPoll.setResults(null);
        unitTweetPoll.setTweetUrl(tweetUrl);

        // unitTweetPoll.setTwitterUserAccount(null);
        return unitTweetPoll;
      }
View Full Code Here

     * @return
     */
    public TweetPollBean createUnitTweetPoll(final Boolean publishPoll,
            final String tweetUrl, final Long userId,
            final QuestionBean questionBean) {
        final TweetPollBean tpBean = this.createUnitTweetPollPublicated(
                new Date(), publishPoll, tweetUrl, userId, questionBean, "",
                Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, null, 1L, 1L, 1L,
                1L, null, null, null, null);
        return tpBean;
    }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.json.TweetPollBean

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.