Package org.apache.shindig.protocol

Examples of org.apache.shindig.protocol.RestHandler.execute()


        eq(new GroupId(GroupId.Type.self, null)),
        eq("appId"), eq(ImmutableSet.of("pandas")), eq(token)))
        .andReturn(ImmediateFuture.newInstance((Void) null));

    replay();
    assertNull(operation.execute(params, null, token, converter).get());
    verify();
  }
}
View Full Code Here


    String path = "/albums/@supportedFields";
    RestHandler operation = registry.getRestHandler(path, "GET");

    replay();
    @SuppressWarnings("unchecked")
    List<Object> received = (List<Object>) operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get();
    assertEquals(3, received.size());
    assertEquals("id", received.get(0).toString());
    assertEquals("title", received.get(1).toString());
    assertEquals("location", received.get(2).toString());
View Full Code Here

       eq(new GroupId(group, null)), (String)isNull(), eq(ImmutableSet.<String>of()),
        org.easymock.EasyMock.isA(CollectionOptions.class), eq(token))).
        andReturn(ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
    reset();
  }
View Full Code Here

        eq(new GroupId(GroupId.Type.self, null)), eq("appId"),eq(ImmutableSet.<String>of()),
        org.easymock.EasyMock.isA((CollectionOptions.class)), eq(token))).andReturn(
          ImmediateFuture.newInstance(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
    reset();
  }
View Full Code Here

        eq(new GroupId(GroupId.Type.friends, null)),
        eq("appId"), eq(ImmutableSet.<String>of()), eq("myObjectId123"), eq(token))).andReturn(
        ImmediateFuture.newInstance(entry));

    replay();
    assertEquals(entry, operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get());
    verify();
    reset();
  }
View Full Code Here

    org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
        eq(entry), eq(token))).andReturn(ImmediateFuture.newInstance((ActivityEntry) null));
    replay();

    return operation.execute(Maps.<String, String[]>newHashMap(),
        new StringReader(jsonActivityEntry), token, converter);
  }

  @Test
  public void testHandlePost() throws Exception {
View Full Code Here

    org.easymock.EasyMock.expect(service.createActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
        eq(entry), eq(token))).andReturn(ImmediateFuture.newInstance((ActivityEntry) null));
    replay();

    Future<?> future = operation.execute(Maps.<String, String[]>newHashMap(),
        new StringReader(jsonActivityEntry), token, converter);
    assertNull(future.get());
    verify();
    reset();
  }
View Full Code Here

    org.easymock.EasyMock.expect(service.updateActivityEntry(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.<String>of()),
        eq(entry), eq("testObject"), eq(token))).andReturn(ImmediateFuture.newInstance((ActivityEntry) null));
    replay();

    Future<?> future = operation.execute(Maps.<String, String[]>newHashMap(),
        new StringReader(jsonActivityEntry), token, converter);
    assertNull(future.get());
    verify();
    reset();
  }
View Full Code Here

    org.easymock.EasyMock.expect(service.deleteActivityEntries(eq(JOHN_DOE.iterator().next()),
        eq(new GroupId(GroupId.Type.self, null)), eq("appId"), eq(ImmutableSet.of("myObjectId123")),
        eq(token))).andReturn(ImmediateFuture.newInstance((Void) null));

    replay();
    assertNull(operation.execute(Maps.<String, String[]>newHashMap(), null,
        token, converter).get());
    verify();
    reset();
  }
View Full Code Here

    String path = "/activitystreams/@supportedFields";
    RestHandler operation = registry.getRestHandler(path, "GET");

    replay();
    @SuppressWarnings("unchecked")
    List<Object> received = (List<Object>) operation.execute(Maps.<String, String[]>newHashMap(),
        null, token, converter).get();
    assertEquals(2, received.size());
    assertEquals("id", received.get(0).toString());
    assertEquals("title", received.get(1).toString());
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.