Package org.eurekastreams.server.domain.stream

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


     * Test objectToString when passed a public group scope.
     */
    @Test
    public void testObjectToStringPublic()
    {
        final Activity activity = new Activity();
        activity.setIsDestinationStreamPublic(true);

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


     * Test objectToString when passed a public group scope.
     */
    @Test
    public void testObjectToStringNotPublic()
    {
        final Activity activity = new Activity();
        activity.setIsDestinationStreamPublic(false);

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

                oneOf(getDomainGroupsByShortNamesMock).fetchId(testDomainGroupShortName);
                will(returnValue(testDomainGroupId));
            }
        });

        Activity activity = new Activity();
        activity.setActorType(EntityType.GROUP);
        activity.setActorId(testDomainGroupShortName);
        assertEquals("g" + testDomainGroupId, sut.objectToString(activity));
        context.assertIsSatisfied();
    }
View Full Code Here

     * Test objectToString for person.
     */
    @Test
    public void testObjectToStringForPersonFromActivityObject()
    {
        Activity activity = new Activity();
        activity.setActorType(EntityType.PERSON);
        activity.setActorId(testPersonAccountId);

        context.checking(new Expectations()
        {
            {
                oneOf(personAccountIdToIdMapper).execute(testPersonAccountId);
View Full Code Here

     * Test objectToString for a not set entity type.
     */
    @Test(expected = RuntimeException.class)
    public void testObjectToStringForNotSetFromActivityObject()
    {
        Activity activity = new Activity();
        activity.setActorType(EntityType.NOTSET);
        activity.setActorId(testPersonAccountId);
        assertEquals("p" + testPersonId, sut.objectToString(activity));
        context.assertIsSatisfied();
    }
View Full Code Here

     */
    @Test(expected = RuntimeException.class)
    public void testObjectToStringWithoutPeopleByAccountIdMapper()
    {
        ActivityAuthorClassBridge.setGetPersonIdByAccountIdMapper(null);
        sut.objectToString(new Activity());
    }
View Full Code Here

     */
    @Test(expected = RuntimeException.class)
    public void testObjectToStringWithoutDomainGroupCache()
    {
        ActivityAuthorClassBridge.setGetDomainGroupsByShortNames(null);
        sut.objectToString(new Activity());
    }
View Full Code Here

     * Test the successful execution of the strategy - no hashtags.
     */
    @Test
    public void testExecuteWithActivity()
    {
        final Activity activityMock = context.mock(Activity.class);

        context.checking(new Expectations()
        {
            {
                oneOf(asyncActionContextMock).getParams();
View Full Code Here

                oneOf(thumbnail).getUrl();
                will(returnValue(uri));
            }
        });

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

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

        HashMap<String, String> result = activity.getBaseObject();
        assertEquals(title, result.get("targetTitle"));
        assertEquals(title, result.get("title"));
        assertEquals(link, result.get("targetUrl"));
        assertEquals(desc, result.get("description"));
        assertEquals("http://www.sample.com", result.get("thumbnail"));
View Full Code Here

                allowing(metadata).getThumbnail();
                will(returnValue(thumbArr));
            }
        });

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

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

        HashMap<String, String> result = activity.getBaseObject();

        assertEquals(title, result.get("targetTitle"));
        assertEquals(title, result.get("title"));
        assertEquals(link, result.get("targetUrl"));
        assertEquals("", result.get("description"));
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.