Package org.encuestame.persistence.domain.survey

Examples of org.encuestame.persistence.domain.survey.Survey


    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,
View Full Code Here


    final TweetPoll tweetPoll2 = createPublishedTweetPoll(
        this.userAccount.getAccount(), this.question, new Date());

    final Poll poll = createDefaultPoll(question, this.userAccount);

    final Survey survey = createDefaultSurvey(this.user, " ",
        this.initDate.toDate());

    // SocialAccount
    final SocialAccount socialAcc = createDefaultSettedSocialAccount(this.userAccount);
View Full Code Here

     */
    @Test
    public void testGetSurveyByIdandUserId(){
        assertNotNull(this.survey);
        assertNotNull(this.user);
        final Survey mySurvey = getSurveyDaoImp().getSurveyByIdandUserId(this.survey.getSid(), this.user.getUid());
        assertNotNull(mySurvey.getSid());
        assertEquals("Should be equals", this.survey.getSid(), mySurvey.getSid());
    }
View Full Code Here

     */
    @Test
    public void testRetrieveSurveysByFolder() throws EnMeNoResultsFoundException{
        assertNotNull(surveyFolder);
        assertNotNull(survey);
        final Survey addSurvey = addSurveyToFolder(this.surveyFolder.getId(), this.user.getUid(), this.survey.getSid());
        assertNotNull(addSurvey);
        final List<Survey> sfolder = getSurveyDaoImp().retrieveSurveyByFolder(this.user.getUid(), this.surveyFolder.getId());
        assertEquals("Should be equals", 1, sfolder.size());
    }
View Full Code Here

    /**
     * Test retrieve marked as favorite surveys.
     */
    @Test
    public void testRetrieveFavouritesSurvey(){
        final Survey mySurvey = createDefaultSurvey(user, "My First Survey",
                this.myDate.getTime());
        mySurvey.setEditorOwner(this.secondaryUser);
        mySurvey.setFavourites(Boolean.TRUE);
        getSurveyDaoImp().saveOrUpdate(mySurvey);
        final List<Survey> favoriteSurveys = getSurveyDaoImp()
                .retrieveFavoritesSurvey(this.secondaryUser, this.MAX_RESULTS,
                        this.START_RESULTS);
        assertEquals("Should be equals", 1, favoriteSurveys.size());
View Full Code Here

     * Test Search surveys by name.
     */
    @Test
    public void testSearchbySurveyName() {
        final String keyWord = "Last";
        final Survey mySurvey = createDefaultSurvey(user, "My Last Survey",
                this.myDate.getTime());
        mySurvey.setEditorOwner(this.secondaryUser);
        getSurveyDaoImp().saveOrUpdate(mySurvey);
        final List<Survey> surveyResult = getSurveyDaoImp()
                .retrieveSurveybyName(keyWord, this.secondaryUser.getUid(),
                        this.MAX_RESULTS, this.START_RESULTS);
        assertEquals("Should be equals", 1, surveyResult.size());
View Full Code Here

     */
    @Test
    public void testGetSurveyFolder() {
        final SurveyFolder folder = createSurveyFolders("My Folder",
                this.secondaryUser);
        final Survey mySurvey = createDefaultSurvey(user, "My Last Survey",
                this.myDate.getTime());
        mySurvey.setSurveysfolder(folder);
        getSurveyDaoImp().saveOrUpdate(mySurvey);
        final List<Survey> mySurveysByFolder = getSurveyDaoImp()
                .retrieveSurveyByFolder(this.user.getUid(), folder.getId());
        assertEquals("Should be equals", 1, mySurveysByFolder.size());
    }
View Full Code Here

     */
    @Test
    public void testCreateSurvey(){

        // 1- Create Survey Container
        final Survey mySurvey = createDefaultSurvey(this.user, "My Survey test", new Date());
        Assert.assertNotNull(mySurvey);

        // 2- Add survey sections
        final SurveySection section = createDefaultSection("Overview", mySurvey);
        Assert.assertNotNull(mySurvey);
View Full Code Here

    /**
     * Test get survey sections.
     */
    @Test
    public void testGetSurveySection(){
        final Survey survey = createDefaultSurvey(this.user, "Survey test",
                new Date());
        createDefaultSection("First Section", survey );
        createDefaultSection("Second Section", survey);
        final List<SurveySection> surveySections = getSurveyDaoImp()
                .getSurveySection(survey);
View Full Code Here

    public void testGetSurveysByHashTags() {
        final HashTag hashtag1 = createHashTag("home");
        final HashTag hashtag2 = createHashTag("technology");
        final HashTag hashtag3 = createHashTag("internet");

        final Survey mySurvey = createDefaultSurvey(this.user, "Survey test",
                new Date());

        mySurvey.getHashTags().add(hashtag1);
        mySurvey.getHashTags().add(hashtag2);
        mySurvey.getHashTags().add(hashtag3);
        getSurveyDaoImp().saveOrUpdate(mySurvey);

        final Survey mySurvey2 = createDefaultSurvey(this.user,
                "Survey test 2", new Date());
        mySurvey2.getHashTags().add(hashtag1);
        getSurveyDaoImp().saveOrUpdate(mySurvey);

        final List<Survey> totalSurveys = getSurveyDaoImp()
                .getSurveysByHashTagName(hashtag1.getHashTag(),
                        this.START_RESULTS, this.MAX_RESULTS, TypeSearchResult.HASHTAG, SearchPeriods.ALLTIME);
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.survey.Survey

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.