Package org.apache.rave.portal.model

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


    }

    @Test
    public void testNoConversion() {
        JpaActivityStreamsObject template = new JpaActivityStreamsObject();
        assertThat(converter.convert(template), is(sameInstance(template)));
    }
View Full Code Here


        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

    public Class<ActivityStreamsObject> getSourceType() {
        return ActivityStreamsObject.class;
    }

    private JpaActivityStreamsObject createEntity(ActivityStreamsObject source) {
        JpaActivityStreamsObject converted = null;
        if (source != null) {
            TypedQuery<JpaActivityStreamsObject> query = manager.createNamedQuery(JpaActivityStreamsObject.FIND_BY_ID, JpaActivityStreamsObject.class);
            query.setParameter("id", source.getId());
            converted = getSingleResult(query.getResultList());

            if (converted == null) {
                converted = new JpaActivityStreamsObject();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

import org.apache.rave.portal.model.JpaActivityStreamsObject;

public class JpaActivityStreamsObjectTest {

    public static JpaActivityStreamsObject testEntity() {
        JpaActivityStreamsObject test = new JpaActivityStreamsObject();
        JpaActivityStreamsMediaLink ent = new JpaActivityStreamsMediaLink();
        ent.setUrl("http://apache.org/");
        test.setImage(ent);
        return test;
    }
View Full Code Here

    }

    @Test
    public void testNoConversion() {
        JpaActivityStreamsObject template = new JpaActivityStreamsObject();
        assertThat(converter.convert(template), is(sameInstance(template)));
    }
View Full Code Here

        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

    public Class<ActivityStreamsObject> getSourceType() {
        return ActivityStreamsObject.class;
    }

    private JpaActivityStreamsObject createEntity(ActivityStreamsObject source) {
        JpaActivityStreamsObject converted = null;
        if (source != null) {
            TypedQuery<JpaActivityStreamsObject> query = manager.createNamedQuery(JpaActivityStreamsObject.FIND_BY_ID, JpaActivityStreamsObject.class);
            query.setParameter("id", source.getId());
            converted = getSingleResult(query.getResultList());

            if (converted == null) {
                converted = new JpaActivityStreamsObject();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

TOP

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

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.