Package org.encuestame.persistence.domain.tweetpoll

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll


       
        createHashTag("nicaragua");
        final Question question = createQuestion("Has scala great future as program language?", account);
        createQuestion("What is your favorite program language?", account);
   
        final TweetPoll tp = createTweetPoll(1234567L, true, true, true, true,
        null, null, new Date(), false, account, question, null);
       
        createComment("I dont have favorite programs", 30L, tp, null, null,
        userAccount, 25L, new Date());
       
View Full Code Here


     * Test Retrieve items by geolocation and a distance max.
     */
  @Test
  public void testRetrieveItemsByGeo() {
    final Calendar myCalendarDate = Calendar.getInstance();
    final TweetPoll tweetPoll = createPublishedTweetPoll(
        this.secondary.getAccount(),
        createQuestion("What is your favorite futboll team?",
            secondary.getAccount()), myCalendarDate.getTime());

    tweetPoll.setLocationLatitude(40.4167F);
    tweetPoll.setLocationLongitude(-3.70325F);
    getTweetPoll().saveOrUpdate(tweetPoll);
    assertNotNull(tweetPoll);
   
    // Create Poll
    final Poll myPoll = createPoll(
        myCalendarDate.getTime(),
        createQuestion("What is your favorite futboll team?",
            secondary.getAccount()), this.secondary, Boolean.TRUE,
        Boolean.TRUE);

    myPoll.setLocationLatitude(40.4167F);
    myPoll.setLocationLongitude(-3.70325F);
    getPollDao().saveOrUpdate(myPoll);
    assertNotNull(myPoll);

    final Survey mySurvey = createDefaultSurvey(this.secondary.getAccount());
    mySurvey.setLocationLatitude(40.4167F);
    mySurvey.setLocationLongitude(-3.70325F);
    getSurveyDaoImp().saveOrUpdate(mySurvey);
    assertNotNull(mySurvey);

    final List<ItemGeoLocationBean> distanceFromOrigin = getLocationService()
        .retrieveItemsByGeo(510d, 30, TypeSearchResult.ALL,
            2.16991870F, 41.3879169F, SearchPeriods.SEVENDAYS);
    Assert.assertEquals(distanceFromOrigin.size(), 3);
    Assert.assertEquals(distanceFromOrigin.get(0).getLatitude(), tweetPoll.getLocationLatitude());
    Assert.assertEquals(distanceFromOrigin.get(1).getLatitude(), myPoll.getLocationLatitude());
  }
View Full Code Here

    this.initTweetPoll.getHashTags().add(this.initHashTag);
    this.initTweetPoll.getHashTags().add(hashtag3);
    getTweetPoll().saveOrUpdate(this.initTweetPoll);
    assertNotNull(this.initTweetPoll);

    final TweetPoll tp2 = this.createTweetPollTest(
        "What is your favorite television show?",
        this.initDate.toDate());

    tp2.setLocationLatitude(40.4167F);
    tp2.setLocationLongitude(-3.70325F);
    tp2.getHashTags().add(hashtag3);
    getTweetPoll().saveOrUpdate(tp2);

    assertNotNull(tp2);
   
    final List<ItemGeoLocationBean> items = locationService
View Full Code Here

      throws EnMeSearchException, EnMeNoResultsFoundException {
    this.initTweetPoll.setLocationLatitude(40.4167F);
    this.initTweetPoll.setLocationLongitude(-3.70325F);
    getTweetPoll().saveOrUpdate(this.initTweetPoll);

    final TweetPoll tp2 = this.createTweetPollTest(
        "What is your favorite rock band?",
        this.initDate.toDate());

    tp2.setLocationLatitude(40.4167F);
    tp2.setLocationLongitude(-3.70325F);

    getTweetPoll().saveOrUpdate(tp2);

    assertNotNull(tp2);
View Full Code Here

   */
  private TweetPoll createTweetPollTest(final String questionName,
      final Date creationDate) {
    final Question question = createQuestion(
        "What is your favorite futboll team22?", this.secondary.getAccount());
    final TweetPoll tweetPoll = createPublishedTweetPoll(
        this.secondary.getAccount(), question, creationDate);
    return tweetPoll;
  }
View Full Code Here

  public void testSaveTweetId() throws EnMeExpcetion {
    Question questionSave = createQuestion("how much or How Many?", "html");
    final Account usersave = createUser("dianmora", "xxxxxxx");
    final UserAccount account = createUserAccount("jota", usersave);
    final String tweetUrl = "http://www.encuestame.org";
    final TweetPoll tweetPoll = createTweetPollPublicated(true, true,
        new Date(), account, questionSave);

    answersSaveTweet = new ArrayList<QuestionAnswerBean>();
    answersSaveTweet.add(createAnswersBean("GBHD", "Maybe",
        questionSave.getQid()));
    answersSaveTweet.add(createAnswersBean("GTJU", "Yes",
        questionSave.getQid()));

    questionBean = createUnitQuestionBean(questionSave.getQuestion(), 1L,
        usersave.getUid(), answersSaveTweet);
    final TweetPollBean unitTweetPoll = createUnitTweetPollPublicated(
        new Date(), true, tweetUrl, usersave.getUid(),
        this.questionBean, null);
    unitTweetPoll.setId(tweetPoll.getTweetPollId());
    // final String s =
    // this.tweetPollService.generateTweetPollText(unitTweetPoll, tweetUrl);
    // final Status status = this.tweetPollService.publicTweetPoll(s,
    // userpao.getTwitterAccount(), userpao.getTwitterPassword());
    // assertNotNull(status.getId());
View Full Code Here

   *             EnMeExpcetion
   */
  @Test
  @Category(DefaultTest.class)
  public void testGenerateTweetPollText() throws EnMeExpcetion {
    final TweetPoll tweetPollPublicate = createTweetPollPublicated(true,
        true, new Date(), this.userAccount, this.question);
    createQuestionAnswer("Yes", this.question, "EEEE");
    createQuestionAnswer("No", this.question, "FFFF");
    final String tweetUrl = "http://www.encuestame.org";
    final TweetPollBean uniTweetPoll = createUnitTweetPollPublicated(
        new Date(), true, tweetUrl, this.user.getUid(),
        this.questionBean, "testtweetuser");
    uniTweetPoll.setId(tweetPollPublicate.getTweetPollId());
    // final String twettQuestionText =
    // this.tweetPollService.generateTweetPollText(uniTweetPoll, tweetUrl);
    final String twettQuestionText = "test";
    assertNotNull(twettQuestionText);
    final Integer textLength = twettQuestionText.length();
View Full Code Here

   */
  @Test
  @Category(DefaultTest.class)
  public void testGetResultsByTweetPollId()
      throws EnMeNoResultsFoundException {
    final TweetPoll tweetPoll = createFastTweetPollVotes();
    final List<TweetPollResultsBean> results = this.tweetPollService
        .getResultsByTweetPollId(tweetPoll.getTweetPollId());
    assertEquals("Should be equals", 2, results.size());
  }
View Full Code Here

   */
  @Category(InternetTest.class)
  @Test
  public void testPublicMultiplesTweetAccounts() {

    final TweetPoll tweetPoll = createTweetPollPublicated(true, true,
        new Date(), this.userAccount, question);
    tweetPollService.publishMultiplesOnSocialAccounts(this.socialBeans,
        tweetPoll, this.tweetText, TypeSearchResult.TWEETPOLL, null,
        null);
    final TweetPoll tweet = getTweetPoll().getTweetPollById(
        tweetPoll.getTweetPollId());
    assertNotNull(tweet);
    final List<LinksSocialBean> linksPublished = getTweetPollService()
        .getTweetPollLinks(tweetPoll, null, null,
            TypeSearchResult.TWEETPOLL);
View Full Code Here

  public void testValidateIp() throws EnMeExpcetion {
    final String ipVote = EnMeUtils.ipGenerator();
    final TweetPollBean myTpBean = createUnitTweetPoll(Boolean.TRUE,
        "tweetPollUrl", getSpringSecurityLoggedUserAccount().getUid(),
        questionBean);
    final TweetPoll myTweetPoll = tweetPollService.createTweetPoll(
        myTpBean, "What is your favourite city?",
        getSpringSecurityLoggedUserAccount(), null);
    final Question myQuestion = createQuestion(
        "What is your favourite city", "pattern");
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.tweetpoll.TweetPoll

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.