Package org.eurekastreams.server.domain.stream

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


    public void testUpdateCachedEntityNameNotChanging()
    {
        final String existingDisplayName = "abcdefg";
        final String newDisplayName = existingDisplayName;

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setDisplayName(existingDisplayName);

        activity.setDestinationStream(destinationStream);

        sut.updateCachedEntity(activity, newDisplayName);

        assertFalse(sut.updateCachedEntity(activity, newDisplayName));
        assertEquals(newDisplayName, destinationStream.getDisplayName());
View Full Code Here


    public void testUpdateCachedEntityNameChanging()
    {
        final String existingDisplayName = "abcdefg";
        final String newDisplayName = "ABCDEFG";

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setDisplayName(existingDisplayName);

        activity.setDestinationStream(destinationStream);

        assertTrue(sut.updateCachedEntity(activity, newDisplayName));
        assertEquals(newDisplayName, destinationStream.getDisplayName());
    }
View Full Code Here

     */
    @Test
    public void testRefresh()
    {
        final List<ActivityDTO> activities = new ArrayList<ActivityDTO>();
        activities.add(new ActivityDTO()
        {
            {
                setId(1L);
            }
        });

        activities.add(new ActivityDTO()
        {
            {
                setId(2L);
            }
        });
View Full Code Here

    public void testExecuteWithGroup()
    {
        final long activityId = 98765L;
        final long scopeId = 878;

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setType(EntityType.GROUP);
        destinationStream.setUniqueIdentifier("group5");
        activity.setDestinationStream(destinationStream);
        activity.setId(activityId);

        final String cacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + scopeId;

        assertEquals(null, getCache().get(cacheKey));
View Full Code Here

    public void testExecuteWithPerson()
    {
        final long activityId = 98766L;
        final long scopeId = 4;

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setType(EntityType.PERSON);
        destinationStream.setUniqueIdentifier("mrburns");
        activity.setDestinationStream(destinationStream);
        activity.setId(activityId);

        final String cacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + scopeId;

        assertEquals(null, getCache().get(cacheKey));
View Full Code Here

    @Test(expected = RuntimeException.class)
    public void testExecuteWithResourceNotFound()
    {
        final long activityId = 98766L;

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setType(EntityType.RESOURCE);
        destinationStream.setUniqueIdentifier("FOO");
        activity.setDestinationStream(destinationStream);
        activity.setId(activityId);

        sut.execute(activity);
    }
View Full Code Here

    {
        final long activityId = 98766L;
        final long scopeId = 100;
        final long actorscopeId = 4;

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setType(EntityType.RESOURCE);
        destinationStream.setUniqueIdentifier("resource1");

        StreamEntityDTO actorStream = new StreamEntityDTO();
        actorStream.setType(EntityType.PERSON);
        actorStream.setUniqueIdentifier("mrburns");

        activity.setDestinationStream(destinationStream);
        activity.setActor(actorStream);
        activity.setId(activityId);

        final String cacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + scopeId;
        final String actorCacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + actorscopeId;

        assertEquals(null, getCache().get(cacheKey));
View Full Code Here

    {
        final long activityId = 98766L;
        final long scopeId = 100;
        final long actorscopeId = 4;

        ActivityDTO activity = new ActivityDTO();
        activity.setShowInStream(false);
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setType(EntityType.RESOURCE);
        destinationStream.setUniqueIdentifier("resource1");

        StreamEntityDTO actorStream = new StreamEntityDTO();
        actorStream.setType(EntityType.PERSON);
        actorStream.setUniqueIdentifier("mrburns");

        activity.setDestinationStream(destinationStream);
        activity.setActor(actorStream);
        activity.setId(activityId);

        final String cacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + scopeId;
        final String actorCacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + actorscopeId;

        assertEquals(null, getCache().get(cacheKey));
View Full Code Here

    public void testExecuteWithBadType()
    {
        final long activityId = 98767;
        final long scopeId = 837433;

        ActivityDTO activity = new ActivityDTO();
        StreamEntityDTO destinationStream = new StreamEntityDTO();
        destinationStream.setType(EntityType.APPLICATION);
        destinationStream.setUniqueIdentifier("tstorgname");
        activity.setDestinationStream(destinationStream);
        activity.setId(activityId);

        final String cacheKey = CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + scopeId;

        assertEquals(null, getCache().get(cacheKey));
View Full Code Here

        String commentsByActivityKey = CacheKeys.COMMENT_IDS_BY_ACTIVITY_ID + activityId;
        cache.removeFromList(commentsByActivityKey, inCommentId);

        // if present, update ActivityDTO in cache
        String activityByIdKey = CacheKeys.ACTIVITY_BY_ID + activityId;
        ActivityDTO activityDTO = (ActivityDTO) cache.get(activityByIdKey);
        if (activityDTO != null)
        {
            List<Long> commentIds = cache.getList(commentsByActivityKey);
            updateActivityDTO(activityDTO, inCommentId, commentIds);
            getCache().set(activityByIdKey, activityDTO);
View Full Code Here

TOP

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

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.