Examples of FakeGadgetToken


Examples of org.apache.shindig.common.testing.FakeGadgetToken

  @Before
  public void setUp() {
    cacheProvider = new LruCacheProvider(100);
    cache = new DefaultHttpCache(cacheProvider);
    service = new DefaultInvalidationService(cache, cacheProvider, new AtomicLong());
    appxToken = new FakeGadgetToken();
    appxToken.setAppId("AppX");
    appxToken.setOwnerId("OwnerX");
    appxToken.setViewerId("ViewerX");
    appyToken = new FakeGadgetToken();
    appyToken.setAppId("AppY");
    appyToken.setOwnerId("OwnerY");
    appyToken.setViewerId("ViewerY");

    control = EasyMock.createNiceControl();
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

    backingStore.setDefaultKey(new BasicOAuthStoreConsumerKeyAndSecret("key", "secret",
        KeyType.RSA_PRIVATE, "keyname", null));
    backingStore.setDefaultCallbackUrl(DEFAULT_CALLBACK);
    store = new GadgetOAuthTokenStore(backingStore, new FakeGadgetSpecFactory());

    socialToken = new FakeGadgetToken();
    socialToken.setOwnerId("owner");
    socialToken.setViewerId("viewer");
    socialToken.setAppUrl(GADGET_URL);

    privateToken = new FakeGadgetToken();
    privateToken.setOwnerId("owner");
    privateToken.setViewerId("owner");
    privateToken.setAppUrl(GADGET_URL);

    stateCrypter = new BasicBlobCrypter("abcdefghijklmnop".getBytes());
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

  @Test
  public void testChangeSecurityToken() throws Exception {
    // Doesn't actually sign since it returns the standard fetcher.
    // Signing tests are in SigningFetcherTest
    expectGetAndReturnBody(AuthType.SIGNED, RESPONSE_BODY);
    FakeGadgetToken authToken = new FakeGadgetToken().setUpdatedToken("updated");
    expect(request.getAttribute(AuthInfo.Attribute.SECURITY_TOKEN.getId()))
        .andReturn(authToken).atLeastOnce();
    expect(request.getParameter(MakeRequestHandler.AUTHZ_PARAM))
        .andReturn(AuthType.SIGNED.toString()).atLeastOnce();
    expectParameters(request, MakeRequestHandler.AUTHZ_PARAM);
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

  @Test
  public void testDoOAuthRequest() throws Exception {
    // Doesn't actually do oauth dance since it returns the standard fetcher.
    // OAuth tests are in OAuthRequestTest
    expectGetAndReturnBody(AuthType.OAUTH, RESPONSE_BODY);
    FakeGadgetToken authToken = new FakeGadgetToken().setUpdatedToken("updated");
    expect(request.getAttribute(AuthInfo.Attribute.SECURITY_TOKEN.getId()))
        .andReturn(authToken).atLeastOnce();
    expect(request.getParameter(MakeRequestHandler.AUTHZ_PARAM))
        .andReturn(AuthType.OAUTH.toString()).atLeastOnce();
    // This isn't terribly accurate, but is close enough for this test.
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

  private Map<String,FormDataItem> emptyFormItems;

  @Before
  public void setUp() throws Exception {
    token = new FakeGadgetToken();
    token.setAppUrl("http://www.example.com/gadget.xml");

    Injector injector = Guice.createInjector();
    converter = new BeanJsonConverter(injector);
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

      ImmutableSet.of(new UserId(UserId.Type.userId, "john.doe")));


  @Before
  public void setUp() throws Exception {
    token = new FakeGadgetToken();
    converter = mock(BeanJsonConverter.class);
    appDataService = mock(AppDataService.class);
    AppDataHandler handler = new AppDataHandler(appDataService);
    registry = new DefaultHandlerRegistry(null, converter,
        new HandlerExecutionListener.NoOpHandler());
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

    DEFAULT_OPTIONS.setMax(20);
  }

  @Before
  public void setUp() throws Exception {
    token = new FakeGadgetToken();
    converter = mock(BeanJsonConverter.class);
    personService = mock(PersonService.class);
    JSONObject config = new JSONObject('{' + ContainerConfig.DEFAULT_CONTAINER + ':' +
        "{'gadgets.container': ['default']," +
         "'gadgets.features':{opensocial:" +
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

  protected HandlerRegistry registry;
  protected ContainerConfig containerConfig;

  @Before
  public void setUp() throws Exception {
    token = new FakeGadgetToken();
    token.setAppId("appId");

    converter = mock(BeanJsonConverter.class);
    service = mock(ActivityStreamService.class);
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

  protected HandlerRegistry registry;


  @Before
  public void setUp() throws Exception {
    token = new FakeGadgetToken();
    messageService = EasyMock.createMock(MessageService.class);
    messageService = EasyMock.createMock(MessageService.class);
    converter = EasyMock.createMock(BeanJsonConverter.class);
    sender = new UserId(UserId.Type.userId, "message.sender");
    recipients = ImmutableList.of("second.recipient", "first.recipient");
View Full Code Here

Examples of org.apache.shindig.common.testing.FakeGadgetToken

    JSONArray people = db.getDb().getJSONArray("people");
    JSONObject jsonPerson = new JSONObject();
    jsonPerson.put("id", "updatePerson");
    people.put(people.length(),jsonPerson);

    SecurityToken updateToken = new FakeGadgetToken("appId", "appUrl", "domain", "viewer", "trustedJson", "viewer", "20");

    // Get user
    UserId userId = new UserId(UserId.Type.userId, "updatePerson");
    Person person = db
        .getPerson(userId, Person.Field.ALL_FIELDS, token).get();
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.