当前位置: 首页>>代码示例>>Java>>正文


Java VisibleForTesting.PRIVATE属性代码示例

本文整理汇总了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));
        }
   });
}
 
开发者ID:TryGhost,项目名称:Ghost-Android,代码行数:22,代码来源:NetworkBlogUrlValidator.java

示例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();
    }
  });
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:15,代码来源:QuranImportPresenter.java

示例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());
}
 
开发者ID:Elias33,项目名称:Quran,代码行数:11,代码来源:BookmarkPresenter.java

示例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();
}
 
开发者ID:TryGhost,项目名称:Ghost-Android,代码行数:12,代码来源:LoginOrchestrator.java

示例5:

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
AuthService(String blogUrl, GhostApiService api,
            CredentialSource credSource, CredentialSink credSink) {
    mBlogUrl = blogUrl;
    mApi = api;
    mCredentialSource = credSource;
    mCredentialSink = credSink;
}
 
开发者ID:TryGhost,项目名称:Ghost-Android,代码行数:8,代码来源:AuthService.java

示例6: normalizeBlogUrl

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
static String normalizeBlogUrl(String inputBlogUrl) {
    return inputBlogUrl.trim().replaceFirst("^(.*)/ghost/?$", "$1");
}
 
开发者ID:TryGhost,项目名称:Ghost-Android,代码行数:4,代码来源:LoginOrchestrator.java


注:本文中的android.support.annotation.VisibleForTesting.PRIVATE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。