Package org.encuestame.persistence.domain

Examples of org.encuestame.persistence.domain.HashTag


     * Test Get total usage by hashTag.
     */
    @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);
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);
View Full Code Here

    /**
     * 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);

View Full Code Here

     */
    @Category(PerformanceTest.class)
  @Test
    public void testGetHashTagUsedOnItemsVotedbySevenDaysPeriod()
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        final HashTag tag = createHashTag("season");
        this.createTweetPollsItemsVote(tag);
     //   this.createPollsItemsVote(tag);
        final HashTagDetailStats detail = statisticsService
                .getHashTagUsedOnItemsVoted(tag.getHashTag(), 0, 100, request,
                        SearchPeriods.SEVENDAYS);

//    Assert.assertEquals("Should be equals", 35, detail.getValue()
//        .intValue());

View Full Code Here

     */
    @Category(PerformanceTest.class)
   // @Test
    public void testGetHashTagUsedOnItemsVotedbyThirtyDayPeriod()
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        final HashTag tag = createHashTag("season");
        this.createTweetPollsItemsVote(tag);
        this.createPollsItemsVote(tag);
        HashTagDetailStats detail = statisticsService
                .getHashTagUsedOnItemsVoted(tag.getHashTag(), 0, 100, request,
                        SearchPeriods.THIRTYDAYS);
    Assert.assertEquals("Should be equals", 54, detail.getValue()
        .intValue());
    }
View Full Code Here

     */
    @Category(PerformanceTest.class)
  //  @Test
    public void testGetHashTagUsedOnItemsVotedbyOneYearPeriod()
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        final HashTag tag = createHashTag("season");
        this.createTweetPollsItemsVote(tag);
        this.createPollsItemsVote(tag);
        HashTagDetailStats detail = statisticsService
                .getHashTagUsedOnItemsVoted(tag.getHashTag(), 0, 150, request,
                        SearchPeriods.ONEYEAR);

    Assert.assertEquals("Should be equals", 90, detail.getValue()
        .intValue());
    }
View Full Code Here

     */
    @Category(PerformanceTest.class)
  @Test
    public void testGetHashTagUsedOnItemsVotedbyAllPeriod()
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        final HashTag tag = createHashTag("season");
        this.createTweetPollsItemsVote(tag);
        this.createPollsItemsVote(tag);
        HashTagDetailStats detail = statisticsService
                .getHashTagUsedOnItemsVoted(tag.getHashTag(), 0, 100, request,
                        SearchPeriods.ALLTIME);
//    Assert.assertEquals("Should be equals", 91, detail.getValue()
//        .intValue());
    }
View Full Code Here

     */
  @Category(PerformanceTest.class)
  @Test
    public void testGetHashTagUsedOnItemsVotedbyTwentyFourHoursPeriod()
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        final HashTag tag = createHashTag("season");
        this.createTweetPollsItemsVote(tag);
        this.createPollsItemsVote(tag);
        HashTagDetailStats detail = statisticsService
                .getHashTagUsedOnItemsVoted(tag.getHashTag(), 0, 100, request,
                        SearchPeriods.TWENTYFOURHOURS);
//        Assert.assertEquals("Should be equals", 19, detail.getValue().intValue());
    }
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,
                getSpringSecurityLoggedUserAccount());
        tpoll.getHashTags().add(mytag);
        tpoll.setCreateDate(createdAt.toDate());
        getTweetPoll().saveOrUpdate(tpoll);

        // Tweetpoll 2
        final TweetPoll tpoll2 = createPublishedTweetPoll(5L, question,
                getSpringSecurityLoggedUserAccount());
        tpoll2.getHashTags().add(mytag);
        tpoll.setCreateDate(createdAt.toDate());
        getTweetPoll().saveOrUpdate(tpoll2);
        createdAt = this.creationDate.minusMonths(2);

        // Tweetpoll 3
        final TweetPoll tpoll3 = createPublishedTweetPoll(6L, question,
                getSpringSecurityLoggedUserAccount());
        tpoll3.getHashTags().add(mytag);
        tpoll3.setCreateDate(createdAt.toDate());
        getTweetPoll().saveOrUpdate(tpoll3);
        //myDate.add(Calendar.MONTH, -2);
        createdAt = this.creationDate.minusMonths(4);

         final Poll poll4 = createDefaultPoll(question,
                 getSpringSecurityLoggedUserAccount());
         poll4.getHashTags().add(mytag);
         poll4.setCreateDate(createdAt.toDate());
         getPollDao().saveOrUpdate(poll4);


         createdAt = this.creationDate.minusMonths(6);
         final Survey survey5 = createDefaultSurvey(
                getSpringSecurityLoggedUserAccount().getAccount(),
                "survey name", createdAt.toDate());
        survey5.getHashTags().add(mytag);
        getSurveyDaoImp().saveOrUpdate(survey5);


        final List<HashTagDetailStats> stats = getStatisticsService()
                .getTotalUsagebyHashtagAndDateRangeGraph(mytag.getHashTag(), SearchPeriods.ONEYEAR, this.request);

        Assert.assertEquals("Should be equals", 4, stats.size());
    }
View Full Code Here

     * @throws EnMeNoResultsFoundException
     */
    @Test
    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());
        tp1.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp1);
        assertNotNull(tp1);

        // TP 2
        releaseDate.add(Calendar.HOUR, -1);
        final TweetPoll tp2 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp2.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp2);
        assertNotNull(tp2);

        // TP 3
        releaseDate.add(Calendar.HOUR, -3);
        final TweetPoll tp3 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp3.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp3);
        assertNotNull(tp3);

        // TP 4
        releaseDate.add(Calendar.DATE, -1);
        releaseDate.add(Calendar.HOUR, -5);
        final TweetPoll tp4 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp4.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp4);
        assertNotNull(tp4);

        // TP 5
        releaseDate.add(Calendar.DATE, -1);
        final TweetPoll tp5 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp5.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp5);
        assertNotNull(tp5);

        // TP 6
        releaseDate.add(Calendar.DATE, -1);
        releaseDate.add(Calendar.HOUR, -2);
        final TweetPoll tp6 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp6.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp6);
        assertNotNull(tp6);

        // TP 7
        releaseDate.add(Calendar.YEAR, -1);
        final TweetPoll tp7 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp7.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp7);
        assertNotNull(tp7);

        // TP 8
        releaseDate.add(Calendar.MONTH, -1);
        final TweetPoll tp8 = createPublishedTweetPoll(
                this.secondary.getAccount(), myFirstQuestion,
                releaseDate.getTime());
        tp8.getHashTags().add(myHashTag);
        getTweetPoll().saveOrUpdate(tp8);
        assertNotNull(tp8);

        final List<ItemStatDetail> itemStatDetail = new ArrayList<ItemStatDetail>();
        final ItemStatDetail isd1 = this.createItemStatDetail(tp1.getTweetPollId(),
                tp1.getCreateDate());
        final ItemStatDetail isd2 = this.createItemStatDetail(tp2.getTweetPollId(),
                tp2.getCreateDate());
        final ItemStatDetail isd3 = this.createItemStatDetail(tp3.getTweetPollId(),
                tp3.getCreateDate());
        final ItemStatDetail isd4 = this.createItemStatDetail(tp4.getTweetPollId(),
                tp4.getCreateDate());
        final ItemStatDetail isd5 = this.createItemStatDetail(tp5.getTweetPollId(),
                tp5.getCreateDate());
        final ItemStatDetail isd6 = this.createItemStatDetail(tp6.getTweetPollId(),
                tp6.getCreateDate());
        final ItemStatDetail isd7 = this.createItemStatDetail(tp7.getTweetPollId(),
                tp7.getCreateDate());
        final ItemStatDetail isd8 = this.createItemStatDetail(tp7.getTweetPollId(),
                tp8.getCreateDate());

        itemStatDetail.add(isd1);
        itemStatDetail.add(isd2);
        itemStatDetail.add(isd3);
        itemStatDetail.add(isd4);
        itemStatDetail.add(isd5);
        itemStatDetail.add(isd6);
        itemStatDetail.add(isd7);
        itemStatDetail.add(isd8);

        final List<HashTagDetailStats> compareHashtagListGraph = getStatisticsService()
                .compareHashtagListGraph(itemStatDetail, SearchPeriods.ALLTIME,
                        this.request);

        List<HashTagDetailStats> getHashtagAndDateRangeGraphList = getStatisticsService()
                .getTotalUsagebyHashtagAndDateRangeGraph(
                        myHashTag.getHashTag(), SearchPeriods.ALLTIME,
                        this.request);
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.HashTag

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.