Package org.apache.shindig.social.opensocial.model

Examples of org.apache.shindig.social.opensocial.model.ActivityEntry


    public void testConvertActivityEntry()  {
        ActivityStreamsEntryImpl activityStreamsEntry1 = conversionUtilTest.convert((ActivityEntry)activityEntry);

        assertThat(activityStreamsEntry1.getId(), is(equalTo(activityEntry.getId())));

        ActivityEntry reconverted = conversionUtilTest.convert(activityStreamsEntry1);

        assertThat(reconverted.getId(), is(equalTo(activityStreamsEntry1.getId())));
    }
View Full Code Here


        ActivityStreamsEntry entry = repository.get(activityId);

        if (entry!=null){
            if (entry.getUserId().equalsIgnoreCase(uid)) {
                ActivityEntry activityEntry = filterFields(entry, fields);
                return ImmediateFuture.newInstance(activityEntry);
            } else {
                //TODO: Throw an error?
            }
        }
View Full Code Here

      source = new AtomSource(activity);
      generator = new AtomGenerator(activity);
      author = new AtomAuthor(activity);
      updated = activity.getUpdated();
    } else if (o instanceof ActivityEntry) {
      ActivityEntry activity = (ActivityEntry)o;
      id = activity.getId();
      title = activity.getTitle();
      summary = activity.getObject().getSummary();
      author = new AtomAuthor(activity);
      content = new AtomContent(activity);
      try {
        updated = new SimpleDateFormat().parse(activity.getPublished());
      } catch (ParseException e) {
        // TODO: map published to updated field correctly
      }
    } else if (oCopy instanceof Entry) {
      Entry<?, ?> e = (Entry<?, ?>) oCopy;
View Full Code Here

  @Test
  public void testHandleGetActivityEntryById() throws Exception {
    String path = "/activitystreams/john.doe/@friends/@app/myObjectId123"// TODO: change id=1 in DB for consistency
    RestHandler operation = registry.getRestHandler(path, "GET");

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(service.getActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.friends, null)),
        eq("appId"), eq(ImmutableSet.<String>of()), eq("myObjectId123"), eq(token))).andReturn(
        ImmediateFuture.newInstance(entry));
View Full Code Here

    String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";

    String path = "/activitystreams/john.doe/@self/@app";
    RestHandler operation = registry.getRestHandler(path, method);

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
        .andReturn(entry);

    org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
View Full Code Here

    String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";

    String path = "/activitystreams/john.doe/@self/@app";
    RestHandler operation = registry.getRestHandler(path, "POST");

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
        .andReturn(entry);

    org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
View Full Code Here

    String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";

    String path = "/activitystreams/john.doe/@self/@app/testObject";
    RestHandler operation = registry.getRestHandler(path, "PUT");

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
        .andReturn(entry);

    org.easymock.EasyMock.expect(service.updateActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
View Full Code Here

  @Test
  public void testHandleGetActivityEntryById() throws Exception {
    String path = "/activitystreams/john.doe/@friends/@app/myObjectId123"// TODO: change id=1 in DB for consistency
    RestHandler operation = registry.getRestHandler(path, "GET");

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(service.getActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.friends, null)),
        eq("appId"), eq(ImmutableSet.<String>of()), eq("myObjectId123"), eq(token))).andReturn(
        Futures.immediateFuture(entry));
View Full Code Here

    String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";

    String path = "/activitystreams/john.doe/@self/@app";
    RestHandler operation = registry.getRestHandler(path, method);

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
        .andReturn(entry);

    org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
View Full Code Here

    String jsonActivityEntry = "{title: 'hi mom!', object: {id: 'testObject'}}";

    String path = "/activitystreams/john.doe/@self/@app";
    RestHandler operation = registry.getRestHandler(path, "POST");

    ActivityEntry entry = new ActivityEntryImpl();
    org.easymock.EasyMock.expect(converter.convertToObject(eq(jsonActivityEntry), eq(ActivityEntry.class)))
        .andReturn(entry);

    org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.model.ActivityEntry

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.