Package org.encuestame.persistence.domain

Examples of org.encuestame.persistence.domain.HashTag


     @Test
     public void testHashTag(){
        final String hashTag = "";
        final Long hits = 1L;
        final Long size = 10L;
        final HashTag tag = new HashTag();
        tag.setHashTag(hashTag);
        tag.setHits(hits);
        tag.setSize(size);
        tag.getTweetPoll().add(createTweetPollPublicated(
                Boolean.TRUE,
                Boolean.TRUE,
                new Date(),
                createUserAccount("juan carlos", createAccount()),
                createQuestion("Did you do the homework?", "YesNo")));
        getHashTagDao().saveOrUpdate(tag);
        assertNotNull(tag.getHashTagId());
     }
View Full Code Here


     *  Test {@link HashTagRanking} Domain.
     */
    @Test
    public void testHashTagRanking(){
        final HashTagRanking tagRanking = new HashTagRanking();
        final HashTag tag = createHashTag("health");
        tagRanking.setHashTag(tag);
        tagRanking.setAverage(25D);
        tagRanking.setRankingDate(new Date());
        getHashTagDao().saveOrUpdate(tagRanking);
    }
View Full Code Here

     */
    @Test
    public void testTweetPoll() {
        final TweetPoll tweetPoll = new TweetPoll();

        final HashTag tag1 = createHashTag("education");
        final TweetPollFolder tpFolder = createTweetPollFolder("personal",
                initUser);

        tweetPoll.setAllowLiveResults(Boolean.TRUE);
        tweetPoll.setAllowRepatedVotes(Boolean.FALSE);
View Full Code Here

    /**
     * Test Get HashTag by Name.
     */
    @Test
    public void testGetHashTagByName(){
        final HashTag ht = getHashTagDao().getHashTagByName(this.hashTag.getHashTag());
        assertEquals("Should be equals", this.hashTag.getHashTag(), ht.getHashTag());
    }
View Full Code Here

    /**
     * Get hash tags test.
     */
    @Test
    public void testGetHashTags(){
        final HashTag hashTag1 = createHashTag("America", 2000L);
        final HashTag hashTag2 = createHashTag("Amazonas", 900L);
        final HashTag hashTag3 = createHashTag("Carazo"50L);
        final HashTag hashTag4 = createHashTag("Nicaragua", 100L);
        final HashTag hashTag5 = createHashTag("Paraguay", 0L);

        final int limit = 20;
        final int start = 0;
        final List<HashTag> results = getHashTagDao().getHashTags(limit, start, "");
        Assert.assertNotNull(results);
        assertEquals("Should be equals", 6, results.size());

        final HashTag expHas1 = results.get(0);
        final HashTag expHas2 = results.get(1);
        final HashTag expHas3 = results.get(2);
        final HashTag expHas4 = results.get(3);

        assertEquals("Should be equals", hashTag1.getHashTag(), expHas1.getHashTag());
        assertEquals("Should be equals", hashTag2.getHashTag(), expHas2.getHashTag());
        assertEquals("Should be equals", hashTag4.getHashTag(), expHas3.getHashTag());
        assertEquals("Should be equals", hashTag3.getHashTag(), expHas4.getHashTag());
    }
View Full Code Here

   *
   */
  @Test
  public void testGetMaxHashTagRankDate() {
    final Calendar myDate = Calendar.getInstance();
    final HashTag tag = createHashTag("America", 20L);
    final HashTag tag1 = createHashTag("Europa", 20L);
    final HashTag tag2 = createHashTag("Asia", 20L);

    myDate.add(Calendar.DATE, -1);
    final Date maxDate = myDate.getTime();
    createHashTagRank(tag, myDate.getTime(), 20D);
    myDate.add(Calendar.DATE, -2);
View Full Code Here

   */
  @Test
  public void testgetHashTagRankStats(){
    final DateTime time = new DateTime("2010-06-25");
    //final Calendar myDate = Calendar.getInstance().setTime(time.toDate());
    final HashTag tag = createHashTag("America", 20L);
    final HashTag tag1 = createHashTag("Europa", 20L);
    final HashTag tag2 = createHashTag("Asia", 20L);
    final HashTag tag3 = createHashTag("Antartic", 20L);
    final HashTag tag4 = createHashTag("Oceania", 20L);
    final HashTag tag5 = createHashTag("Polar", 10L);


    //myDate.add(Calendar.DATE, -1);
    final DateTime time1 = time.minusDays(1);

View Full Code Here

        final DateTime dt = new DateTime();
        final DateTime minusDate = dt.minusDays(3);
        tweetPoll.setCompleted(Boolean.TRUE);
        this.tweetPoll.setCreateDate(minusDate.toDate());
        this.hashTag1 = createHashTag("hash1");
        final HashTag hashTag2 = createHashTag("hash2");
        this.tweetPoll.getHashTags().add(hashTag1);
        this.tweetPoll.getHashTags().add(hashTag2);
        getTweetPoll().saveOrUpdate(this.tweetPoll);
        this.pollSwitch1 = createTweetPollSwitch(questionsAnswers1, tweetPoll);
        this.pollSwitch2 = createTweetPollSwitch(questionsAnswers2, tweetPoll);
View Full Code Here

                myQuestion, "123457");
        final QuestionAnswer qaEurope = createQuestionAnswer("Europa",
                myQuestion, "123469");
        final TweetPoll myTweetPoll = createPublishedTweetPoll(
                secondary.getAccount(), myQuestion);
        HashTag htCitizen = createHashTag("citizen");
        HashTag htCitizenShip = createHashTag("citizenship");
        myTweetPoll.getHashTags().add(htCitizen);
        myTweetPoll.getHashTags().add(htCitizenShip);
        getTweetPoll().saveOrUpdate(myTweetPoll);

        TweetPollSwitch pollSwitchAmerica = createTweetPollSwitch(qaAmerica,
View Full Code Here

        final List<TweetPoll> tweetPolls = getTweetPoll()
                .getTweetpollByHashTagName(this.hashTag1.getHashTag(),
                        this.INIT_RESULTS, this.MAX_RESULTS,
                        TypeSearchResult.HASHTAG, SearchPeriods.ALLTIME);
        assertEquals("Should be equals", 1, tweetPolls.size());
        final HashTag hashtag2 = createHashTag("paola");
        final HashTag hashtag3 = createHashTag("juan");
        this.tweetPoll.getHashTags().add(hashtag2);
        this.tweetPoll.getHashTags().add(hashtag3);
        getTweetPoll().saveOrUpdate(this.tweetPoll);
        final TweetPoll tweetPoll1 = createPublishedTweetPoll(
                secondary.getAccount(),
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.