Package org.apache.rave.portal.model

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


    }

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


        template.setUrl("TEST_C");
        template.setWidth(1);



        JpaActivityStreamsMediaLink jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaActivityStreamsMediaLink.class)));
        assertThat(jpaTemplate.getDuration(), is(equalTo(template.getDuration())));
        assertThat(jpaTemplate.getHeight(), is(equalTo(template.getHeight())));
        assertThat(jpaTemplate.getWidth(), is(equalTo(template.getWidth())));
        assertThat(jpaTemplate.getUrl(), is(equalTo(template.getUrl())));


    }
View Full Code Here

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

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

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

    }

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

        template.setUrl("TEST_C");
        template.setWidth(1);



        JpaActivityStreamsMediaLink jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaActivityStreamsMediaLink.class)));
        assertThat(jpaTemplate.getDuration(), is(equalTo(template.getDuration())));
        assertThat(jpaTemplate.getHeight(), is(equalTo(template.getHeight())));
        assertThat(jpaTemplate.getWidth(), is(equalTo(template.getWidth())));
        assertThat(jpaTemplate.getUrl(), is(equalTo(template.getUrl())));


    }
View Full Code Here

    public static JpaActivityStreamsMediaLink testEntity() {
        HashMap hm = new HashMap();
        hm.put("nineteen", 23);
        hm.put("thirteen", 17);

        JpaActivityStreamsMediaLink test = new JpaActivityStreamsMediaLink();
        test.setUrl("http://apache.org/");
        test.setDuration(2);
        test.setHeight(3);
        test.setUrl("http://five");
        test.setWidth(7);

        return test;
    }
View Full Code Here

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

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

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

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

TOP

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

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.