Package org.apache.rave.portal.model

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


    }

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


        template.setGroupId("TEST_J");
        template.setSource("TEST_K");
        template.setUserId("TEST_K");


        JpaActivityStreamsEntry jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaActivityStreamsEntry.class)));
        assertThat(jpaTemplate.getAppId(), is(equalTo(template.getAppId())));
        assertThat(jpaTemplate.getBcc(), is(equalTo(template.getBcc())));
        assertThat(jpaTemplate.getContent(), is(equalTo(template.getContent())));
        assertThat(jpaTemplate.getDc(), is(equalTo(template.getDc())));
        assertThat(jpaTemplate.getInReplyTo(), is(equalTo(template.getInReplyTo())));
        assertThat(jpaTemplate.getLocation(), is(equalTo(template.getLocation())));
        assertThat(jpaTemplate.getPriority(), is(equalTo(template.getPriority())));
        assertThat(jpaTemplate.getTitle(), is(equalTo(template.getTitle())));
        assertThat(jpaTemplate.getGroupId(), is(equalTo(template.getGroupId())));
        assertThat(jpaTemplate.getSource(), is(equalTo(template.getSource())));
        assertThat(jpaTemplate.getUserId(), is(equalTo(template.getUserId())));
    }
View Full Code Here

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

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

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

    JpaActivityStreamsEntry test2;
    JpaActivityStreamsEntry test3;

    @Before
    public void setup() {
        test1 = new JpaActivityStreamsEntry();
        test2 = new JpaActivityStreamsEntry();
        test3 = new JpaActivityStreamsEntry();

    }
View Full Code Here

        return JpaActivityStreamsEntry.class;
    }

    @Transactional
  public ActivityStreamsEntry save(ActivityStreamsEntry e) {
        JpaActivityStreamsEntry entry = converter.convert(e);

        if(entry.getUserId() == null && entry.getActor() != null) {
            entry.setUserId(entry.getActor().getId());
        }
        return JpaUtil.saveOrUpdate(entry.getId(), manager, entry);
  }
View Full Code Here

    }

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

        template.setGroupId("TEST_J");
        template.setSource("TEST_K");
        template.setUserId("TEST_K");


        JpaActivityStreamsEntry jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaActivityStreamsEntry.class)));
        assertThat(jpaTemplate.getAppId(), is(equalTo(template.getAppId())));
        assertThat(jpaTemplate.getBcc(), is(equalTo(template.getBcc())));
        assertThat(jpaTemplate.getContent(), is(equalTo(template.getContent())));
        assertThat(jpaTemplate.getDc(), is(equalTo(template.getDc())));
        assertThat(jpaTemplate.getInReplyTo(), is(equalTo(template.getInReplyTo())));
        assertThat(jpaTemplate.getLocation(), is(equalTo(template.getLocation())));
        assertThat(jpaTemplate.getPriority(), is(equalTo(template.getPriority())));
        assertThat(jpaTemplate.getTitle(), is(equalTo(template.getTitle())));
        assertThat(jpaTemplate.getGroupId(), is(equalTo(template.getGroupId())));
        assertThat(jpaTemplate.getSource(), is(equalTo(template.getSource())));
        assertThat(jpaTemplate.getUserId(), is(equalTo(template.getUserId())));
    }
View Full Code Here

        HashMap hm1 = new HashMap();
        HashMap hm2 = new HashMap();
        hm1.put("FOO", "BAR");
        hm1.put("FAZ", "BAZ");
        hm2.put("ABC", "DEF");
        JpaActivityStreamsEntry test = new JpaActivityStreamsEntry();
        test.setPublished(new Date(1234567890));
        test.setUpdated(new Date(987654321));
        test.setUrl("http://apache.org");
        test.setObjectType("IMAGE");
        test.setOpenSocial(hm1);
        test.setExtensions(hm2);
        test.setContent("content");
        test.setActor(JpaActivityStreamsObjectTest.testEntity());
        test.setGenerator(JpaActivityStreamsObjectTest.testEntity());
        test.setId("testing_id");
        test.setAppId("application_id");
        return test;
    }
View Full Code Here

    JpaActivityStreamsEntry test2;
    JpaActivityStreamsEntry test3;

    @Before
    public void setup() {
        test1 = new JpaActivityStreamsEntry();
        test2 = new JpaActivityStreamsEntry();
        test3 = new JpaActivityStreamsEntry();

    }
View Full Code Here

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

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

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

TOP

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

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.