Package org.eurekastreams.server.domain.stream

Examples of org.eurekastreams.server.domain.stream.Activity


     * Test objectToSTring() when base type object is Bookmark and there's no base object.
     */
    @Test
    public void testObjectToStringFromActivityBookmarkWithNoBaseObject()
    {
        final Activity activity = new Activity();
        activity.setBaseObjectType(BaseObjectType.BOOKMARK);

        CONTEXT.checking(new Expectations()
        {
            {
                oneOf(commentIdsByActivityIdDAO).execute(activity.getId());
                will(returnValue(new ArrayList<Long>()));

                oneOf(commentsByIdDAO).execute(with(any(ArrayList.class)));
                will(returnValue(new ArrayList<CommentDTO>()));
            }
View Full Code Here


    public void testObjectToStringWithComment()
    {
        HashMap<String, String> baseObject = new HashMap<String, String>();
        baseObject.put("description", description);

        final Activity activity = new Activity();
        activity.setBaseObjectType(BaseObjectType.BOOKMARK);
        activity.setBaseObject(baseObject);

        final List<Long> commentIds = Arrays.asList(1L, 2L);

        CommentDTO comment1 = new CommentDTO();
        comment1.setBody("something something");

        CommentDTO comment2 = new CommentDTO();
        comment2.setBody("another comment");

        final List<CommentDTO> comments = Arrays.asList(comment1, comment2);

        CONTEXT.checking(new Expectations()
        {
            {
                oneOf(commentIdsByActivityIdDAO).execute(activity.getId());
                will(returnValue(commentIds));

                oneOf(commentsByIdDAO).execute(with(any(List.class)));
                will(returnValue(comments));
            }
View Full Code Here

                oneOf(content).getValue();
                will(returnValue(contentVal));
            }
        });

        Activity activity = new Activity();
        sut.build(feed, entry, activity);

        assertEquals(BaseObjectType.NOTE, activity.getBaseObjectType());

        HashMap<String, String> result = activity.getBaseObject();
        assertEquals(contentVal, result.get("content"));
    }
View Full Code Here

                will(returnValue(contentVal));

            }
        });

        Activity activity = new Activity();
        sut.build(feed, entry, activity);

        assertEquals(BaseObjectType.NOTE, activity.getBaseObjectType());

        HashMap<String, String> result = activity.getBaseObject();
        assertEquals(contentVal, result.get("content"));
    }
View Full Code Here

                allowing(entry).getLink();
                will(returnValue(link2Href));
            }
        });

        Activity activity = new Activity();
        sut.build(feed, entry, activity);

        assertEquals(BaseObjectType.VIDEO, activity.getBaseObjectType());

        HashMap<String, String> result = activity.getBaseObject();
        assertEquals(title, result.get("title"));
        assertEquals(link1Href, result.get("videoStream"));
        assertEquals(link2Href, result.get("videoPageUrl"));
        assertEquals("desc", result.get("description"));
        assertEquals("source", result.get("thumbnail"));
View Full Code Here

                will(returnValue(link2Href));

            }
        });

        Activity activity = new Activity();
        sut.build(feed, entry, activity);

        assertEquals(BaseObjectType.VIDEO, activity.getBaseObjectType());

        HashMap<String, String> result = activity.getBaseObject();
        assertEquals(title, result.get("title"));
        assertEquals(link1Href, result.get("videoStream"));
        assertEquals(link2Href, result.get("videoPageUrl"));
        assertEquals("desc", result.get("description"));
        assertEquals("source", result.get("thumbnail"));
View Full Code Here

    public final void testUpdateHashMap() throws Exception
    {

        String message = "maps should be set appropriately";

        final Activity activity = new Activity();

        HashMap<String, String> baseObject = new HashMap<String, String>();
        HashMap<String, Serializable> map = new HashMap<String, Serializable>();
        map.put("baseObject", baseObject);

        ReflectiveUpdater reflector = new ReflectiveUpdater();
        reflector.setProperties(activity, map);

        assertEquals(message, baseObject, activity.getBaseObject());

    }
View Full Code Here

    public final void testUpdateDate() throws Exception
    {

        String message = "sets should be set appropriately";

        final Activity activity = new Activity();

        HashSet<Activity> coords = new HashSet<Activity>();
        coords.add(activity);

        Date date = new Date();
        HashMap<String, Serializable> map = new HashMap<String, Serializable>();
        map.put("updated", date);

        ReflectiveUpdater reflector = new ReflectiveUpdater();
        reflector.setProperties(activity, map);

        assertEquals(message, date, activity.getUpdated());

    }
View Full Code Here

     * Test the SUT.
     */
    @Test
    public void test()
    {
        final Activity activity = CONTEXT.mock(Activity.class);

        CONTEXT.checking(new Expectations()
        {
            {
                oneOf(interstingnessStrategMocky).computeInterestingness(activity);
View Full Code Here

     * Tests with type not set.
     */
    @Test
    public void testTypeNotSet()
    {
        Activity activity = new Activity();
        activity.setAppId(9L);
        activity.setAppType(EntityType.NOTSET);

        Assert.assertEquals("0", sut.objectToString(activity));
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.stream.Activity

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.