Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.ActivityStreamsObject


        ActivityObject entry = conversionUtilTest.convert(activityStreamsObject);

        assertThat(entry.getDisplayName(), is(equalTo(activityStreamsObject.getDisplayName())));


        ActivityStreamsObject reconverted = conversionUtilTest.convert(entry)    ;

        assertThat(entry.getDisplayName(), is(equalTo(reconverted.getDisplayName())));


    }
View Full Code Here


        if (activity.getExtensions()!=null){entity.setExtensions(convert(activity.getExtensions())); }
        return entity;
    }

    public ActivityStreamsObject convert(ActivityObject object){
        ActivityStreamsObject entity = new ActivityStreamsObjectImpl();

        if (object.getAuthor()!=null){entity.setAuthor(convert(object.getAuthor()));}
        if (object.getAttachments()!=null){entity.setAttachments(convertObjectEntries(object.getAttachments()));}
        if (object.getContent()!=null){ entity.setContent(object.getContent());}
        if (object.getDisplayName()!=null){ entity.setDisplayName(object.getDisplayName());}
        if (object.getDownstreamDuplicates()!=null){entity.setDownstreamDuplicates(object.getDownstreamDuplicates());}
        if (object.getId()!=null){ entity.setId(object.getId());   }
        if (object.getImage()!=null){entity.setImage(convert(object.getImage()));}
        if (object.getObjectType()!=null){entity.setObjectType(object.getObjectType())}
        if (object.getPublished()!=null){entity.setPublished(ModelUtil.stringToDate(object.getPublished()));   }
        if (object.getSummary()!=null){entity.setSummary(object.getSummary())}
        if (object.getUpdated()!=null){entity.setUpdated(ModelUtil.stringToDate(object.getUpdated()));   }
        if (object.getUpstreamDuplicates()!=null){entity.setUpstreamDuplicates(object.getUpstreamDuplicates()); }
        if (object.getUrl()!=null){entity.setUrl(object.getUrl())}
        if (object.getOpenSocial()!=null){entity.setOpenSocial(convert(object.getOpenSocial()))}
        return entity;

    }
View Full Code Here

        assertThat(converter.convert(template), is(sameInstance(template)));
    }

    @Test
    public void nullConversion() {
        ActivityStreamsObject template = null;
        assertThat(converter.convert(template), is(nullValue()));
    }
View Full Code Here

    }


    @Test
    public void convertValid() {
        ActivityStreamsObject template = new ActivityStreamsObjectImpl();
        template.setContent("TEST_A");
        template.setDisplayName("TEST_B");
        template.setDc("TEST_C");
        template.setLd("TEST_D");
        template.setDc("TEST_E");
        template.setMood("TEST_F");
        template.setLocation("TEST_G");
        template.setRating("TEST_H");
        template.setSource("TEST_I");
        template.setLinks("TEST_J");



        JpaActivityStreamsObject jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaActivityStreamsObject.class)));
        assertThat(jpaTemplate.getContent(), is(equalTo(template.getContent())));
        assertThat(jpaTemplate.getDisplayName(), is(equalTo(template.getDisplayName())));
        assertThat(jpaTemplate.getContent(), is(equalTo(template.getContent())));
        assertThat(jpaTemplate.getDc(), is(equalTo(template.getDc())));
        assertThat(jpaTemplate.getMood(), is(equalTo(template.getMood())));
        assertThat(jpaTemplate.getLocation(), is(equalTo(template.getLocation())));
        assertThat(jpaTemplate.getRating(), is(equalTo(template.getRating())));
        assertThat(jpaTemplate.getSource(), is(equalTo(template.getSource())));
        assertThat(jpaTemplate.getLinks(), is(equalTo(template.getLinks())));

    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.ActivityStreamsObject

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.