Package org.eurekastreams.server.domain.stream

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


        final PersonModelView personModel = new PersonModelView();

        context.checking(new Expectations()
        {
            {
                ActivityDTO dto = new ActivityDTO();
                dto.setId(3);
                dto.setPostedTime(new Date());
                dto.setIsDestinationStreamPublic(true);

                ArrayList<Long> combinedIds = new ArrayList<Long>();
                combinedIds.add(2L);

                ArrayList<ActivityDTO> activities = new ArrayList<ActivityDTO>();
View Full Code Here


        final PersonModelView personModel = new PersonModelView();

        context.checking(new Expectations()
        {
            {
                ActivityDTO dto = new ActivityDTO();
                dto.setId(3);
                dto.setPostedTime(new Date());
                dto.setIsDestinationStreamPublic(true);

                ArrayList<Long> combinedIds = new ArrayList<Long>();
                combinedIds.add(2L);

                ArrayList<ActivityDTO> activities = new ArrayList<ActivityDTO>();
View Full Code Here

     * @return ActivityDTO populated for test.
     */
    public static ActivityDTO buildActivityDTO(final DestinationStreamTestState streamState, final boolean shareVerb,
            final CommentDTO inTestComment, final Long inDestinationId)
    {
        ActivityDTO currentActivity = new ActivityDTO();
        StreamEntityDTO destinationStream;
        switch (streamState)
        {
        case NULLSTREAM:
            currentActivity.setDestinationStream(null);
            break;
        case NULLIDENTIFIER:
            destinationStream = new StreamEntityDTO();
            currentActivity.setDestinationStream(destinationStream);
            break;
        case EMPTYIDENTIFIER:
            destinationStream = new StreamEntityDTO();
            destinationStream.setUniqueIdentifier("");
            destinationStream.setType(EntityType.PERSON);
            currentActivity.setDestinationStream(destinationStream);
            break;
        case INVALIDTYPE:
            destinationStream = new StreamEntityDTO();
            destinationStream.setUniqueIdentifier("destStream");
            destinationStream.setType(EntityType.APPLICATION);
            break;
        default:
            destinationStream = new StreamEntityDTO();
            destinationStream.setUniqueIdentifier("destStream");
            destinationStream.setType(EntityType.PERSON);
            destinationStream.setDestinationEntityId(inDestinationId);
            currentActivity.setDestinationStream(destinationStream);
            break;
        }
        if (shareVerb)
        {
            // Share is not in the verb validators dictionary and will cause an error to be thrown on validation.
            currentActivity.setVerb(ActivityVerb.SHARE);
            currentActivity.setFirstComment(inTestComment);
        }
        else
        {
            currentActivity.setVerb(ActivityVerb.POST);
        }
        currentActivity.setBaseObjectType(BaseObjectType.NOTE);
        HashMap<String, String> objProperties = new HashMap<String, String>();
        objProperties.put("Content", "stuff");
        currentActivity.setBaseObjectProperties(objProperties);

        return currentActivity;
    }
View Full Code Here

     * Test the successful path of the validation.
     */
    @Test
    public void testValidate()
    {
        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.POST);

        sut.validate(testActivity);
    }
View Full Code Here

    public void testFullOriginalActorValidate()
    {
        testActorEntityDTO = new StreamEntityDTO();
        testActorEntityDTO.setUniqueIdentifier(UNIQUE_ID);

        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.POST);
        testActivity.setOriginalActor(testActorEntityDTO);

        try
        {
View Full Code Here

    public void testPartialOriginalActorValidate()
    {
        testActorEntityDTO = new StreamEntityDTO();
        testActorEntityDTO.setUniqueIdentifier(null);

        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.POST);
        testActivity.setOriginalActor(testActorEntityDTO);

        try
        {
View Full Code Here

    public void testMissingUniqueIdOriginalActorValidate()
    {
        testActorEntityDTO = new StreamEntityDTO();
        testActorEntityDTO.setUniqueIdentifier("");

        testActivity = new ActivityDTO();
        testActivity.setVerb(ActivityVerb.POST);
        testActivity.setOriginalActor(testActorEntityDTO);

        try
        {
View Full Code Here

        HashMap<String, String> testValueMap = new HashMap<String, String>();
        testValueMap.put("content", "good content");
        testValueMap.put("targetTitle", "title");
        testValueMap.put("targetUrl", "testurl");

        testActivity = new ActivityDTO();
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);
        testActivity.setBaseObjectProperties(testValueMap);

        sut.validate(testActivity);
    }
View Full Code Here

    {
        HashMap<String, String> testValueMap = new HashMap<String, String>();
        testValueMap.put("targetTitle", "title");
        testValueMap.put("targetUrl", "testurl");

        testActivity = new ActivityDTO();
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);
        testActivity.setBaseObjectProperties(testValueMap);

        sut.validate(testActivity);
    }
View Full Code Here

        HashMap<String, String> testValueMap = new HashMap<String, String>();
        testValueMap.put("content", longString);
        testValueMap.put("targetTitle", "title");
        testValueMap.put("targetUrl", "testurl");

        testActivity = new ActivityDTO();
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);
        testActivity.setBaseObjectProperties(testValueMap);

        sut.validate(testActivity);
    }
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.