本文整理汇总了Java中com.facebook.sdk.tests.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.facebook.sdk.tests包,在下文中一共展示了R类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSinglePermissionError
import com.facebook.sdk.tests.R; //导入依赖的package包/类
public void testSinglePermissionError() throws JSONException {
JSONObject originalResponse = new JSONObject(ERROR_SINGLE_RESPONSE_PERMISSION);
JSONObject withStatusCodeAndBody = new JSONObject();
withStatusCodeAndBody.put("code", 400);
withStatusCodeAndBody.put("body", originalResponse);
FacebookRequestError error =
FacebookRequestError.checkResponseAndCreateError(withStatusCodeAndBody, originalResponse, null);
assertNotNull(error);
assertEquals(400, error.getRequestStatusCode());
assertEquals("(#200) Requires extended permission: publish_actions", error.getErrorMessage());
assertEquals("OAuthException", error.getErrorType());
assertEquals(200, error.getErrorCode());
assertEquals(FacebookRequestError.INVALID_ERROR_CODE, error.getSubErrorCode());
assertTrue(error.getBatchRequestResult() instanceof JSONObject);
assertEquals(FacebookRequestError.Category.PERMISSION, error.getCategory());
assertEquals(R.string.com_facebook_requesterror_permissions, error.getUserActionMessageId());
}
示例2: testSingleWebLoginError
import com.facebook.sdk.tests.R; //导入依赖的package包/类
public void testSingleWebLoginError() throws JSONException {
JSONObject originalResponse = new JSONObject(ERROR_SINGLE_RESPONSE_WEB_LOGIN);
JSONObject withStatusCodeAndBody = new JSONObject();
withStatusCodeAndBody.put("code", 400);
withStatusCodeAndBody.put("body", originalResponse);
FacebookRequestError error =
FacebookRequestError.checkResponseAndCreateError(withStatusCodeAndBody, originalResponse, null);
assertNotNull(error);
assertEquals(400, error.getRequestStatusCode());
assertEquals("User need to login", error.getErrorMessage());
assertEquals("OAuthException", error.getErrorType());
assertEquals(102, error.getErrorCode());
assertEquals(459, error.getSubErrorCode());
assertTrue(error.getBatchRequestResult() instanceof JSONObject);
assertEquals(FacebookRequestError.Category.AUTHENTICATION_RETRY, error.getCategory());
assertEquals(R.string.com_facebook_requesterror_web_login, error.getUserActionMessageId());
}
示例3: testSingleReloginError
import com.facebook.sdk.tests.R; //导入依赖的package包/类
public void testSingleReloginError() throws JSONException {
JSONObject originalResponse = new JSONObject(ERROR_SINGLE_RESPONSE_RELOGIN);
JSONObject withStatusCodeAndBody = new JSONObject();
withStatusCodeAndBody.put("code", 400);
withStatusCodeAndBody.put("body", originalResponse);
FacebookRequestError error =
FacebookRequestError.checkResponseAndCreateError(withStatusCodeAndBody, originalResponse, null);
assertNotNull(error);
assertEquals(400, error.getRequestStatusCode());
assertEquals("User need to relogin", error.getErrorMessage());
assertEquals("OAuthException", error.getErrorType());
assertEquals(102, error.getErrorCode());
assertEquals(FacebookRequestError.INVALID_ERROR_CODE, error.getSubErrorCode());
assertTrue(error.getBatchRequestResult() instanceof JSONObject);
assertEquals(FacebookRequestError.Category.AUTHENTICATION_REOPEN_SESSION, error.getCategory());
assertEquals(R.string.com_facebook_requesterror_reconnect, error.getUserActionMessageId());
}
示例4: testSingleReloginDeletedAppError
import com.facebook.sdk.tests.R; //导入依赖的package包/类
public void testSingleReloginDeletedAppError() throws JSONException {
JSONObject originalResponse = new JSONObject(ERROR_SINGLE_RESPONSE_RELOGIN_DELETED_APP);
JSONObject withStatusCodeAndBody = new JSONObject();
withStatusCodeAndBody.put("code", 400);
withStatusCodeAndBody.put("body", originalResponse);
FacebookRequestError error =
FacebookRequestError.checkResponseAndCreateError(withStatusCodeAndBody, originalResponse, null);
assertNotNull(error);
assertEquals(400, error.getRequestStatusCode());
assertEquals("User need to relogin", error.getErrorMessage());
assertEquals("OAuthException", error.getErrorType());
assertEquals(190, error.getErrorCode());
assertEquals(458, error.getSubErrorCode());
assertTrue(error.getBatchRequestResult() instanceof JSONObject);
assertEquals(FacebookRequestError.Category.AUTHENTICATION_REOPEN_SESSION, error.getCategory());
assertEquals(R.string.com_facebook_requesterror_relogin, error.getUserActionMessageId());
}
示例5: testCanSetParametersViaLayout
import com.facebook.sdk.tests.R; //导入依赖的package包/类
@MediumTest
@LargeTest
public void testCanSetParametersViaLayout() throws Throwable {
TestActivity activity = getActivity();
assertNotNull(activity);
runAndBlockOnUiThread(0, new Runnable() {
@Override
public void run() {
getActivity().setContentToLayout(R.layout.place_picker_test_layout_1, R.id.place_picker_fragment);
}
});
final PlacePickerFragment fragment = activity.getFragment();
assertNotNull(fragment);
assertEquals(false, fragment.getShowPictures());
assertEquals(75, fragment.getRadiusInMeters());
assertEquals(5, fragment.getResultsLimit());
assertEquals("coffee", fragment.getSearchText());
Collection<String> extraFields = fragment.getExtraFields();
assertTrue(extraFields.contains("checkins"));
assertTrue(extraFields.contains("general_info"));
// It doesn't make sense to specify location via layout, so we don't support it.
}
示例6: testCanSetParametersViaLayout
import com.facebook.sdk.tests.R; //导入依赖的package包/类
@MediumTest
@LargeTest
public void testCanSetParametersViaLayout() throws Throwable {
TestActivity activity = getActivity();
assertNotNull(activity);
runAndBlockOnUiThread(0, new Runnable() {
@Override
public void run() {
getActivity().setContentToLayout(R.layout.friend_picker_test_layout_1, R.id.friend_picker_fragment);
}
});
final FriendPickerFragment fragment = activity.getFragment();
assertNotNull(fragment);
assertEquals(false, fragment.getShowPictures());
assertEquals(false, fragment.getMultiSelect());
Collection<String> extraFields = fragment.getExtraFields();
assertTrue(extraFields.contains("middle_name"));
assertTrue(extraFields.contains("link"));
// It doesn't make sense to specify user id via layout, so we don't support it.
}