當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。