Package org.eurekastreams.server.domain.dto

Examples of org.eurekastreams.server.domain.dto.StreamDTO


     */
    @Test
    public void testExecute()
    {
        final FeaturedStreamDTO featuredDTO = new FeaturedStreamDTO();
        final StreamDTO mostActiveDTO = new PersonModelView();
        final Long mostActiveCount = 82L;
        final StreamDTO mostViewedDTO = new PersonModelView();
        final StreamDTO mostFollowedDTO = new PersonModelView();
        final StreamDTO mostRecentDTO = new PersonModelView();

        final List<FeaturedStreamDTO> featuredDTOs = new ArrayList<FeaturedStreamDTO>();
        featuredDTOs.add(featuredDTO);

        final SublistWithResultCount<StreamDTO> mostActiveDTOs = new SublistWithResultCount<StreamDTO>();
View Full Code Here


            }
            // fills in data from cached view of original actor
            final StreamEntityDTO originalActor = activity.getOriginalActor();
            if (originalActor != null)
            {
                StreamDTO originalActorStreamDTO = null;

                if (originalActor.getType() == EntityType.PERSON)
                {
                    List<PersonModelView> people = getPersonModelViewsByAccountIdsMapper.execute(Collections
                            .singletonList(originalActor.getUniqueIdentifier()));
                    if (!people.isEmpty())
                    {
                        originalActorStreamDTO = people.get(0);
                    }
                }
                if (originalActor.getType() == EntityType.GROUP)
                {
                    List<DomainGroupModelView> oagroups = groupMapper.execute(Collections.singletonList(originalActor
                            .getUniqueIdentifier()));
                    if (!oagroups.isEmpty())
                    {
                        originalActorStreamDTO = oagroups.get(0);
                    }
                }

                if (originalActorStreamDTO != null)
                {
                    originalActor.setId(originalActorStreamDTO.getEntityId());
                    originalActor.setDestinationEntityId(originalActorStreamDTO.getEntityId());
                    originalActor.setDisplayName(originalActorStreamDTO.getDisplayName());
                    originalActor.setAvatarId(originalActorStreamDTO.getAvatarId());
                }
                else
                {
                    // this is to prevent JSON serializer from dying on a nulled out StreamEntityDTO.
                    activity.setOriginalActor(null);
View Full Code Here

    {
        List<StreamDTO> results = sut.execute(10);
        Assert.assertEquals(2L, results.size());

        // PERSON: fordp2
        StreamDTO dto1 = results.get(0);

        // PERSON: fordp
        StreamDTO dto2 = results.get(1);

        Assert.assertEquals("fordp2", dto1.getUniqueId());
        Assert.assertEquals("fordp", dto2.getUniqueId());

        // two data points - 100000 and 99999, 3 days. we round up, so get 66667
        Assert.assertEquals(66667, dto1.getFollowersCount());

        // one data point - 100000, 3 days. we round up, so get 33334
        Assert.assertEquals(33334, dto2.getFollowersCount());
    }
View Full Code Here

    {
        SublistWithResultCount<StreamDTO> results = sut.execute(null);
        Assert.assertEquals(new Long(2), results.getTotalResultsCount());
        Assert.assertEquals(2, results.getResultsSublist().size());

        StreamDTO fordp2 = results.getResultsSublist().get(0);
        StreamDTO fordp = results.getResultsSublist().get(1);

        Assert.assertEquals("fordp2", fordp2.getUniqueId());
        Assert.assertEquals("fordp", fordp.getUniqueId());

        // over 3 days, two data points with 9 message count => 18/3 = 6
        Assert.assertEquals(6, fordp2.getFollowersCount());

        // over 3 days, one data point with 9 message count => 9/3 = 3
        Assert.assertEquals(3, fordp.getFollowersCount());

        Assert.assertTrue(fordp2.getFollowersCount() >= 0);
        Assert.assertTrue(fordp.getFollowersCount() >= 0);
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.dto.StreamDTO

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.