本文整理匯總了Java中android.support.annotation.VisibleForTesting.PRIVATE屬性的典型用法代碼示例。如果您正苦於以下問題:Java VisibleForTesting.PRIVATE屬性的具體用法?Java VisibleForTesting.PRIVATE怎麽用?Java VisibleForTesting.PRIVATE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.annotation.VisibleForTesting
的用法示例。
在下文中一共展示了VisibleForTesting.PRIVATE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkGhostBlog
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
static Single<String> checkGhostBlog(@NonNull String blogUrl,
@NonNull OkHttpClient client) {
final String adminPagePath = "/ghost/";
String adminPageUrl = NetworkUtils.makeAbsoluteUrl(blogUrl, adminPagePath);
return checkUrl(adminPageUrl, client).flatMap(response -> {
if (response.isSuccessful()) {
// the request may have been redirected, most commonly from HTTP => HTTPS
// so pick up the eventual URL of the blog and use that
// (even if the user manually entered HTTP - it's certainly a mistake)
// to get that, chop off the admin page path from the end
String potentiallyRedirectedUrl = response.request().url().toString();
String finalBlogUrl = potentiallyRedirectedUrl.replaceFirst(adminPagePath + "?$", "");
return Single.just(finalBlogUrl);
} else if (response.code() == HttpURLConnection.HTTP_NOT_FOUND) {
return Single.error(new UrlNotFoundException(blogUrl));
} else {
return Single.error(new RuntimeException("Response code " + response.code()
+ " on requesting admin page at " + adminPageUrl));
}
});
}
示例2: call
@NonNull
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
Maybe<BufferedSource> parseUri(final Uri uri) {
return Maybe.defer(new Callable<MaybeSource<BufferedSource>>() {
@Override
public MaybeSource<BufferedSource> call() throws Exception {
ParcelFileDescriptor pfd = mAppContext.getContentResolver().openFileDescriptor(uri, "r");
if (pfd != null) {
FileDescriptor fd = pfd.getFileDescriptor();
return Maybe.just(Okio.buffer(Okio.source(new FileInputStream(fd))));
}
return Maybe.empty();
}
});
}
示例3: getBookmarksListObservable
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
Single<BookmarkResult> getBookmarksListObservable(
int sortOrder, final boolean groupByTags) {
return getBookmarksWithAyatObservable(sortOrder)
.map(bookmarkData -> {
List<QuranRow> rows = getBookmarkRows(bookmarkData, groupByTags);
Map<Long, Tag> tagMap = generateTagMap(bookmarkData.getTags());
return new BookmarkResult(rows, tagMap);
})
.subscribeOn(Schedulers.io());
}
示例4: reset
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
LoginOrchestrator(BlogUrlValidator blogUrlValidator, ApiProviderFactory apiProviderFactory,
CredentialSource credentialSource, CredentialSink credentialSink,
HACKListener hackListener) {
mBlogUrlValidator = blogUrlValidator;
mApiProviderFactory = apiProviderFactory;
mCredentialSource = credentialSource;
mCredentialSink = credentialSink;
mHACKListener = hackListener;
mListeners = new HashSet<>();
reset();
}
示例5:
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
AuthService(String blogUrl, GhostApiService api,
CredentialSource credSource, CredentialSink credSink) {
mBlogUrl = blogUrl;
mApi = api;
mCredentialSource = credSource;
mCredentialSink = credSink;
}
示例6: normalizeBlogUrl
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
static String normalizeBlogUrl(String inputBlogUrl) {
return inputBlogUrl.trim().replaceFirst("^(.*)/ghost/?$", "$1");
}