Package org.encuestame.persistence.domain.question

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


     }

     /** Test item vote. **/
     @Test
     public void testRate(){
         final Question question = createQuestion("Who will win the Champions League match today?", "");
         final Account account = createAccount();
         final UserAccount user = createUserAccount("carlos", account);
         final TweetPoll tpoll = createPublishedTweetPoll(account, question);
         final Comment comment = createDefaultTweetPollComment("my first comment", tpoll, user);
         final AccessRate rateItem = new AccessRate();
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);
View Full Code Here

    * Test retrieve Results Poll By PollId.
    **/
    @Test
    public void testRetrievePollResultsById(){
        final Poll poll = createPoll(myDate.getTime(), this.question, "FDKdsadsads125", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        final Question quest = createQuestion("Do you like futboll", "Yes/No");
        final QuestionAnswer qansw = createQuestionAnswer("Yes", quest, "2020");
        final QuestionAnswer qansw2 =createQuestionAnswer("No", quest, "2021");
        createPollResults(qansw2, poll);
        createPollResults(qansw2, poll);
        createPollResults(qansw2, poll);
View Full Code Here

     * Test Get Polls By Question Keyword.
     */
    @Test
    public void testGetPollsByQuestionKeyword(){
        assertNotNull(this.poll);
        Question question1 = createQuestion("Is Guns and Roses your favorite Group?", "html");
        createPoll(myDate.getTime(), question1, "FDK125sada", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        Question question2 = createQuestion("Real Madrid VS Barcelona", "html");
        createPoll(myDate.getTime(), question2, "FDK125231321", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        final String keywordQuestion = "roses";
        flushIndexes();
        final List<Poll> listPoll = getPollDao().getPollsByQuestionKeyword(keywordQuestion, this.userAccount, this.MAX_RESULTS, this.START);
        assertEquals("Should be equals", 2, listPoll.size());
View Full Code Here

        assertEquals("Should be equals", 3, pollList.size());
    }

    @Test
    public void testRetrievePollsByUserId(){
        final Question question2 =  createQuestion("Why the sea is blue?","html");
        createPoll(new Date(), question2, "FDK126", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        final List<Poll> pollbyUser = getPollDao().retrievePollsByUserId(this.userAccount, this.MAX_RESULTS, this.START);
        assertEquals("Should be equals", 2, pollbyUser.size());
    }
View Full Code Here

     * Get total polls by hashtag name and date range.
     */
    @Test
    public void testGetPollsbyHashTagNameAndDateRange(){
        final Calendar myDate = Calendar.getInstance();
        final Question myQuestion = createQuestion("what are your favorite flowers?", this.userAccount.getAccount());
        final HashTag hashtag1 = createHashTag("roses");

        final Poll poll1 = createPoll(myDate.getTime(), myQuestion,
                "DPMU12", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        poll1.getHashTags().add(hashtag1);
        getPollDao().saveOrUpdate(poll1);
        myDate.add(Calendar.DATE, -2);


        final Question myQuestion2 = createQuestion("What was your best gift for valentines day?", this.userAccount.getAccount());
        final Poll poll2 = createPoll(myDate.getTime(), myQuestion2,
                "DPMU19", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        poll2.getHashTags().add(hashtag1);
        getPollDao().saveOrUpdate(poll2);
        final List<Poll> getTotalPollsbyHashTag = getPollDao().getPollsbyHashTagNameAndDateRange(hashtag1.getHashTag(), SearchPeriods.SEVENDAYS);
View Full Code Here

     * Test for recovering all poll results by answer.
     */
    @Test
    public void testRetrievePollResultsByAnswer(){
        final Poll poll = createPoll(myDate.getTime(), this.question, "FDKL1", this.userAccount, Boolean.TRUE, Boolean.TRUE);
        final Question quest = createQuestion("Do you like futboll", "Yes/No");
        final QuestionAnswer qansw = createQuestionAnswer("Yes", quest, "2020");
        final QuestionAnswer qansw2 =createQuestionAnswer("No", quest, "2021");
        // Create poll results for QuestionAnswer2 = 3
        createPollResults(qansw2, poll);
        createPollResults(qansw2, poll);
View Full Code Here

    /**
     * Test create question.
     */
    @Test
    public void testCreateQuestion(){
        final Question question = createQuestion("Why encuestame is better than polldady?", this.user);
        final Question retrieveQuestion = getQuestionDaoImp().retrieveQuestionById(question.getQid());
        assertEquals("Questions should be equals",question.getQid() , retrieveQuestion.getQid());
    }
View Full Code Here

     * Test Retrieve Question by Id and User.
     */
    @Ignore
    @Test
    public void testRetrieveQuestionbyId(){
      final Question retrieveQ = getQuestionDaoImp().retrieveQuestionbyId(this.initQuestion.getQid(), this.user.getUid());
    }
View Full Code Here

  /*
   * Test Retrieve answers by question.
   */
  @Test
  public void testRetrieveAnswersbyQuestion() {
    final Question question1 = createDefaultQuestion(" Question 1");
    final Question question2 = createDefaultQuestion(" Question 2");
    final Question question3 = createDefaultQuestion(" Question 3");
    final QuestionAnswer qA1 = createDefaultQuestionAnswer("Yes", question1);
    final QuestionAnswer qA2 = createDefaultQuestionAnswer("No", question1);
    final QuestionAnswer qA3 = createDefaultQuestionAnswer("Maybe",
        question3);
    final QuestionAnswer qAnswer = getQuestionDaoImp()
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.