Examples of ActivityDTO


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

     * Test the failure multiple activities being returned.
     */
    @Test
    public void testFailureValidate()
    {
        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.SHARE);

        StreamEntityDTO mismatchedOriginalActor = new StreamEntityDTO();
        mismatchedOriginalActor.setUniqueIdentifier("something");
        testActivity.setOriginalActor(mismatchedOriginalActor);

        HashMap<String, String> mismatchedObjProperties = new HashMap<String, String>();
        mismatchedObjProperties.put("originalActivityId", FAIL_ORIGINAL_ACTIVITY_ID.toString());
        testActivity.setBaseObjectProperties(mismatchedObjProperties);
        testActivity.setBaseObjectType(BaseObjectType.NOTE);

        final List<Long> activityIds = new ArrayList<Long>();
        activityIds.add(FAIL_ORIGINAL_ACTIVITY_ID);

        // Expect two results to trigger an error.
        final List<ActivityDTO> matchingActivities = new ArrayList<ActivityDTO>();
        matchingActivities.add(new ActivityDTO());
        matchingActivities.add(new ActivityDTO());

        context.checking(new Expectations()
        {
            {
                oneOf(transMgr).getTransaction(transDef);
View Full Code Here

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

     */
    @Test
    public void testSharePrivateGroupFailureValidate()
    {

        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.SHARE);
        testActivity.setOriginalActor(testOriginalActor);
        testActivity.setBaseObjectProperties(testBaseObjectProperties);

        StreamEntityDTO mismatchedOriginalActor = new StreamEntityDTO();
        mismatchedOriginalActor.setUniqueIdentifier("something");
        testActivity.setOriginalActor(mismatchedOriginalActor);

        final String testGroupId = "testGroup";

        final List<Long> activityIds = new ArrayList<Long>();
        activityIds.add(ORIGINAL_ACTIVITY_ID);

        // set up private test group
        final DomainGroupModelView testGroup = new DomainGroupModelView();
        testGroup.setIsPublic(false);

        destinationStream.setUniqueIdentifier("testGroup");
        destinationStream.setType(EntityType.GROUP);

        // one result of private group
        final List<ActivityDTO> matchingActivities = new ArrayList<ActivityDTO>();
        ActivityDTO orgActivity = new ActivityDTO();
        orgActivity.setDestinationStream(destinationStream);
        matchingActivities.add(orgActivity);

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

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

    @Test
    public void testSharePrivateGroupNullStreamReturnedFailureValidate()
    {
        final String testGroupId = "testGroup";

        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.SHARE);
        testActivity.setOriginalActor(testOriginalActor);
        testActivity.setBaseObjectProperties(testBaseObjectProperties);

        StreamEntityDTO mismatchedOriginalActor = new StreamEntityDTO();
        mismatchedOriginalActor.setUniqueIdentifier("something");
        testActivity.setOriginalActor(mismatchedOriginalActor);

        final List<String> groupIds = new ArrayList<String>();
        groupIds.add("testGroup");

        final List<Long> activityIds = new ArrayList<Long>();
        activityIds.add(ORIGINAL_ACTIVITY_ID);

        // set up private test group
        final DomainGroupModelView testGroup = null;

        destinationStream.setUniqueIdentifier("testGroup");
        destinationStream.setType(EntityType.GROUP);

        // one result of private group
        final List<ActivityDTO> matchingActivities = new ArrayList<ActivityDTO>();
        ActivityDTO orgActivity = new ActivityDTO();
        orgActivity.setDestinationStream(destinationStream);
        matchingActivities.add(orgActivity);

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

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

     * Test the success of attempting to share a public group message.
     */
    @Test
    public void testSharePublicGroupSuccessValidate()
    {
        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.SHARE);
        testActivity.setOriginalActor(testOriginalActor);
        testActivity.setBaseObjectProperties(testBaseObjectProperties);
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);

View Full Code Here

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

    public void testNotSaved()
    {
        final Long activityId = 2L;
        final Long personId = 1L;

        final ActivityDTO activity = new ActivityDTO();
        activity.setId(activityId);

        final PersonModelView user = new PersonModelView();
        user.setEntityId(personId);

        final List<ActivityDTO> activities = Arrays.asList(activity);
       
        final List<Long> starredActivities = Arrays.asList(3L);

        CONTEXT.checking(new Expectations()
        {
            {
                oneOf(starredMapper).execute(personId);
                will(returnValue(starredActivities));
            }
        });

        sut.filter(activities, user);

        Assert.assertFalse(activity.isStarred());

        CONTEXT.assertIsSatisfied();
    }
View Full Code Here

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

    public void testSaved()
    {
        final Long activityId = 2L;
        final Long personId = 1L;

        final ActivityDTO activity = new ActivityDTO();
        activity.setId(activityId);

        final PersonModelView user = new PersonModelView();
        user.setEntityId(personId);

        final List<ActivityDTO> activities = Arrays.asList(activity);
       
        final List<Long> starredActivities = Arrays.asList(activityId);

        CONTEXT.checking(new Expectations()
        {
            {
                oneOf(starredMapper).execute(personId);
                will(returnValue(starredActivities));
            }
        });

        sut.filter(activities, user);

        Assert.assertTrue(activity.isStarred());

        CONTEXT.assertIsSatisfied();       
    }
View Full Code Here

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

    @Test
    public void testExecuteOpenSocialIdsOnly()
    {
        final PagedSet<ActivityDTO> activities = context.mock(PagedSet.class);
        final List<ActivityDTO> activityList = new ArrayList<ActivityDTO>();
        ActivityDTO a1 = new ActivityDTO();
        ActivityDTO a2 = new ActivityDTO();
        activityList.add(a1);
        activityList.add(a2);

        final ExecutionStrategyFake executionStrategy = new ExecutionStrategyFake(activities);
        GetUserActivitiesExecution sut =
View Full Code Here

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

    {
        final Long act1Id = 827L;
        final Long act2Id = 82337L;

        final List<ActivityDTO> activityList = new ArrayList<ActivityDTO>();
        ActivityDTO a1 = new ActivityDTO();
        ActivityDTO a2 = new ActivityDTO();
        a1.setId(act1Id);
        a2.setId(act2Id);
        activityList.add(a1);
        activityList.add(a2);

        final ExecutionStrategyFake executionStrategy = new ExecutionStrategyFake(null);
        GetUserActivitiesExecution sut =
View Full Code Here

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

        final Long act1Id = 827L;
        final Long act2Id = 82337L;

        final PagedSet<ActivityDTO> activities = context.mock(PagedSet.class);
        final List<ActivityDTO> activityList = new ArrayList<ActivityDTO>();
        ActivityDTO a1 = new ActivityDTO();
        ActivityDTO a2 = new ActivityDTO();
        a1.setId(act1Id);
        a2.setId(act2Id);
        activityList.add(a1);
        activityList.add(a2);

        final ExecutionStrategyFake executionStrategy = new ExecutionStrategyFake(activities);
        GetUserActivitiesExecution sut =
View Full Code Here

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

    {
        final Long act1Id = 827L;
        final Long act2Id = 82337L;

        final Long newActId = 8888L;
        final ActivityDTO newAct = new ActivityDTO();
        final List<ActivityDTO> responseById = new ArrayList<ActivityDTO>();
        responseById.add(newAct);

        final PagedSet<ActivityDTO> activities = context.mock(PagedSet.class);
        final List<ActivityDTO> activityList = new ArrayList<ActivityDTO>();
        ActivityDTO a1 = new ActivityDTO();
        ActivityDTO a2 = new ActivityDTO();
        a1.setId(act1Id);
        a2.setId(act2Id);
        activityList.add(a1);
        activityList.add(a2);

        final ExecutionStrategyFake executionStrategy = new ExecutionStrategyFake(activities);
        GetUserActivitiesExecution sut =
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.