com.jayway.facebooktestjavaapi.testuser.impl
Class HttpClientFacebookTestUserStore

java.lang.Object
  extended by com.jayway.facebooktestjavaapi.testuser.impl.HttpClientFacebookTestUserStore
All Implemented Interfaces:
FacebookTestUserStore

public class HttpClientFacebookTestUserStore
extends Object
implements FacebookTestUserStore

Implementation of FacebookTestUserStore that relies on apache HttpClient for communication with Facebook.


Constructor Summary
HttpClientFacebookTestUserStore(String applicationId, String applicationSecret)
          Creates a new instance.
 
Method Summary
protected  List<org.apache.http.NameValuePair> buildList(String... queryParams)
           
 FacebookTestUserAccount createTestUser(boolean appInstalled, String permissions)
          Creates a new Facebook test user for a Facebook application.
protected  String delete(String resource, List<org.apache.http.NameValuePair> queryParams, Object... pathParams)
           
protected  String delete(String resource, Object... pathParams)
           
 void deleteAllTestUsers()
          Delete all test users registered for a Facebook application.
protected  String get(String resource)
           
protected  String get(String resource, List<org.apache.http.NameValuePair> queryParams, Object... pathParams)
           
protected  String get(String resource, Object... pathParams)
           
 List<FacebookTestUserAccount> getAllTestUsers()
          Queries Facebook about all registered test users for a Facebook application.
 boolean isInitialized()
           
protected  String post(String resource, List<org.apache.http.NameValuePair> queryParams, List<org.apache.http.NameValuePair> formParams, Object... pathParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientFacebookTestUserStore

public HttpClientFacebookTestUserStore(String applicationId,
                                       String applicationSecret)
Creates a new instance.

Parameters:
applicationId - The Facebook application ID on which test users should be registered.
applicationSecret - The application secret.
Method Detail

createTestUser

public FacebookTestUserAccount createTestUser(boolean appInstalled,
                                              String permissions)
Description copied from interface: FacebookTestUserStore
Creates a new Facebook test user for a Facebook application.

Specified by:
createTestUser in interface FacebookTestUserStore
Parameters:
appInstalled - True if the account should directly accept the application requesting the specified permissions, false to use the FacebookTestUserAccount.loginUrl()}.
permissions - Comma-separated list of permissions for the Facebook application. See Permissions documentation.
Returns:
The created Facebook test users, if successful.

getAllTestUsers

public List<FacebookTestUserAccount> getAllTestUsers()
Description copied from interface: FacebookTestUserStore
Queries Facebook about all registered test users for a Facebook application.

Specified by:
getAllTestUsers in interface FacebookTestUserStore
Returns:
A list of Facebook test users.

deleteAllTestUsers

public void deleteAllTestUsers()
Description copied from interface: FacebookTestUserStore
Delete all test users registered for a Facebook application.

Specified by:
deleteAllTestUsers in interface FacebookTestUserStore

isInitialized

public boolean isInitialized()

get

protected String get(String resource)
              throws URISyntaxException
Throws:
URISyntaxException

get

protected String get(String resource,
                     Object... pathParams)

get

protected String get(String resource,
                     List<org.apache.http.NameValuePair> queryParams,
                     Object... pathParams)

post

protected String post(String resource,
                      List<org.apache.http.NameValuePair> queryParams,
                      List<org.apache.http.NameValuePair> formParams,
                      Object... pathParams)

delete

protected String delete(String resource,
                        Object... pathParams)

delete

protected String delete(String resource,
                        List<org.apache.http.NameValuePair> queryParams,
                        Object... pathParams)

buildList

protected List<org.apache.http.NameValuePair> buildList(String... queryParams)


Copyright © 2011. All Rights Reserved.