本文整理汇总了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");
}