Package org.encuestame.persistence.domain.question

Examples of org.encuestame.persistence.domain.question.Question


     * @param patron patron
     * @param user user
     * @return {@link Question}
     */
    public Question createQuestion(final String question, final String patron, final Account user){
        final Question questions = this.createQuestion(question, user);
        questions.setQidKey("1");
        questions.setHits(2L);
        questions.setCreateDate(new Date());
        getQuestionDaoImp().saveOrUpdate(questions);
        return questions;
    }
View Full Code Here


     * Create Fast TweetPoll Votes.
     * @return tweet poll
     */
    public TweetPoll createFastTweetPollVotes(){
        final UserAccount secondary = createUserAccount("jhon-"+RandomStringUtils.randomAscii(4), createAccount());
        final Question question = createQuestion("who I am?", "");
        final QuestionAnswer questionsAnswers1 = createQuestionAnswer("yes", question, "12345");
        final QuestionAnswer questionsAnswers2 = createQuestionAnswer("no", question, "12346");
        final TweetPoll tweetPoll = createPublishedTweetPoll(secondary.getAccount(), question);
        final TweetPollSwitch pollSwitch1 = createTweetPollSwitch(questionsAnswers1, tweetPoll);
        final TweetPollSwitch pollSwitch2 = createTweetPollSwitch(questionsAnswers2, tweetPoll);
View Full Code Here

    /**
     * Create a list of fakes {@link TweetPoll}.
     * @param userAccount
     */
    public void createFakesTweetPoll(final UserAccount userAccount){
        final Question question = createQuestion("Real Madrid or Barcelona?", userAccount.getAccount());
        final Question question1 = createQuestion("Real Madrid or Barcelona?", userAccount.getAccount());
        final Question question2 = createQuestion("Real Madrid or Barcelona?", userAccount.getAccount());
        final Question question3 = createQuestion("Real Madrid or Barcelona?", userAccount.getAccount());
        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), userAccount, question);
        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), userAccount, question1);
        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), userAccount, question2);
        createTweetPollPublicated(Boolean.TRUE, Boolean.TRUE, new Date(), userAccount, question3);
    }
View Full Code Here

     * @throws NoSuchAlgorithmException
     * @throws UnsupportedEncodingException
     */
    public Question createQuestionRandom() throws NoSuchAlgorithmException,
            UnsupportedEncodingException {
        final Question randomQuestion = createQuestion(
                "What is your favorite season? "
                        + MD5Utils
                                .md5(RandomStringUtils.randomAlphanumeric(15)),
                "");
        return randomQuestion;
View Full Code Here

            final Boolean isScheduled, final Boolean isPublished)
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        int j = 0;
        final String randomTweetContent = RandomStringUtils
                .randomAlphanumeric(6);
        final Question tpollQuestion = createQuestionRandom();
        final TweetPoll tweetPoll = createPublishedTweetPoll(tweetOwner,
                tpollQuestion);
        tweetPoll.setCompleted(isCompleted);
        tweetPoll.setFavourites(isFavourites);
        tweetPoll.setScheduleTweetPoll(isScheduled);
View Full Code Here

     * @throws EnMeNoResultsFoundException
     * @throws EnMeSearchException
     */
    @Test
    public void testGetTotalHashTagHitsbyDateRange() throws EnMeNoResultsFoundException, EnMeSearchException{
        final Question question = createQuestion("What is your favorite type of song?", "");
        final HashTag tag = createHashTag("romantic");
        final Calendar myDate = Calendar.getInstance();
        // TweetPoll
        final TweetPoll tpoll = createPublishedTweetPoll(5L, question,
                getSpringSecurityLoggedUserAccount());
View Full Code Here

     */
    @Test
    public void getTweetPollSocialNetworkLinksbyTagAndDateRange() {
        final Calendar calendarDate = Calendar.getInstance();
        final HashTag hashtag1 = createHashTag("romantic");
        final Question question = createQuestion(
                "What is your favorite hobbie?", "");
        // TweetPoll 1
        final TweetPoll tp = createPublishedTweetPoll(question, this.secondary);
        tp.getHashTags().add(hashtag1);
        getTweetPoll().saveOrUpdate(tp);
View Full Code Here

    @Test
    public void testGetTotalVotesbyHashTagUsageAndDateRange() throws EnMeSearchException{

        DateTime updateDate = new DateTime();

        final Question question2 = createQuestion("Who will win  the spain league 2012?", "");
        final QuestionAnswer answerMadrid = createQuestionAnswer("Real Madrid", question2, "98765");
        final QuestionAnswer answerBarsa = createQuestionAnswer("Barcelon", question2, "765432");

        final TweetPoll tweetpoll2 = createPublishedTweetPoll(5L, question2,
                getSpringSecurityLoggedUserAccount());
View Full Code Here

    @Test
    public void testGetTotalUsageByHashTag() {
        final Account account = createAccount();
        final HashTag hashtag1 = createHashTag("romantic");

        final Question question = createQuestion("What is your favorite type of movies?", "");
        final Date myDate = new Date();
        // TweetPoll
        final TweetPoll tp = createPublishedTweetPoll(question, this.secondary);
        tp.getHashTags().add(hashtag1);
        getTweetPoll().saveOrUpdate(tp);

        // Poll
        final Poll poll = createPoll(myDate, question, this.secondary,
                Boolean.TRUE, Boolean.TRUE);
        poll.getHashTags().add(hashtag1);
        getPollDao().saveOrUpdate(poll);

        // Poll 2
        final Question question2 = createQuestion("What is your favorite type of music?", "");
         final Poll poll2 = createPoll(myDate, question2, this.secondary,
                Boolean.TRUE, Boolean.TRUE);
        poll2.getHashTags().add(hashtag1);
        getPollDao().saveOrUpdate(poll2);
View Full Code Here

     * Test get social network by hash tag.
     */
    @Test
    public void testGetSocialNetworkUseByHashTag(){
        final HashTag hashtag1 = createHashTag("romantic");
        final Question question = createQuestion("What is your favorite type of movies?", "");
        final TweetPoll tp = createPublishedTweetPoll(question, this.secondary);
        tp.getHashTags().add(hashtag1);
        getTweetPoll().saveOrUpdate(tp);
        final TweetPoll tp2 = createPublishedTweetPoll(question, this.secondary);
        tp2.getHashTags().add(hashtag1);
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.question.Question

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.