Examples of Facebook


Examples of facebook4j.Facebook

            if (endpoint.getConfiguration().getJsonStoreEnabled() == null
                || !endpoint.getConfiguration().getJsonStoreEnabled()) {
                result = invokeMethod(endpoint.getConfiguration().getFacebook(),
                    method, args);
            } else {
                final Facebook facebook = endpoint.getConfiguration().getFacebook();
                synchronized (facebook) {
                    result = invokeMethod(facebook, method, args);
                    rawJSON = DataObjectFactory.getRawJSON(result);
                }
            }
View Full Code Here

Examples of facebook4j.Facebook

                    if (endpoint.getConfiguration().getJsonStoreEnabled() == null
                        || !endpoint.getConfiguration().getJsonStoreEnabled()) {
                        result = FacebookMethodsTypeHelper.invokeMethod(
                            endpoint.getConfiguration().getFacebook(), method, properties);
                    } else {
                        final Facebook facebook = endpoint.getConfiguration().getFacebook();
                        // lock out the underlying Facebook object from other threads
                        synchronized (facebook) {
                            result = FacebookMethodsTypeHelper.invokeMethod(
                                facebook, method, properties);
                            rawJSON = DataObjectFactory.getRawJSON(result);
View Full Code Here

Examples of facebook4j.Facebook

    @Test
    public void deterministic() throws Exception {
        ArrayList list1 = new ArrayList();
        ArrayList list2 = new ArrayList();
        assertThat(list1, is(list2));
        Facebook Facebook1 = new FacebookFactory().getInstance();
        Facebook1.setOAuthAppId("appId", "appSecret");
        Facebook Facebook2 = new FacebookFactory().getInstance();
        Facebook2.setOAuthAppId("appId", "appSecret");
        assertThat(Facebook1, is(Facebook2));
    }
View Full Code Here

Examples of facebook4j.Facebook

        String oAuthAppSecret = p.getProperty("oauth.appSecret");
        build.setOAuthAccessToken(oAuthAccessToken);
        build.setOAuthAppId(oAuthAppId);
        build.setOAuthAppSecret(oAuthAppSecret);
        OAuthAuthorization auth = new OAuthAuthorization(build.build());
        Facebook fb = new FacebookFactory().getInstance(auth);
        fb.getId();
    }
View Full Code Here

Examples of facebook4j.Facebook

    @Category(RealAPITests.class)
    @Test
    public void signinWithFacebook() throws Exception {
        CookieHandler.setDefault(new ListCookieHandler());

        Facebook facebook = new FacebookFactory().getInstance();
        HttpClientImpl http = new HttpClientImpl();
        HttpResponse response;
       
        String oAuthAppId = p.getProperty("oauth.appId");
        String oAuthAppSecret = p.getProperty("oauth.appSecret");
        facebook.setOAuthAppId(oAuthAppId, oAuthAppSecret);
        facebook.setOAuthPermissions("email");

        // auth
        String callbackURL = p.getProperty("login.callbackURL");
        String authorizationURL = facebook.getOAuthAuthorizationURL(callbackURL);
        response = http.get(authorizationURL);

        // login
        String loginURL = response.getResponseHeader("Location");
        response = http.get(loginURL);
View Full Code Here

Examples of facebook4j.Facebook

public class AuthorizationTest extends FacebookTestBase {

    @Test
    public void anonymousInstance() throws Exception {
        Facebook facebook = new FacebookFactory().getInstance();
        Authorization auth = facebook.getAuthorization();
        assertThat(auth, instanceOf(NullAuthorization.class));
    }
View Full Code Here

Examples of facebook4j.Facebook

        String appSecret;
        String appId;
        appSecret = p.getProperty("oauth.appSecret");
        appId = p.getProperty("oauth.appSecret");

        Facebook facebook = new FacebookFactory().getInstance();
        facebook.setOAuthAppId(appId, appSecret);
        try {
            facebook.setOAuthAppId(appSecret, appId);
            fail("should throw IllegalStateException");
        } catch (IllegalStateException ignore) {}

        Authorization auth = facebook.getAuthorization();
        assertThat(auth, instanceOf(OAuthAuthorization.class));
    }
View Full Code Here

Examples of org.springframework.social.facebook.api.Facebook

  @Test
  public void getUserPermissions() {
    TestUser evie = createTestUser("Evie Starlight", "email,user_birthday,user_about_me");
    FacebookServiceProvider provider = new FacebookServiceProvider(APP_ID, APP_SECRET, APP_NAMESPACE);
    Facebook evieFb = provider.getApi(evie.getAccessToken());
    PagedList<String> permissions = evieFb.userOperations().getUserPermissions();
    List<String> expectedPermissions = Arrays.asList("installed", "basic_info", "public_profile", "email", "user_birthday", "user_friends", "user_about_me");
    assertEquals(expectedPermissions, permissions);
  }
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.