Examples of DomainGroupModelView


Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

        final JSONObject jsonReq = new JSONObject();
        jsonReq.accumulate("followedBy", entityAcctName);

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

        DomainGroupModelView group1 = new DomainGroupModelView();
        group1.setEntityId(1L);
        group1.setStreamId(4L);

        DomainGroupModelView group2 = new DomainGroupModelView();
        group2.setEntityId(2L);
        group2.setStreamId(5L);

        DomainGroupModelView group3 = new DomainGroupModelView();
        group3.setEntityId(3L);
        group3.setStreamId(6L);

        final List<DomainGroupModelView> groups = Arrays.asList(group1, group2, group3);

        context.checking(new Expectations()
        {
            {
                oneOf(getPersonIdByAccountId).execute(entityAcctName);
                will(returnValue(entityId));

                oneOf(followeGroupsMapper).execute(entityId);
                will(returnValue(followedGroups));

                oneOf(groupMapper).execute(followedGroups);
                will(returnValue(groups));
            }
        });

        GetAllFollowedByActivityIdsRequest result = (GetAllFollowedByActivityIdsRequest) sut.transform(jsonReq,
                entityId);
        Assert.assertEquals(Arrays.asList(group1.getStreamId(), group2.getStreamId(), group3.getStreamId()), result
                .getGroupStreamIds());

        Assert.assertEquals(entityId, result.getUserId());

        context.assertIsSatisfied();
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

        final JSONObject jsonReq = new JSONObject();
        jsonReq.accumulate("joinedGroups", entityAcctName);

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

        DomainGroupModelView group1 = new DomainGroupModelView();
        group1.setEntityId(1L);
        group1.setStreamId(4L);

        DomainGroupModelView group2 = new DomainGroupModelView();
        group2.setEntityId(2L);
        group2.setStreamId(5L);

        DomainGroupModelView group3 = new DomainGroupModelView();
        group3.setEntityId(3L);
        group3.setStreamId(6L);

        final List<DomainGroupModelView> groups = Arrays.asList(group1, group2, group3);

        context.checking(new Expectations()
        {
            {
                oneOf(getPersonIdByAccountId).execute(entityAcctName);
                will(returnValue(entityId));

                oneOf(followeGroupsMapper).execute(entityId);
                will(returnValue(followedGroups));

                oneOf(groupMapper).execute(followedGroups);
                will(returnValue(groups));
            }
        });

        Assert.assertEquals(Arrays.asList(group1.getStreamId(), group2.getStreamId(), group3.getStreamId()), sut
                .transform(jsonReq, entityId));

        context.assertIsSatisfied();
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

        p.setEntityId(personId);
        p.setDisplayName(personDisplayName);
        p.setAvatarId("personAvatarId");
        p.setAccountId("personA");

        final DomainGroupModelView g = new DomainGroupModelView();
        g.setEntityId(groupId);
        g.setName(groupDisplayName);
        g.setAvatarId(groupAvatarId);
        g.setShortName("groupA");

        final List<DisplayInfoSettable> fsList = new ArrayList<DisplayInfoSettable>(Arrays.asList(personStream,
                groupStream));

        context.checking(new Expectations()
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

     */
    @Test
    public void testCompareWhenEqualGroupAndPerson()
    {
        PersonModelView pmv = new PersonModelView(1L, "persona", "Person", "last", null, "", 50, new Date(), 4L);
        DomainGroupModelView gmv = new DomainGroupModelView(1L, "groupb", "Group B", 50L, new Date(), 5L);

        Assert.assertTrue(sut.compare(pmv, gmv) > 0);
        Assert.assertTrue(sut.compare(gmv, pmv) < 0);
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

     * Test compare when two DomainGroupModelViews are passed in with equal followers count.
     */
    @Test
    public void testCompareWhenTwoGroupsEqualCount()
    {
        DomainGroupModelView gmv1 = new DomainGroupModelView(1L, "groupa", "Group A", 50L, new Date(), 8L);
        DomainGroupModelView gmv2 = new DomainGroupModelView(2L, "groupb", "Group B", 50L, new Date(), 9L);

        Assert.assertTrue(sut.compare(gmv1, gmv2) < 0);
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

     * Test compare when two DomainGroupModelViews are passed in with equal followers count.
     */
    @Test
    public void testCompareWhenTwoGroupsEqual()
    {
        DomainGroupModelView gmv1 = new DomainGroupModelView(1L, "groupz", "Group ZA", 50L, new Date(), 8L);
        DomainGroupModelView gmv2 = new DomainGroupModelView(2L, "groupz", "Group ZB", 50L, new Date(), 9L);

        Assert.assertEquals(0, sut.compare(gmv1, gmv2));
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

     */
    @Test
    public void testCompareWhenGroupAndPersonHaveDifferentFollowerCounts()
    {
        PersonModelView pmv = new PersonModelView(1L, "persona", "Person", "lastName", null, "", 40, new Date(), 10L);
        DomainGroupModelView gmv = new DomainGroupModelView(1L, "groupb", "Group B", 50L, new Date(), 11L);

        Assert.assertTrue(sut.compare(pmv, gmv) > 0);
        Assert.assertTrue(sut.compare(gmv, pmv) < 0);
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

        pmv1.setDisplayName("a");
        pmv2 = new PersonModelView();
        pmv2.setDisplayName("c");
        pmv3 = new PersonModelView();
        pmv3.setDisplayName("e");
        gmv1 = new DomainGroupModelView();
        gmv1.setName("b");
        gmv2 = new DomainGroupModelView();
        gmv2.setName("d");
        gmv3 = new DomainGroupModelView();
        gmv3.setName("f");
        pmvList = new ArrayList<PersonModelView>(Arrays.asList(pmv1, pmv2, pmv3));
        gmvList = new ArrayList<DomainGroupModelView>(Arrays.asList(gmv1, gmv2, gmv3));
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

    @Test
    public void testCompareWhenEqualGroupAndPerson()
    {
        Date sharedDate = new Date();
        PersonModelView pmv = new PersonModelView(1L, "persona", "Person", "A", "hey now", "", 50, sharedDate, 1L);
        DomainGroupModelView gmv = new DomainGroupModelView(1L, "groupb", "Group B", 50L, sharedDate, 2L);

        Assert.assertTrue(sut.compare(pmv, gmv) > 0);
        Assert.assertTrue(sut.compare(gmv, pmv) < 0);
    }
View Full Code Here

Examples of org.eurekastreams.server.search.modelview.DomainGroupModelView

     */
    @Test
    public void testCompareWhenTwoGroupsEqual()
    {
        Date sharedDate = new Date();
        DomainGroupModelView gmv1 = new DomainGroupModelView(1L, "groupa", "Group A", 50L, sharedDate, 5L);
        DomainGroupModelView gmv2 = new DomainGroupModelView(2L, "groupb", "Group B", 50L, sharedDate, 6L);

        Assert.assertEquals(0, sut.compare(gmv1, gmv2));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.