Package org.encuestame.persistence.domain.question

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


     * Test total hashTag used on items voted.
     */
    @Test
    public void testGetHashTagUsedOnItemsVoted(){
        final HashTag hashtag1 = createHashTag("season");
        final Question question = createQuestion("What is your favorite season?", "");
        final TweetPoll tp = createPublishedTweetPoll(question, this.secondary);
        tp.getHashTags().add(hashtag1);
        getTweetPoll().saveOrUpdate(tp);

        // Item 2
        final Question question2 = createQuestion("What is your favorite holidays?", "");
        final TweetPoll tp2 = createPublishedTweetPoll(question2, this.secondary);
        tp2.getHashTags().add(hashtag1);
        getTweetPoll().saveOrUpdate(tp2);

        final QuestionAnswer questionsAnswers1 = createQuestionAnswer("yes", question, "7891011");
View Full Code Here


            final Date randomDate, final String[] answers, final Boolean voteItem)
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        int j = 0;
        List<TweetPollSwitch> tpollSwitchList = new ArrayList<TweetPollSwitch>();
        // Creating question ...
        final Question question =  this.createRandomQuestion();

        // Creating tweetpoll...

        final TweetPoll myTweet = createPublishedTweetPoll(question,
                getSpringSecurityLoggedUserAccount());
View Full Code Here

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

            final String[] answers, final Boolean voteItem)
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        int j = 0;
        List<QuestionAnswer> qAnswersList = new ArrayList<QuestionAnswer>();

        final Question pollQuestion = this.createRandomQuestion();
        final Poll myPoll = createPoll(randomDate, pollQuestion,
                MD5Utils.md5(RandomStringUtils.randomAlphanumeric(4)),
                getSpringSecurityLoggedUserAccount(), Boolean.TRUE, Boolean.TRUE);
        myPoll.getHashTags().add(tag);
        getPollDao().saveOrUpdate(myPoll);
View Full Code Here

    }

    //// /////////////////////////////////////// TEST  NEW HASHTAG CHART ///////////////////////////////////////
    @Test
    public void testGetTotalHashTagHitsbyDateRange2() throws EnMeNoResultsFoundException, EnMeSearchException{
        final Question question = createQuestion("What is your favorite type of song?", "");
        final HashTag mytag = createHashTag("romantic");
        DateTime createdAt = new DateTime();

        // TweetPoll
        final TweetPoll tpoll = createPublishedTweetPoll(5L, question,
View Full Code Here

    public void testGetTotalUsagebyHashtagAndDateRangeGraph() throws EnMeSearchException,
            EnMeNoResultsFoundException {
        final HashTag myHashTag = createHashTag("preferences");
        final Calendar releaseDate = Calendar.getInstance();

        final Question myFirstQuestion = createQuestion(
                "What is your favorite kind of movie?", secondary.getAccount());
        final Question mySecondQuestion = createQuestion(
                "What is your favorite kind of song?", secondary.getAccount());
        // TP 1
        final TweetPoll tp1 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
View Full Code Here

            throws EnMeSearchException, EnMeNoResultsFoundException {
        final Calendar currentDate = Calendar.getInstance();
        final List<HashTagListGraphData> list = getStatisticsService().getTotalUsagebyHashtagAndDateRangeListGraph( this.initHashTag.getHashTag(),
                    SearchPeriods.ONEYEAR, request);
        Assert.assertEquals("Should be equals", 1, list.size());
        final Question question = createQuestion("What is your favorite season?", "");
        final TweetPoll tp = createPublishedTweetPoll(question, this.secondary);
        tp.getHashTags().add(this.initHashTag);
        getTweetPoll().saveOrUpdate(tp);
        // Item 2
        final Question question2 = createQuestion("What is your favorite holidays?", "");
        final TweetPoll tp2 = createPublishedTweetPoll(question2, this.secondary);
        tp2.getHashTags().add(this.initHashTag);
        getTweetPoll().saveOrUpdate(tp2);
        final List<HashTagListGraphData> list2 = getStatisticsService().getTotalUsagebyHashtagAndDateRangeListGraph( this.initHashTag.getHashTag(),
                SearchPeriods.ONEYEAR, request);
View Full Code Here

     * Test Update Question Poll.
     * @throws EnMeExpcetion
     */
    @Test
    public void testUpdateQuestionPoll() throws EnMeExpcetion{
        final Question newQuestion = createQuestion("Why the tooth are white", "pattern");
        final PollBean pb = pollService.updateQuestionPoll(this.poll.getPollId(), newQuestion);
        assertEquals(newQuestion.getQuestion(), pb.getQuestionBean().getQuestionName());
     }
View Full Code Here

   * Get poll by answer
   * @throws EnMeNoResultsFoundException
   */
  @Test
  public void testGetPollByAnswerId() throws EnMeNoResultsFoundException {
    final Question q = createDefaultQuestion("question 1");
    final Question q1 = createDefaultQuestion("question 2");
    final QuestionAnswer a = createQuestionAnswer("Yes", q, "1234DF");
    final QuestionAnswer a1 = createQuestionAnswer("No", q, "5678MG");
    final QuestionAnswer a2 = createQuestionAnswer("Maybe", q1, "9101112");
    final Poll p = createDefaultPoll(q, userAccount);

View Full Code Here

  /*
   * Test for retrieve poll results.
   */
  @Test
  public void testGetResultVotes(){
          final Question quest = createQuestion("Do you like action movies", "Yes/No");
          final Poll poll = createPoll(new Date(), quest, "ACTMOV", this.userAccount, Boolean.TRUE, Boolean.TRUE);
          final QuestionAnswer qansw = createQuestionAnswer("Yes", quest, "2023");
          final QuestionAnswer qansw2 =createQuestionAnswer("No", quest, "2024");
          // Create poll results for QuestionAnswer2 = 3
          createPollResults(qansw2, poll);
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.