id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
62553999_95
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/QuestionResponseTest.java", "identifier": "QuestionResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetQuestions() throws Exception {\n QuestionResponse questionResponse = new QuestionResponse();\n List<Question> questions = new ArrayList<>();\n questions.add(new Question());\n questionResponse.setQuestions(questions);\n assertTrue(questions =...
{ "fields": [ { "declarator": "mQuestions", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Question> mQuestions;", "type": "List<Question>", "var_name": "mQuestions" } ], "file": "StackExchangeClient/app...
{ "body": "public void setQuestions(@NonNull List<Question> questions) {\n mQuestions = questions;\n }", "class_method_signature": "QuestionResponse.setQuestions(@NonNull List<Question> questions)", "constructor": false, "full_signature": "public void setQuestions(@NonNull List<Question> questions)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_9
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private RepositoriesView mView;", "type": "RepositoriesView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Repositori...
{ "body": "@Test\n public void testErrorResponse() throws Exception {\n ApiFactory.setProvider(new TestProviderImpl(new FailGithubService()));\n\n mPresenter.dispatchCreated();\n\n verify(mView).showLoading();\n verify(mView).hideLoading();\n verify(mView).showError();\n }", ...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void dispatchCreated() {\n RxLoader.create(mContext, mLm, R.id.local_repositories_loader,\n mRepository.cachedRepositories()\n .subscribeOn(Schedulers.io())\n .doOnTerminate(this::refresh)\n .observeOn(Android...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_121
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullStringIsEmpty() throws Exception {\n boolean empty = TextUtils.isEmpty(null);\n //noinspection ConstantConditions\n assertTrue(empty);\n }", "class_method_signature": "TextUtilsTest.testNullStringIsEmpty()", "constructor": false, "full_signature"...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_101
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/RxSchedulersTest.java", "identifier": "RxSchedulersTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void test() throws Exception {\n Observable.just(3)\n .compose(RxSchedulers.async())\n .subscribe(integer -> assertEquals(3, integer.intValue()));\n }", "class_method_signature": "RxSchedulersTest.test()", "constructor": false, "full_signature...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/rx/RxSchedulers.java", "identifier": "RxSchedulers", "interfaces": "", "methods": [ { "class_method_signature": "RxSchedulers.RxSchedulers()", "constructor": true, "full_signature": "privat...
{ "body": "@NonNull\n public static <T> Observable.Transformer<T, T> async() {\n return observable -> observable\n .subscribeOn(io())\n .observeOn(main());\n }", "class_method_signature": "RxSchedulers.async()", "constructor": false, "full_signature": "@NonNull public ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_117
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/api/RepositoryProviderTest.java", "identifier": "RepositoryProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLocalNotInited() throws Exception {\n assertNull(RepositoryProvider.provideLocalRepository());\n }", "class_method_signature": "RepositoryProviderTest.testLocalNotInited()", "constructor": false, "full_signature": "@Test public void testLocalNotInited()", "ident...
{ "fields": [ { "declarator": "sRemoteRepository", "modifier": "private static", "original_string": "private static RemoteRepository sRemoteRepository;", "type": "RemoteRepository", "var_name": "sRemoteRepository" }, { "declarator": "sLocalRepository", "modifier":...
{ "body": "@NonNull\n public static LocalRepository provideLocalRepository() {\n return sLocalRepository;\n }", "class_method_signature": "RepositoryProvider.provideLocalRepository()", "constructor": false, "full_signature": "@NonNull public static LocalRepository provideLocalRepository()", "iden...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_37
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/content/auth/AuthorizationUtilsTest.java", "identifier": "AuthorizationUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testJsonParams() throws Exception {\n JsonObject json = AuthorizationUtils.createAuthorizationParam();\n assertNotNull(json);\n\n assertEquals(2, json.entrySet().size());\n\n assertTrue(json.has(\"client_id\"));\n assertEquals(BuildConfig.CLIENT_ID,...
{ "fields": [ { "declarator": "BASIC_AUTHORIZATION = \"Basic \"", "modifier": "private static final", "original_string": "private static final String BASIC_AUTHORIZATION = \"Basic \";", "type": "String", "var_name": "BASIC_AUTHORIZATION" }, { "declarator": "CLIENT_ID_PR...
{ "body": "@NonNull\n public static JsonObject createAuthorizationParam() {\n JsonObject param = new JsonObject();\n param.addProperty(CLIENT_ID_PROPERTY, BuildConfig.CLIENT_ID);\n param.addProperty(CLIENT_SECRET_PROPERTY, BuildConfig.CLIENT_SECRET);\n return param;\n }", "class_me...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_60
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "@SuppressWarnings(\"unchecked\")\n @Test\n public void testPositionRestored() throws Exception {\n ArrayList tags = new ArrayList();\n tags.add(new Tag(\"android\", false));\n tags.add(new Tag(\"android-actionbar\", false));\n tags.add(new Tag(\"android-testing\", false));...
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n mView.setEmptyText(R.string.no_tags_found);\n\n if (savedInstanceState != null) {\n List<Tag> tags = savedInstanceState.getParcelableArrayList(FOUND_TAGS_KEY);\n tags = tags == null ? new ArrayList<>() : tags;\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_76
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testLoadingProgressShown() throws Exception {\n mPresenter.init(null);\n\n Mockito.verify(mLoadingView).showLoadingIndicator();\n Mockito.verify(mLoadingView).hideLoadingIndicator();\n }", "class_method_signature": "ProfilePresenterTest.testLoadingProgressSh...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_5
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testButtonClickFinish() throws Exception {\n mPresenter.onButtonClick();\n mPresenter.onButtonClick();\n mPresenter.onButtonClick();\n\n assertTrue(Settings.isWalkthroughPassed(mContext));\n verify(mView).finishWalkthrough();\n }", "class_metho...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "public void onButtonClick() {\n if (isLastBenefit()) {\n Settings.saveWalkthroughPassed(mContext);\n mView.finishWalkthrough();\n } else {\n mCurrentItem++;\n mView.showBenefit(mCurrentItem, isLastBenefit());\n }\n }", "class_method_sign...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_99
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/BadgeResponseTest.java", "identifier": "BadgeResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testBadgesNotNull() throws Exception {\n BadgeResponse badgeResponse = new BadgeResponse();\n assertNotNull(badgeResponse.getBadges());\n }", "class_method_signature": "BadgeResponseTest.testBadgesNotNull()", "constructor": false, "full_signature": "@Test publi...
{ "fields": [ { "declarator": "mBadges", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Badge> mBadges;", "type": "List<Badge>", "var_name": "mBadges" } ], "file": "StackExchangeClient/app/src/main/java/...
{ "body": "@NonNull\n public List<Badge> getBadges() {\n if (mBadges == null) {\n mBadges = new ArrayList<>();\n }\n return mBadges;\n }", "class_method_signature": "BadgeResponse.getBadges()", "constructor": false, "full_signature": "@NonNull public List<Badge> getBadges()...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_21
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/rx/RxResultTest.java", "identifier": "RxResultTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOnComplete() throws Exception {\n RxResult<Integer> result = RxResult.onComplete();\n assertNull(result.getResult());\n assertNull(result.getError());\n assertTrue(result.isOnComplete());\n }", "class_method_signature": "RxResultTest.testOnComplet...
{ "fields": [ { "declarator": "mResult", "modifier": "private final", "original_string": "private final T mResult;", "type": "T", "var_name": "mResult" }, { "declarator": "mError", "modifier": "private final", "original_string": "private final Throwable mErr...
{ "body": "@NonNull\n public static <T> RxResult<T> onComplete() {\n return new RxResult<>(null, null, true);\n }", "class_method_signature": "RxResult.onComplete()", "constructor": false, "full_signature": "@NonNull public static RxResult<T> onComplete()", "identifier": "onComplete", "invocati...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_59
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "@Test\n public void testShowSavedTags() throws Exception {\n RepositoryProvider.setLocalRepository(new ContentLocalRepository(false));\n mPresenter.init(null);\n\n Mockito.verify(mView).showTags(anyListOf(Tag.class));\n Mockito.verify(mView).hideEmptyListView();\n Mock...
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n mView.setEmptyText(R.string.no_tags_found);\n\n if (savedInstanceState != null) {\n List<Tag> tags = savedInstanceState.getParcelableArrayList(FOUND_TAGS_KEY);\n tags = tags == null ? new ArrayList<>() : tags;\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_102
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/StubActionTest.java", "identifier": "StubActionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCallDoesNothing() throws Exception {\n Action1<Runnable> action1 = new StubAction<>();\n\n Runnable runnable = Mockito.mock(Runnable.class);\n Mockito.doNothing().when(runnable).run();\n action1.call(runnable);\n\n Mockito.verify(runnable, times...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/rx/StubAction.java", "identifier": "StubAction", "interfaces": "implements Action1<T>", "methods": [ { "class_method_signature": "StubAction.call(T t)", "constructor": false, "full_signatur...
{ "body": "@Override\n public void call(T t) {\n // Do nothing\n }", "class_method_signature": "StubAction.call(T t)", "constructor": false, "full_signature": "@Override public void call(T t)", "identifier": "call", "invocations": [], "modifiers": "@Override public", "parameters": "(T t)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_18
{ "fields": [ { "declarator": "mObserver", "modifier": "private", "original_string": "private Observer<Integer> mObserver;", "type": "Observer<Integer>", "var_name": "mObserver" }, { "declarator": "mRxLc", "modifier": "private", "original_string": "private R...
{ "body": "@Test\n public void testOnLoaderReset() throws Exception {\n mRxLc.onLoaderReset(mRxLc.onCreateLoader(0, mock(Bundle.class)));\n verify(mObserver, times(0)).onError(any(Throwable.class));\n verify(mObserver, times(0)).onNext(anyInt());\n verify(mObserver, times(0)).onComplete...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mObservable", "modifier": "private final", "original_string": "private ...
{ "body": "@Override\n public void onLoaderReset(Loader<RxResult<T>> loader) {\n // Do nothing\n }", "class_method_signature": "RxLcImpl.onLoaderReset(Loader<RxResult<T>> loader)", "constructor": false, "full_signature": "@Override public void onLoaderReset(Loader<RxResult<T>> loader)", "identifi...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_34
{ "fields": [ { "declarator": "TEST_VIEW_ID = R.id.toolbar", "modifier": "private static final", "original_string": "private static final int TEST_VIEW_ID = R.id.toolbar;", "type": "int", "var_name": "TEST_VIEW_ID" } ], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/gi...
{ "body": "@Test\n public void testFindByIdInActivity() throws Exception {\n Activity activity = mock(Activity.class);\n View view = mock(View.class);\n when(activity.findViewById(TEST_VIEW_ID)).thenReturn(view);\n\n assertTrue(view == Views.findById(activity, TEST_VIEW_ID));\n v...
{ "fields": [], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/utils/Views.java", "identifier": "Views", "interfaces": "", "methods": [ { "class_method_signature": "Views.Views()", "constructor": true, "full_signature": "private Views()", "identifier": "Views", ...
{ "body": "@NonNull\n @SuppressWarnings(\"unchecked\")\n public static <T extends View> T findById(@NonNull View view, @IdRes int id) {\n return (T) view.findViewById(id);\n }", "class_method_signature": "Views.findById(@NonNull View view, @IdRes int id)", "constructor": false, "full_signature":...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_138
{ "fields": [ { "declarator": "TEST_VIEW_ID = R.id.toolbar", "modifier": "private static final", "original_string": "private static final int TEST_VIEW_ID = R.id.toolbar;", "type": "int", "var_name": "TEST_VIEW_ID" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturv...
{ "body": "@Test\n public void testFindByIdView() throws Exception {\n View findView = mock(View.class);\n View view = mock(View.class);\n when(findView.findViewById(TEST_VIEW_ID)).thenReturn(view);\n\n assertTrue(view == Views.findById(findView, TEST_VIEW_ID));\n verify(findView...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/Views.java", "identifier": "Views", "interfaces": "", "methods": [ { "class_method_signature": "Views.Views()", "constructor": true, "full_signature": "private Views()", "ident...
{ "body": "@NonNull\n public static <T extends View> T findById(@NonNull Activity activity, @IdRes int viewId) {\n //noinspection unchecked\n return (T) activity.findViewById(viewId);\n }", "class_method_signature": "Views.findById(@NonNull Activity activity, @IdRes int viewId)", "constructor"...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_63
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testShowAnswers() throws Exception {\n RepositoryProvider.setRemoteRepository(new ContentRepository());\n mPresenter.init(null);\n\n Mockito.verify(mView).setEmptyText(R.string.no_answers);\n Mockito.verify(mView).showAnswers(anyListOf(Answer.class));\n ...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "QUESTION_LINK_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n mView.setEmptyText(R.string.no_answers);\n\n RxLoader.create(mContext, mLm, R.id.answers_loader_id, Re...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_6
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testWalkthroughClicksScenario() throws Exception {\n mPresenter.onButtonClick();\n verify(mView).showBenefit(1, false);\n\n mPresenter.onButtonClick();\n verify(mView).showBenefit(2, true);\n\n mPresenter.onButtonClick();\n verify(mView).fini...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "public void onButtonClick() {\n if (isLastBenefit()) {\n Settings.saveWalkthroughPassed(mContext);\n mView.finishWalkthrough();\n } else {\n mCurrentItem++;\n mView.showBenefit(mCurrentItem, isLastBenefit());\n }\n }", "class_method_sign...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_75
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private QuestionsListView mView;", "type": "QuestionsListView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Question...
{ "body": "@Test\n public void testErrorIgnored() throws Exception {\n RepositoryProvider.setRemoteRepository(new ErrorRemoteRepository());\n RepositoryProvider.setLocalRepository(new ContentLocalRepository());\n mPresenter.init();\n\n Mockito.verify(mView, never()).showEmptyListView();...
{ "fields": [ { "declarator": "VISIBILITY_MARGIN = 10", "modifier": "private static final", "original_string": "private static final int VISIBILITY_MARGIN = 10;", "type": "int", "var_name": "VISIBILITY_MARGIN" }, { "declarator": "mContext", "modifier": "private fi...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository()\n .questions(mTag)\n .subscribe(this::handleQuestions, this::handleError);\n\n RxLoader.create(mContext, mLm, mTag.hashCode(),\n RepositoryProvider.provideRemoteRepository().questio...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_22
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/OkHttpTest.java", "identifier": "OkHttpTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoggingInterceptor() throws Exception {\n Interceptor interceptor = OkHttp.getLoggingInterceptor();\n assertNotNull(interceptor);\n }", "class_method_signature": "OkHttpTest.testLoggingInterceptor()", "constructor": false, "full_signature": "@Test public vo...
{ "fields": [ { "declarator": "CONNECT_TIMEOUT = 15", "modifier": "private static final", "original_string": "private static final int CONNECT_TIMEOUT = 15;", "type": "int", "var_name": "CONNECT_TIMEOUT" }, { "declarator": "READ_TIMEOUT = 30", "modifier": "private...
{ "body": "@NonNull\n public static Interceptor getLoggingInterceptor() {\n return new HttpLoggingInterceptor().setLevel(BuildConfig.DEBUG\n ? HttpLoggingInterceptor.Level.BODY\n : HttpLoggingInterceptor.Level.NONE);\n }", "class_method_signature": "OkHttp.getLoggingInterc...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_55
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;", "type": "WalkthroughView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private WalkthroughP...
{ "body": "@Test\n public void testInit() throws Exception {\n mPresenter.init(null);\n Mockito.verify(mView).showBenefit(0);\n Mockito.verify(mView).setActionButtonText(R.string.next_uppercase);\n }", "class_method_signature": "WalkthroughPresenterTest.testInit()", "constructor": false...
{ "fields": [ { "declarator": "PAGE_COUNT = 3", "modifier": "public static final", "original_string": "public static final int PAGE_COUNT = 3;", "type": "int", "var_name": "PAGE_COUNT" }, { "declarator": "CURRENT_ITEM_KEY = \"current_item\"", "modifier": "private ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState == null) {\n mCurrentItem = 0;\n showCurrentBenefit();\n } else {\n mCurrentItem = savedInstanceState.getInt(CURRENT_ITEM_KEY);\n mIsWalkthroughPassed = savedInstanceSt...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_118
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/api/RepositoryProviderTest.java", "identifier": "RepositoryProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testKeyValueNotInited() throws Exception {\n assertNull(RepositoryProvider.provideKeyValueStorage());\n }", "class_method_signature": "RepositoryProviderTest.testKeyValueNotInited()", "constructor": false, "full_signature": "@Test public void testKeyValueNotInited()",...
{ "fields": [ { "declarator": "sRemoteRepository", "modifier": "private static", "original_string": "private static RemoteRepository sRemoteRepository;", "type": "RemoteRepository", "var_name": "sRemoteRepository" }, { "declarator": "sLocalRepository", "modifier":...
{ "body": "@NonNull\n public static KeyValueStorage provideKeyValueStorage() {\n return sKeyValueStorage;\n }", "class_method_signature": "RepositoryProvider.provideKeyValueStorage()", "constructor": false, "full_signature": "@NonNull public static KeyValueStorage provideKeyValueStorage()", "iden...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_14
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testSuccessAuth() throws Exception {\n mPreferences.edit().clear().apply();\n ApiFactory.setProvider(new TestProviderImpl(new GithubServiceSuccess()));\n\n mPresenter.tryLogIn(\"login\", \"password\");\n verify(mView).showLoading();\n verify(mView)....
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void tryLogIn(@NonNull String login, @NonNull String password) {\n if (TextUtils.isEmpty(login)) {\n mView.showLoginError();\n } else if (TextUtils.isEmpty(password)) {\n mView.showPasswordError();\n } else {\n String authorizationString = Author...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_43
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/widget/WalkthroughAdapterTest.java", "identifier": "WalkthroughAdapterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetItem() throws Exception {\n FragmentManager manager = Mockito.mock(FragmentManager.class);\n List benefits = mock(List.class);\n when(benefits.size()).thenReturn(3);\n when(benefits.get(0)).thenReturn(Benefit.WORK_TOGETHER);\n when(benefits.g...
{ "fields": [ { "declarator": "mBenefits", "modifier": "private final", "original_string": "private final List<Benefit> mBenefits;", "type": "List<Benefit>", "var_name": "mBenefits" } ], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/widget/WalkthroughAdapter...
{ "body": "@Override\n public Fragment getItem(int position) {\n return WalkthroughBenefitFragment.create(mBenefits.get(position));\n }", "class_method_signature": "WalkthroughAdapter.getItem(int position)", "constructor": false, "full_signature": "@Override public Fragment getItem(int position)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_134
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStringBuilderDifferentLengths() throws Exception {\n StringBuilder first = new StringBuilder(\"9pda\");\n StringBuilder second = new StringBuilder(\"0ca\");\n boolean equals = TextUtils.equals(first, second);\n assertFalse(equals);\n }", "class_me...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_38
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/content/auth/AuthorizationUtilsTest.java", "identifier": "AuthorizationUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAuthorizationString() throws Exception {\n String login = \"login\";\n String password = \"password\";\n\n String result = AuthorizationUtils.createAuthorizationString(login, password);\n assertNotNull(result);\n\n assertTrue(result.startsWith(\...
{ "fields": [ { "declarator": "BASIC_AUTHORIZATION = \"Basic \"", "modifier": "private static final", "original_string": "private static final String BASIC_AUTHORIZATION = \"Basic \";", "type": "String", "var_name": "BASIC_AUTHORIZATION" }, { "declarator": "CLIENT_ID_PR...
{ "body": "@NonNull\n public static String createAuthorizationString(@NonNull String login, @NonNull String password) {\n String combinedStr = String.format(\"%1$s:%2$s\", login, password);\n String authorizationString = BASIC_AUTHORIZATION + Base64.encodeToString(combinedStr.getBytes(), Base64.DEFAU...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_80
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testBadgesAndTagsShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ContentRepository());\n\n mPresenter.init(null);\n\n Mockito.verify(mView).showBadges(anyListOf(Badge.class));\n Mockito.verify(mView).showTopTags(anyListOf(UserTag.cl...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_96
{ "fields": [ { "declarator": "mApiError", "modifier": "private", "original_string": "private ApiError mApiError;", "type": "ApiError", "var_name": "mApiError" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/ServerErrorTe...
{ "body": "@Test\n public void testGetApiError() throws Exception {\n //noinspection ThrowableInstanceNeverThrown\n ServerError error = new ServerError(mApiError);\n assertTrue(mApiError == error.getError());\n }", "class_method_signature": "ServerErrorTest.testGetApiError()", "construc...
{ "fields": [ { "declarator": "serialVersionUID = ServerError.class.getName().hashCode()", "modifier": "private static final", "original_string": "private static final long serialVersionUID = ServerError.class.getName().hashCode();", "type": "long", "var_name": "serialVersionUID" ...
{ "body": "@NonNull\n public ApiError getError() {\n return mError;\n }", "class_method_signature": "ServerError.getError()", "constructor": false, "full_signature": "@NonNull public ApiError getError()", "identifier": "getError", "invocations": [], "modifiers": "@NonNull public", "paramete...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_79
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testEmptyTagsNotShown() throws Exception {\n mPresenter.init(null);\n\n Mockito.verify(mView, times(0)).showTopTags(anyListOf(UserTag.class));\n }", "class_method_signature": "ProfilePresenterTest.testEmptyTagsNotShown()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_122
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEmptyString() throws Exception {\n boolean empty = TextUtils.isEmpty(\"\");\n assertTrue(empty);\n }", "class_method_signature": "TextUtilsTest.testEmptyString()", "constructor": false, "full_signature": "@Test public void testEmptyString()", "identifier"...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_123
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotEmptyString1() throws Exception {\n boolean empty = TextUtils.isEmpty(\"s\");\n assertFalse(empty);\n }", "class_method_signature": "TextUtilsTest.testNotEmptyString1()", "constructor": false, "full_signature": "@Test public void testNotEmptyString1()", ...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_97
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/NotificationResponseTest.java", "identifier": "NotificationResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotificationsNotNull() throws Exception {\n NotificationResponse notificationResponse = new NotificationResponse();\n assertNotNull(notificationResponse.getNotifications());\n }", "class_method_signature": "NotificationResponseTest.testNotificationsNotNull()", ...
{ "fields": [ { "declarator": "mNotifications", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Notification> mNotifications;", "type": "List<Notification>", "var_name": "mNotifications" } ], "file": "Sta...
{ "body": "@NonNull\n public List<Notification> getNotifications() {\n if (mNotifications == null) {\n mNotifications = new ArrayList<>();\n }\n return mNotifications;\n }", "class_method_signature": "NotificationResponse.getNotifications()", "constructor": false, "full_sig...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_78
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testEmptyBadgesNotShown() throws Exception {\n mPresenter.init(null);\n\n Mockito.verify(mView, times(0)).showBadges(anyListOf(Badge.class));\n }", "class_method_signature": "ProfilePresenterTest.testEmptyBadgesNotShown()", "constructor": false, "full_signature...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_81
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n\n mPresenter.init(null);\n Mockito.verify(mErrorView).showNetworkError();\n }", "class_method_signature": "ProfilePresenterTest.testErrorShown()", "const...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "LINK_FORMAT = ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n int userId = mUser.getUs...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_39
{ "fields": [ { "declarator": "mValues", "modifier": "private", "original_string": "private List<Integer> mValues;", "type": "List<Integer>", "var_name": "mValues" } ], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/widget/BaseAdapterTest.java", "identifier...
{ "body": "@Test\n public void testCount() throws Exception {\n BaseAdapter<TestHolder, Integer> adapter = new TestAdapter(mValues);\n assertEquals(4, adapter.getItemCount());\n }", "class_method_signature": "BaseAdapterTest.testCount()", "constructor": false, "full_signature": "@Test public...
{ "fields": [ { "declarator": "mItems = new ArrayList<>()", "modifier": "private final", "original_string": "private final List<T> mItems = new ArrayList<>();", "type": "List<T>", "var_name": "mItems" }, { "declarator": "mOnItemClickListener", "modifier": "@Nullab...
{ "body": "@Override\n public int getItemCount() {\n return mItems.size();\n }", "class_method_signature": "BaseAdapter.getItemCount()", "constructor": false, "full_signature": "@Override public int getItemCount()", "identifier": "getItemCount", "invocations": [ "size" ], "modifiers": "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_135
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStringBuilderDifferentSymbols() throws Exception {\n StringBuilder first = new StringBuilder(\"arozaupalanalapuazora\");\n StringBuilder second = new StringBuilder(\"urozaupalanalapuazoru\");\n boolean equals = TextUtils.equals(first, second);\n assert...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_42
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/widget/WalkthroughAdapterTest.java", "identifier": "WalkthroughAdapterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testItemsCount() throws Exception {\n FragmentManager manager = Mockito.mock(FragmentManager.class);\n List<Benefit> benefits = new ArrayList<Benefit>() {\n {\n add(Benefit.PUBLISH_SOURCE);\n add(Benefit.CODE_HISTORY);\n ...
{ "fields": [ { "declarator": "mBenefits", "modifier": "private final", "original_string": "private final List<Benefit> mBenefits;", "type": "List<Benefit>", "var_name": "mBenefits" } ], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/widget/WalkthroughAdapter...
{ "body": "@Override\n public int getCount() {\n return mBenefits.size();\n }", "class_method_signature": "WalkthroughAdapter.getCount()", "constructor": false, "full_signature": "@Override public int getCount()", "identifier": "getCount", "invocations": [ "size" ], "modifiers": "@Overr...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_15
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testErrorAuth() throws Exception {\n mPreferences.edit().clear().apply();\n ApiFactory.setProvider(new TestProviderImpl(new GithubServiceFail()));\n\n mPresenter.tryLogIn(\"login\", \"password\");\n verify(mView).showLoading();\n verify(mView).hideL...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void tryLogIn(@NonNull String login, @NonNull String password) {\n if (TextUtils.isEmpty(login)) {\n mView.showLoginError();\n } else if (TextUtils.isEmpty(password)) {\n mView.showPasswordError();\n } else {\n String authorizationString = Author...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_119
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/api/ErrorsHandlerTest.java", "identifier": "ErrorsHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNoError() throws Exception {\n List<User> users = new ArrayList<>();\n users.add(new User());\n UserResponse response = new UserResponse();\n response.setUsers(users);\n\n UserResponse checkedResponse = Observable.just(response)\n ...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/api/ErrorsHandler.java", "identifier": "ErrorsHandler", "interfaces": "", "methods": [ { "class_method_signature": "ErrorsHandler.ErrorsHandler()", "constructor": true, "full_signature": "p...
{ "body": "@NonNull\n public static <T extends ApiError> Observable.Transformer<T, T> handleErrors() {\n return observable -> observable\n .flatMap(t -> {\n if (t.isError()) {\n return Observable.error(new ServerError(t));\n }\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_54
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private MainView mView;", "type": "MainView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private MainPresenter mPresenter;"...
{ "body": "@Test\n public void testOpenAnswers() throws Exception {\n mPresenter.onMyAnswersSelected();\n Mockito.verify(mView).openAnswers(any(User.class));\n }", "class_method_signature": "MainPresenterTest.testOpenAnswers()", "constructor": false, "full_signature": "@Test public void test...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void onMyAnswersSelected() {\n mView.openAnswers(mCurrentUser);\n }", "class_method_signature": "MainPresenter.onMyAnswersSelected()", "constructor": false, "full_signature": "public void onMyAnswersSelected()", "identifier": "onMyAnswersSelected", "invocations": [ "openAnswe...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_23
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/OkHttpTest.java", "identifier": "OkHttpTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTokenInterceptor() throws Exception {\n Interceptor interceptor = OkHttp.getTokenInterceptor(\"token\");\n assertNotNull(interceptor);\n }", "class_method_signature": "OkHttpTest.testTokenInterceptor()", "constructor": false, "full_signature": "@Test public...
{ "fields": [ { "declarator": "CONNECT_TIMEOUT = 15", "modifier": "private static final", "original_string": "private static final int CONNECT_TIMEOUT = 15;", "type": "int", "var_name": "CONNECT_TIMEOUT" }, { "declarator": "READ_TIMEOUT = 30", "modifier": "private...
{ "body": "@NonNull\n public static Interceptor getTokenInterceptor(@NonNull String token) {\n return TokenInterceptor.getInstance(token);\n }", "class_method_signature": "OkHttp.getTokenInterceptor(@NonNull String token)", "constructor": false, "full_signature": "@NonNull public static Interceptor...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_7
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private RepositoriesView mView;", "type": "RepositoriesView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Repositori...
{ "body": "@Test\n public void testOnItemClick() throws Exception {\n Repository repository = new Repository();\n mPresenter.onItemClick(repository);\n verify(mView).showCommits(repository);\n }", "class_method_signature": "RepositoriesPresenterTest.testOnItemClick()", "constructor": fa...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void onItemClick(@NonNull Repository repository) {\n mView.showCommits(repository);\n }", "class_method_signature": "RepositoriesPresenter.onItemClick(@NonNull Repository repository)", "constructor": false, "full_signature": "public void onItemClick(@NonNull Repository repository)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_74
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private QuestionsListView mView;", "type": "QuestionsListView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Question...
{ "body": "@Test\n public void testHandleError() throws Exception {\n RepositoryProvider.setRemoteRepository(new ErrorRemoteRepository());\n mPresenter.init();\n\n Mockito.verify(mView, Mockito.times(2)).showEmptyListView();\n Mockito.verify(mView).hideRefresh();\n }", "class_metho...
{ "fields": [ { "declarator": "VISIBILITY_MARGIN = 10", "modifier": "private static final", "original_string": "private static final int VISIBILITY_MARGIN = 10;", "type": "int", "var_name": "VISIBILITY_MARGIN" }, { "declarator": "mContext", "modifier": "private fi...
{ "body": "private void handleError(@NonNull Throwable throwable) {\n if (mQuestions.isEmpty()) {\n mView.showEmptyListView();\n }\n mView.hideRefresh();\n }", "class_method_signature": "QuestionsListPresenter.handleError(@NonNull Throwable throwable)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_62
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testLoadingProgressShown() throws Exception {\n mPresenter.init(null);\n\n Mockito.verify(mLoadingView).showLoadingIndicator();\n Mockito.verify(mLoadingView).hideLoadingIndicator();\n }", "class_method_signature": "AnswersListPresenterTest.testLoadingProgre...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "QUESTION_LINK_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n mView.setEmptyText(R.string.no_answers);\n\n RxLoader.create(mContext, mLm, R.id.answers_loader_id, Re...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_35
{ "fields": [ { "declarator": "TEST_VIEW_ID = R.id.toolbar", "modifier": "private static final", "original_string": "private static final int TEST_VIEW_ID = R.id.toolbar;", "type": "int", "var_name": "TEST_VIEW_ID" } ], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/gi...
{ "body": "@Test\n public void testFindByIdView() throws Exception {\n View findView = mock(View.class);\n View view = mock(View.class);\n when(findView.findViewById(TEST_VIEW_ID)).thenReturn(view);\n\n assertTrue(view == Views.findById(findView, TEST_VIEW_ID));\n verify(findView...
{ "fields": [], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/utils/Views.java", "identifier": "Views", "interfaces": "", "methods": [ { "class_method_signature": "Views.Views()", "constructor": true, "full_signature": "private Views()", "identifier": "Views", ...
{ "body": "@NonNull\n @SuppressWarnings(\"unchecked\")\n public static <T extends View> T findById(@NonNull View view, @IdRes int id) {\n return (T) view.findViewById(id);\n }", "class_method_signature": "Views.findById(@NonNull View view, @IdRes int id)", "constructor": false, "full_signature":...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_115
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/app/GsonHolderTest.java", "identifier": "GsonHolderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGsonNotNull() throws Exception {\n assertNotNull(GsonHolder.getGson());\n }", "class_method_signature": "GsonHolderTest.testGsonNotNull()", "constructor": false, "full_signature": "@Test public void testGsonNotNull()", "identifier": "testGsonNotNull", "invocat...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/app/GsonHolder.java", "identifier": "GsonHolder", "interfaces": "", "methods": [ { "class_method_signature": "GsonHolder.GsonHolder()", "constructor": true, "full_signature": "private Gson...
{ "body": "@NonNull\n public static Gson getGson() {\n return Holder.GSON;\n }", "class_method_signature": "GsonHolder.getGson()", "constructor": false, "full_signature": "@NonNull public static Gson getGson()", "identifier": "getGson", "invocations": [], "modifiers": "@NonNull public static"...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_19
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/rx/RxResultTest.java", "identifier": "RxResultTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOnNext() throws Exception {\n RxResult<Integer> result = RxResult.onNext(5);\n assertEquals(Integer.valueOf(5), result.getResult());\n assertNull(result.getError());\n assertFalse(result.isOnComplete());\n }", "class_method_signature": "RxResultTe...
{ "fields": [ { "declarator": "mResult", "modifier": "private final", "original_string": "private final T mResult;", "type": "T", "var_name": "mResult" }, { "declarator": "mError", "modifier": "private final", "original_string": "private final Throwable mErr...
{ "body": "@NonNull\n public static <T> RxResult<T> onNext(@Nullable T result) {\n return new RxResult<>(result, null, false);\n }", "class_method_signature": "RxResult.onNext(@Nullable T result)", "constructor": false, "full_signature": "@NonNull public static RxResult<T> onNext(@Nullable T result...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_103
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/RxDecorTest.java", "identifier": "RxDecorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLoadingView() throws Exception {\n LoadingView loadingView = MockUtils.mockLoadingView();\n Observable.just(5)\n .compose(RxDecor.loading(loadingView))\n .subscribe(new StubAction<>());\n\n Mockito.verify(loadingView).showLoading...
{ "fields": [ { "declarator": "NETWORK_EXCEPTIONS = Arrays.asList(\n UnknownHostException.class,\n SocketTimeoutException.class\n )", "modifier": "private static final", "original_string": "private static final List<Class<?>> NETWORK_EXCEPTIONS = Arrays.asList(\n ...
{ "body": "@NonNull\n public static <T> Observable.Transformer<T, T> loading(@NonNull LoadingView view) {\n return observable -> observable\n .doOnSubscribe(view::showLoadingIndicator)\n .doOnTerminate(view::hideLoadingIndicator);\n }", "class_method_signature": "RxDecor.l...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_58
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "@Test\n public void testInitEmpty() throws Exception {\n mPresenter.init(null);\n\n Mockito.verify(mView).hideAllElements();\n }", "class_method_signature": "TagsPresenterTest.testInitEmpty()", "constructor": false, "full_signature": "@Test public void testInitEmpty()", "identif...
{ "fields": [ { "declarator": "FOUND_TAGS_KEY = \"found_tags\"", "modifier": "private static final", "original_string": "private static final String FOUND_TAGS_KEY = \"found_tags\";", "type": "String", "var_name": "FOUND_TAGS_KEY" }, { "declarator": "FIRST_VISIBLE_ITEM_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n mView.setEmptyText(R.string.no_tags_found);\n\n if (savedInstanceState != null) {\n List<Tag> tags = savedInstanceState.getParcelableArrayList(FOUND_TAGS_KEY);\n tags = tags == null ? new ArrayList<>() : tags;\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_53
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private MainView mView;", "type": "MainView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private MainPresenter mPresenter;"...
{ "body": "@Test\n public void testOpenProfile() throws Exception {\n mPresenter.onProfileSelected();\n Mockito.verify(mView).openProfile(any(User.class));\n }", "class_method_signature": "MainPresenterTest.testOpenProfile()", "constructor": false, "full_signature": "@Test public void testOp...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void onProfileSelected() {\n mView.openProfile(mCurrentUser);\n }", "class_method_signature": "MainPresenter.onProfileSelected()", "constructor": false, "full_signature": "public void onProfileSelected()", "identifier": "onProfileSelected", "invocations": [ "openProfile" ],...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_108
{ "fields": [ { "declarator": "mRxLoader", "modifier": "private", "original_string": "private RxLoader<Integer> mRxLoader;", "type": "RxLoader<Integer>", "var_name": "mRxLoader" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/rxloade...
{ "body": "@Test\n public void testInit() throws Exception {\n mRxLoader.init(integer -> {\n assertEquals(1, integer.intValue());\n });\n }", "class_method_signature": "RxLoaderTest.testInit()", "constructor": false, "full_signature": "@Test public void testInit()", "identifier"...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLmRef", "modifier": "private final", "original_string": "private final...
{ "body": "public void init() {\n init(Observers.<T>empty());\n }", "class_method_signature": "RxLoader.init()", "constructor": false, "full_signature": "public void init()", "identifier": "init", "invocations": [ "init", "empty" ], "modifiers": "public", "parameters": "()", "retur...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_12
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testEmptyLogin() throws Exception {\n mPreferences.edit().clear().apply();\n\n mPresenter.tryLogIn(\"\", \"password\");\n verify(mView).showLoginError();\n }", "class_method_signature": "LogInPresenterTest.testEmptyLogin()", "constructor": false, "full_s...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void tryLogIn(@NonNull String login, @NonNull String password) {\n if (TextUtils.isEmpty(login)) {\n mView.showLoginError();\n } else if (TextUtils.isEmpty(password)) {\n mView.showPasswordError();\n } else {\n String authorizationString = Author...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_45
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testQuestionShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ContentRepository());\n mPresenter.init(null);\n\n Mockito.verify(mView).showQuestion(any(Question.class));\n Mockito.verify(mView).showAnswers(anyListOf(Answer.class));\n ...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mContext", ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n\n int questionId = mQues...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_132
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDifferentSymbols() throws Exception {\n String first = \"arozaupalanalapuazora\";\n String second = \"urozaupalanalapuazoru\";\n boolean equals = TextUtils.equals(first, second);\n assertFalse(equals);\n }", "class_method_signature": "TextUtilsTes...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_86
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/AnswerResponseTest.java", "identifier": "AnswerResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAnswersNotNull() throws Exception {\n AnswerResponse answerResponse = new AnswerResponse();\n assertNotNull(answerResponse.getAnswers());\n }", "class_method_signature": "AnswerResponseTest.testAnswersNotNull()", "constructor": false, "full_signature": "@Te...
{ "fields": [ { "declarator": "mAnswers", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Answer> mAnswers;", "type": "List<Answer>", "var_name": "mAnswers" } ], "file": "StackExchangeClient/app/src/main/...
{ "body": "@NonNull\n public List<Answer> getAnswers() {\n if (mAnswers == null) {\n mAnswers = new ArrayList<>();\n }\n return mAnswers;\n }", "class_method_signature": "AnswerResponse.getAnswers()", "constructor": false, "full_signature": "@NonNull public List<Answer> get...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_69
{ "fields": [ { "declarator": "mAuthView", "modifier": "private", "original_string": "private AuthView mAuthView;", "type": "AuthView", "var_name": "mAuthView" }, { "declarator": "mKeyValueStorage", "modifier": "private", "original_string": "private TestKeyV...
{ "body": "@Test\n public void testOpenMainScreen() throws Exception {\n AuthPresenter presenter = new AuthPresenter(mAuthView);\n mKeyValueStorage.saveAccessToken(\"token\");\n mKeyValueStorage.saveWalkthroughPassed();\n\n presenter.init();\n Mockito.verify(mAuthView).showMainSc...
{ "fields": [ { "declarator": "OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&\" +\n \"scope=%s&redirect_uri=%s\"", "modifier": "private static final", "original_string": "private static final String OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&...
{ "body": "public void init() {\n RepositoryProvider.provideKeyValueStorage().getAccessToken()\n .map(TextUtils::isEmpty)\n .map(value -> !value)\n .subscribe(this::onAuth);\n }", "class_method_signature": "AuthPresenter.init()", "constructor": false, "full...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_90
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/TagResponseTest.java", "identifier": "TagResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTagsNotNull() throws Exception {\n TagResponse tagResponse = new TagResponse();\n assertNotNull(tagResponse.getTags());\n }", "class_method_signature": "TagResponseTest.testTagsNotNull()", "constructor": false, "full_signature": "@Test public void testTagsN...
{ "fields": [ { "declarator": "mTags", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Tag> mTags;", "type": "List<Tag>", "var_name": "mTags" } ], "file": "StackExchangeClient/app/src/main/java/ru/arturva...
{ "body": "@NonNull\n public List<Tag> getTags() {\n if (mTags == null) {\n mTags = new ArrayList<>();\n }\n return mTags;\n }", "class_method_signature": "TagResponse.getTags()", "constructor": false, "full_signature": "@NonNull public List<Tag> getTags()", "identifier":...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_124
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotEmptyString2() throws Exception {\n boolean empty = TextUtils.isEmpty(\"safgbgnsvskvbs;o;wl dcol ibsvos;cj,sp;csvbwfsl\");\n assertFalse(empty);\n }", "class_method_signature": "TextUtilsTest.testNotEmptyString2()", "constructor": false, "full_signature"...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_28
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" } ], "file": "GithubMVP/app/src/test/java/ru/itis/lecture...
{ "body": "@Test\n public void testConstructor() throws Exception {\n Interceptor interceptor = TokenInterceptor.getInstance(TEST_TOKEN);\n assertNotNull(interceptor);\n }", "class_method_signature": "TokenInterceptorTest.testConstructor()", "constructor": false, "full_signature": "@Test pub...
{ "fields": [ { "declarator": "mToken", "modifier": "private final", "original_string": "private final String mToken;", "type": "String", "var_name": "mToken" } ], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/api/TokenInterceptor.java", "identifier": "Tok...
{ "body": "@NonNull\n public static Interceptor getInstance(@NonNull String token) {\n return new TokenInterceptor(token);\n }", "class_method_signature": "TokenInterceptor.getInstance(@NonNull String token)", "constructor": false, "full_signature": "@NonNull public static Interceptor getInstance(@...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_104
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/RxDecorTest.java", "identifier": "RxDecorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNetworkError() throws Exception {\n ErrorView errorView = MockUtils.mockErrorView();\n Observable.error(new SocketTimeoutException())\n .subscribe(new StubAction<>(), RxDecor.error(errorView));\n\n Mockito.verify(errorView).showNetworkError();\...
{ "fields": [ { "declarator": "NETWORK_EXCEPTIONS = Arrays.asList(\n UnknownHostException.class,\n SocketTimeoutException.class\n )", "modifier": "private static final", "original_string": "private static final List<Class<?>> NETWORK_EXCEPTIONS = Arrays.asList(\n ...
{ "body": "@NonNull\n public static Action1<Throwable> error(@NonNull ErrorView view) {\n return e -> {\n if (e instanceof HttpException) {\n String message = ((HttpException) e).message();\n view.showErrorMessage(message);\n } else if (NETWORK_EXCEPTIONS....
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_49
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private MainView mView;", "type": "MainView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private MainPresenter mPresenter;"...
{ "body": "@Test\n public void testUserInfoShown() throws Exception {\n mPresenter.init();\n //2 - since we first load it from local db and then from network\n Mockito.verify(mView, times(2)).showUserImage(\"https://i.stack.imgur.com/EJNBv.jpg?s=512&g=1\");\n Mockito.verify(mView, times...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository().getCurrentUser()\n .subscribe(this::handleUser, new StubAction<>());\n\n RxLoader.create(mContext, mLm, R.id.user_info_loader_id,\n RepositoryProvider.provideRemoteRepository().getCurrentUser())\n...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_32
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEmptyString() throws Exception {\n assertTrue(TextUtils.isEmpty(\"\"));\n }", "class_method_signature": "TextUtilsTest.testEmptyString()", "constructor": false, "full_signature": "@Test public void testEmptyString()", "identifier": "testEmptyString", "invocati...
{ "fields": [], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUtils()", "iden...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_65
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testErrorShown() throws Exception {\n RepositoryProvider.setRemoteRepository(new ErrorRepository());\n mPresenter.init(null);\n\n Mockito.verify(mErrorView).showNetworkError();\n Mockito.verify(mView).showEmptyListView();\n }", "class_method_signature...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "QUESTION_LINK_...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n mView.setEmptyText(R.string.no_answers);\n\n RxLoader.create(mContext, mLm, R.id.answers_loader_id, Re...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_0
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testCheckWalkthroughWasShown() throws Exception {\n Settings.saveWalkthroughPassed(mContext);\n\n mPresenter.dispatchCreated();\n verify(mView).startLogInActivity();\n }", "class_method_signature": "WalkthroughPresenterTest.testCheckWalkthroughWasShown()", ...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "public void dispatchCreated() {\n if (Settings.isWalkthroughPassed(mContext)) {\n mView.startLogInActivity();\n }\n }", "class_method_signature": "WalkthroughPresenter.dispatchCreated()", "constructor": false, "full_signature": "public void dispatchCreated()", "identifie...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_73
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private QuestionsListView mView;", "type": "QuestionsListView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Question...
{ "body": "@Test\n public void testShowError() throws Exception {\n mPresenter.init();\n Mockito.verify(mView, times(2)).showEmptyListView();\n }", "class_method_signature": "QuestionsListPresenterTest.testShowError()", "constructor": false, "full_signature": "@Test public void testShowError...
{ "fields": [ { "declarator": "VISIBILITY_MARGIN = 10", "modifier": "private static final", "original_string": "private static final int VISIBILITY_MARGIN = 10;", "type": "int", "var_name": "VISIBILITY_MARGIN" }, { "declarator": "mContext", "modifier": "private fi...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository()\n .questions(mTag)\n .subscribe(this::handleQuestions, this::handleError);\n\n RxLoader.create(mContext, mLm, mTag.hashCode(),\n RepositoryProvider.provideRemoteRepository().questio...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_24
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/OkHttpTest.java", "identifier": "OkHttpTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInterceptorsCount() throws Exception {\n OkHttpClient client = OkHttp.client(\"aaa\");\n assertEquals(2, client.interceptors().size());\n }", "class_method_signature": "OkHttpTest.testInterceptorsCount()", "constructor": false, "full_signature": "@Test publ...
{ "fields": [ { "declarator": "CONNECT_TIMEOUT = 15", "modifier": "private static final", "original_string": "private static final int CONNECT_TIMEOUT = 15;", "type": "int", "var_name": "CONNECT_TIMEOUT" }, { "declarator": "READ_TIMEOUT = 30", "modifier": "private...
{ "body": "@NonNull\n public static OkHttpClient client(@NonNull String token) {\n OkHttpClient client = sClient;\n if (client == null) {\n synchronized (OkHttp.class) {\n client = sClient;\n if (client == null) {\n client = sClient = newCli...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_128
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEmptyStringsEquals() throws Exception {\n boolean equals = TextUtils.equals(\"\", \"\");\n assertTrue(equals);\n }", "class_method_signature": "TextUtilsTest.testEmptyStringsEquals()", "constructor": false, "full_signature": "@Test public void testEmptyStri...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_129
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFirstStringNull() throws Exception {\n String s = \"xyz\";\n boolean equals = TextUtils.equals(null, s);\n assertFalse(equals);\n }", "class_method_signature": "TextUtilsTest.testFirstStringNull()", "constructor": false, "full_signature": "@Test publ...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_25
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/OkHttpTest.java", "identifier": "OkHttpTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testClient() throws Exception {\n OkHttpClient client = OkHttp.client(\"aaa\");\n assertNotNull(client);\n }", "class_method_signature": "OkHttpTest.testClient()", "constructor": false, "full_signature": "@Test public void testClient()", "identifier": "testCl...
{ "fields": [ { "declarator": "CONNECT_TIMEOUT = 15", "modifier": "private static final", "original_string": "private static final int CONNECT_TIMEOUT = 15;", "type": "int", "var_name": "CONNECT_TIMEOUT" }, { "declarator": "READ_TIMEOUT = 30", "modifier": "private...
{ "body": "@NonNull\n public static OkHttpClient client(@NonNull String token) {\n OkHttpClient client = sClient;\n if (client == null) {\n synchronized (OkHttp.class) {\n client = sClient;\n if (client == null) {\n client = sClient = newCli...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_1
{ "fields": [ { "declarator": "mContext", "modifier": "private", "original_string": "private Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mView", "modifier": "private", "original_string": "private WalkthroughView mView;",...
{ "body": "@Test\n public void testCheckWalkthroughWasntShown() throws Exception {\n mPresenter.dispatchCreated();\n verifyNoMoreInteractions(mView);\n }", "class_method_signature": "WalkthroughPresenterTest.testCheckWalkthroughWasntShown()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [ { "declarator": "PAGES_COUNT = 3", "modifier": "private static final", "original_string": "private static final int PAGES_COUNT = 3;", "type": "int", "var_name": "PAGES_COUNT" }, { "declarator": "mContext", "modifier": "private final", "origina...
{ "body": "public void dispatchCreated() {\n if (Settings.isWalkthroughPassed(mContext)) {\n mView.startLogInActivity();\n }\n }", "class_method_signature": "WalkthroughPresenter.dispatchCreated()", "constructor": false, "full_signature": "public void dispatchCreated()", "identifie...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_72
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private QuestionsListView mView;", "type": "QuestionsListView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private Question...
{ "body": "@Test\n public void testRefresh() throws Exception {\n RepositoryProvider.setRemoteRepository(new ContentRemoteRepository());\n RepositoryProvider.setLocalRepository(new ContentLocalRepository());\n mPresenter.init();\n\n mPresenter.refresh();\n Mockito.verify(mView, t...
{ "fields": [ { "declarator": "VISIBILITY_MARGIN = 10", "modifier": "private static final", "original_string": "private static final int VISIBILITY_MARGIN = 10;", "type": "int", "var_name": "VISIBILITY_MARGIN" }, { "declarator": "mContext", "modifier": "private fi...
{ "body": "public void refresh() {\n RxLoader.create(mContext, mLm, mTag.hashCode(),\n RepositoryProvider.provideRemoteRepository().questions(mTag))\n .restart(questions -> {\n handleQuestions(questions);\n mView.hideRefresh();\n ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_64
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testOnItemClick() throws Exception {\n RepositoryProvider.setRemoteRepository(new ContentRepository());\n mPresenter.init(null);\n Answer answer = new Answer();\n answer.setQuestionId(111);\n answer.setAnswerId(222);\n mPresenter.onItemClick(...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "QUESTION_LINK_...
{ "body": "public void onItemClick(@NonNull Answer answer) {\n String url = String.format(Locale.getDefault(), QUESTION_LINK_FORMAT,\n answer.getQuestionId(), answer.getAnswerId());\n mView.browseUrl(url);\n }", "class_method_signature": "AnswersListPresenter.onItemClick(@NonNull Ans...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_33
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotEmptyString() throws Exception {\n assertFalse(TextUtils.isEmpty(\"not_empty_string\"));\n }", "class_method_signature": "TextUtilsTest.testNotEmptyString()", "constructor": false, "full_signature": "@Test public void testNotEmptyString()", "identifier": "tes...
{ "fields": [], "file": "GithubMVP/app/src/main/java/ru/itis/lectures/githubmvp/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUtils()", "iden...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_48
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testQuestionShownEvenWithError() throws Exception {\n mPresenter.init(null);\n Mockito.verify(mView).showQuestion(any(Question.class));\n Mockito.verify(mView, never()).showAnswers(anyListOf(Answer.class));\n }", "class_method_signature": "QuestionPresenterT...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mContext", ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n\n int questionId = mQues...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_105
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/RxDecorTest.java", "identifier": "RxDecorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUnexpectedError() throws Exception {\n ErrorView errorView = MockUtils.mockErrorView();\n Observable.error(new Exception())\n .subscribe(new StubAction<>(), RxDecor.error(errorView));\n\n Mockito.verify(errorView).showUnexpectedError();\n }"...
{ "fields": [ { "declarator": "NETWORK_EXCEPTIONS = Arrays.asList(\n UnknownHostException.class,\n SocketTimeoutException.class\n )", "modifier": "private static final", "original_string": "private static final List<Class<?>> NETWORK_EXCEPTIONS = Arrays.asList(\n ...
{ "body": "@NonNull\n public static Action1<Throwable> error(@NonNull ErrorView view) {\n return e -> {\n if (e instanceof HttpException) {\n String message = ((HttpException) e).message();\n view.showErrorMessage(message);\n } else if (NETWORK_EXCEPTIONS....
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_29
{ "fields": [], "file": "GithubMVP/app/src/test/java/ru/itis/lectures/githubmvp/api/DefaultApiProviderTest.java", "identifier": "DefaultApiProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToken() throws Exception {\n ApiProvider provider = new DefaultApiProvider(\"bbb\");\n assertEquals(\"bbb\", provider.provideToken());\n }", "class_method_signature": "DefaultApiProviderTest.testToken()", "constructor": false, "full_signature": "@Test publi...
{ "fields": [ { "declarator": "mToken", "modifier": "private final", "original_string": "private final String mToken;", "type": "String", "var_name": "mToken" }, { "declarator": "mService", "modifier": "private final", "original_string": "private final Githu...
{ "body": "@NonNull\n @Override\n public String provideToken() {\n return mToken;\n }", "class_method_signature": "DefaultApiProvider.provideToken()", "constructor": false, "full_signature": "@NonNull @Override public String provideToken()", "identifier": "provideToken", "invocations": [], ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_125
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNotEmptyString3() throws Exception {\n boolean empty = TextUtils.isEmpty(\";hvsj'c,;hmvsj,k..ca'j;dglvsbnqufrypnny79o\" +\n \"'pacha,a,ck'.vfpvvs'fvj,fwgw,evs'vsv.s'[.s.s]AOZ*^906jakz,-[Kk00-K-9-00\" +\n \"zax.axa/[xxa]\");\n assertFals...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean isEmpty(@Nullable CharSequence text) {\n return text == null || text.length() == 0;\n }", "class_method_signature": "TextUtils.isEmpty(@Nullable CharSequence text)", "constructor": false, "full_signature": "public static boolean isEmpty(@Nullable CharSequence text)", ...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_91
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/TagResponseTest.java", "identifier": "TagResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetTags() throws Exception {\n TagResponse tagResponse = new TagResponse();\n List<Tag> tags = new ArrayList<>();\n tags.add(new Tag(\"c#\", false));\n tagResponse.setTags(tags);\n assertTrue(tags == tagResponse.getTags());\n }", "class_met...
{ "fields": [ { "declarator": "mTags", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Tag> mTags;", "type": "List<Tag>", "var_name": "mTags" } ], "file": "StackExchangeClient/app/src/main/java/ru/arturva...
{ "body": "public void setTags(@NonNull List<Tag> tags) {\n mTags = tags;\n }", "class_method_signature": "TagResponse.setTags(@NonNull List<Tag> tags)", "constructor": false, "full_signature": "public void setTags(@NonNull List<Tag> tags)", "identifier": "setTags", "invocations": [], "modifiers...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_87
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/model/response/AnswerResponseTest.java", "identifier": "AnswerResponseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSetAnswers() throws Exception {\n AnswerResponse answerResponse = new AnswerResponse();\n List<Answer> answers = new ArrayList<>();\n answers.add(new Answer());\n answerResponse.setAnswers(answers);\n assertTrue(answers == answerResponse.getAnsw...
{ "fields": [ { "declarator": "mAnswers", "modifier": "@SerializedName(\"items\")\n private", "original_string": "@SerializedName(\"items\")\n private List<Answer> mAnswers;", "type": "List<Answer>", "var_name": "mAnswers" } ], "file": "StackExchangeClient/app/src/main/...
{ "body": "public void setAnswers(@NonNull List<Answer> answers) {\n mAnswers = answers;\n }", "class_method_signature": "AnswerResponse.setAnswers(@NonNull List<Answer> answers)", "constructor": false, "full_signature": "public void setAnswers(@NonNull List<Answer> answers)", "identifier": "setAnsw...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_68
{ "fields": [ { "declarator": "mAuthView", "modifier": "private", "original_string": "private AuthView mAuthView;", "type": "AuthView", "var_name": "mAuthView" }, { "declarator": "mKeyValueStorage", "modifier": "private", "original_string": "private TestKeyV...
{ "body": "@Test\n public void testOpenWalkthrough() throws Exception {\n AuthPresenter presenter = new AuthPresenter(mAuthView);\n mKeyValueStorage.saveAccessToken(\"token\");\n\n presenter.init();\n Mockito.verify(mAuthView).showWalkthrough();\n Mockito.verify(mAuthView).close(...
{ "fields": [ { "declarator": "OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&\" +\n \"scope=%s&redirect_uri=%s\"", "modifier": "private static final", "original_string": "private static final String OUATH_URL = \"https://stackexchange.com/oauth/dialog?client_id=%s&...
{ "body": "public void init() {\n RepositoryProvider.provideKeyValueStorage().getAccessToken()\n .map(TextUtils::isEmpty)\n .map(value -> !value)\n .subscribe(this::onAuth);\n }", "class_method_signature": "AuthPresenter.init()", "constructor": false, "full...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_133
{ "fields": [], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/utils/TextUtilsTest.java", "identifier": "TextUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testEqualsStrings() throws Exception {\n String first = \"Ab0ocam\";\n String second = \"Ab0ocam\";\n boolean equals = TextUtils.equals(first, second);\n assertTrue(equals);\n }", "class_method_signature": "TextUtilsTest.testEqualsStrings()", "const...
{ "fields": [], "file": "StackExchangeClient/app/src/main/java/ru/arturvasilov/stackexchangeclient/utils/TextUtils.java", "identifier": "TextUtils", "interfaces": "", "methods": [ { "class_method_signature": "TextUtils.TextUtils()", "constructor": true, "full_signature": "private TextUt...
{ "body": "public static boolean equals(@Nullable CharSequence a, @Nullable CharSequence b) {\n if (a == b) {\n return true;\n }\n\n int length;\n if (a != null && b != null && (length = a.length()) == b.length()) {\n if (a instanceof String && b instanceof String) {\...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_44
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mView", ...
{ "body": "@Test\n public void testLoadingProgressShown() throws Exception {\n mPresenter.init(null);\n\n Mockito.verify(mLoadingView).showLoadingIndicator();\n Mockito.verify(mLoadingView).hideLoadingIndicator();\n }", "class_method_signature": "QuestionPresenterTest.testLoadingProgressS...
{ "fields": [ { "declarator": "ERROR_SHOWN_KEY = \"error_shown\"", "modifier": "private static final", "original_string": "private static final String ERROR_SHOWN_KEY = \"error_shown\";", "type": "String", "var_name": "ERROR_SHOWN_KEY" }, { "declarator": "mContext", ...
{ "body": "public void init(@Nullable Bundle savedInstanceState) {\n if (savedInstanceState != null) {\n mIsErrorShown = savedInstanceState.getBoolean(ERROR_SHOWN_KEY);\n }\n\n RemoteRepository repository = RepositoryProvider.provideRemoteRepository();\n\n int questionId = mQues...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_13
{ "fields": [ { "declarator": "TEST_TOKEN = \"test_token\"", "modifier": "private static final", "original_string": "private static final String TEST_TOKEN = \"test_token\";", "type": "String", "var_name": "TEST_TOKEN" }, { "declarator": "mPreferences", "modifier"...
{ "body": "@Test\n public void testEmptyPassword() throws Exception {\n mPreferences.edit().clear().apply();\n\n mPresenter.tryLogIn(\"login\", \"\");\n verify(mView).showPasswordError();\n }", "class_method_signature": "LogInPresenterTest.testEmptyPassword()", "constructor": false, "...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void tryLogIn(@NonNull String login, @NonNull String password) {\n if (TextUtils.isEmpty(login)) {\n mView.showLoginError();\n } else if (TextUtils.isEmpty(password)) {\n mView.showPasswordError();\n } else {\n String authorizationString = Author...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_109
{ "fields": [ { "declarator": "mRxLoader", "modifier": "private", "original_string": "private RxLoader<Integer> mRxLoader;", "type": "RxLoader<Integer>", "var_name": "mRxLoader" } ], "file": "StackExchangeClient/app/src/test/java/ru/arturvasilov/stackexchangeclient/rx/rxloade...
{ "body": "@Test\n public void testInitOnComplete() throws Exception {\n Action0 onComplete = Mockito.mock(Action0.class);\n mRxLoader.init(new StubAction<>(), new StubAction<>(), onComplete);\n Mockito.verify(onComplete).call();\n }", "class_method_signature": "RxLoaderTest.testInitOnCom...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLmRef", "modifier": "private final", "original_string": "private final...
{ "body": "public void init() {\n init(Observers.<T>empty());\n }", "class_method_signature": "RxLoader.init()", "constructor": false, "full_signature": "public void init()", "identifier": "init", "invocations": [ "init", "empty" ], "modifiers": "public", "parameters": "()", "retur...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
62553999_52
{ "fields": [ { "declarator": "mView", "modifier": "private", "original_string": "private MainView mView;", "type": "MainView", "var_name": "mView" }, { "declarator": "mPresenter", "modifier": "private", "original_string": "private MainPresenter mPresenter;"...
{ "body": "@Test\n public void testNoTabs() throws Exception {\n mPresenter.init();\n Mockito.verify(mView).addTab(\"All\");\n Mockito.verify(mView).hideTabLayout();\n }", "class_method_signature": "MainPresenterTest.testNoTabs()", "constructor": false, "full_signature": "@Test public...
{ "fields": [ { "declarator": "mContext", "modifier": "private final", "original_string": "private final Context mContext;", "type": "Context", "var_name": "mContext" }, { "declarator": "mLm", "modifier": "private final", "original_string": "private final Lo...
{ "body": "public void init() {\n RepositoryProvider.provideLocalRepository().getCurrentUser()\n .subscribe(this::handleUser, new StubAction<>());\n\n RxLoader.create(mContext, mLm, R.id.user_info_loader_id,\n RepositoryProvider.provideRemoteRepository().getCurrentUser())\n...
{ "created": null, "fork": null, "fork_count": 3, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 62553999, "size": 2058, "stargazer_count": 16, "stars": null, "updates": null, "url": "https://github.com/ArturVasilov/AndroidArchitecture" }
12134164_84
{ "fields": [], "file": "library/src/test/java/com/getbase/android/db/loaders/LazyCursorListTest.java", "identifier": "LazyCursorListTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void shouldAccessProperRow() throws Exception {\n final MatrixCursor cursor = new MatrixCursor(new String[] { \"name\" });\n for (int i = 0; i < 10; i++) {\n cursor.addRow(new Object[] { \"Name\" + i });\n }\n final LazyCursorList<String> list = new LazyCursorList<String>(c...
{ "fields": [ { "declarator": "cursor", "modifier": "private final", "original_string": "private final Cursor cursor;", "type": "Cursor", "var_name": "cursor" }, { "declarator": "cache", "modifier": "private final", "original_string": "private final LruCache...
{ "body": "@Override\n public T get(int i) {\n return cache.get(i);\n }", "class_method_signature": "LazyCursorList.get(int i)", "constructor": false, "full_signature": "@Override public T get(int i)", "identifier": "get", "invocations": [ "get" ], "modifiers": "@Override public", "parameters...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_51
{ "fields": [ { "declarator": "mDb", "modifier": "@Mock\n private", "original_string": "@Mock\n private SQLiteDatabase mDb;", "type": "SQLiteDatabase", "var_name": "mDb" }, { "declarator": "mStatement", "modifier": "@Mock\n private", "original_string": "@...
{ "body": "@Test\n public void shouldUseTableSpecifiedInIntoStepInInsertForDefaultValues() throws Exception {\n DefaultValuesInsert insert = insert().into(\"A\").defaultValues(\"nullable_col\");\n\n assertThat(insert.mTable).isEqualTo(\"A\");\n }", "class_method_signature": "InsertTest.shouldUseTableSpecifi...
{ "fields": [ { "declarator": "mTable", "modifier": "final", "original_string": "final String mTable;", "type": "String", "var_name": "mTable" }, { "declarator": "mValues", "modifier": "final", "original_string": "final ContentValues mValues;", "type":...
{ "body": "private Insert(String table, ContentValues values) {\n mTable = table;\n mValues = values;\n }", "class_method_signature": "Insert.Insert(String table, ContentValues values)", "constructor": true, "full_signature": "private Insert(String table, ContentValues values)", "identifier": "Insert"...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_10
{ "fields": [ { "declarator": "TEST_COLUMN = \"test_column\"", "modifier": "private static final", "original_string": "private static final String TEST_COLUMN = \"test_column\";", "type": "String", "var_name": "TEST_COLUMN" }, { "declarator": "OTHER_COLUMN = \"other_col...
{ "body": "@Test\n public void shouldAlwaysCloseCursorAfterCallingToMultimap() throws Exception {\n final FluentCursor fluentCursor = new FluentCursor(buildMatrixCursor(10));\n\n try {\n fluentCursor.toMultimap(KABOOM, KABOOM);\n } catch (Throwable t) {\n // ignore\n }\n\n assertThat(fluentC...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java", "identifier": "FluentCursor", "interfaces": "", "methods": [ { "class_method_signature": "FluentCursor.FluentCursor(Cursor cursor)", "constructor": true, "full_signature": "public FluentCur...
{ "body": "public <TKey, TValue> LinkedHashMultimap<TKey, TValue> toMultimap(Function<? super Cursor, TKey> keyTransform, Function<? super Cursor, TValue> valueTransform) {\n try {\n LinkedHashMultimap<TKey, TValue> result = LinkedHashMultimap.create(getCount(), 1);\n\n for (moveToFirst(); !isAfterLast()...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_6
{ "fields": [ { "declarator": "TEST_COLUMN = \"test_column\"", "modifier": "private static final", "original_string": "private static final String TEST_COLUMN = \"test_column\";", "type": "String", "var_name": "TEST_COLUMN" }, { "declarator": "OTHER_COLUMN = \"other_col...
{ "body": "@Test\n public void shouldAlwaysCloseCursorAfterCallingToFluentIterable() throws Exception {\n final FluentCursor fluentCursor = new FluentCursor(buildMatrixCursor(10));\n\n try {\n fluentCursor.toFluentIterable(KABOOM);\n } catch (Throwable t) {\n // ignore\n }\n\n assertThat(flu...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java", "identifier": "FluentCursor", "interfaces": "", "methods": [ { "class_method_signature": "FluentCursor.FluentCursor(Cursor cursor)", "constructor": true, "full_signature": "public FluentCur...
{ "body": "public <T> FluentIterable<T> toFluentIterable(Function<? super Cursor, T> singleRowTransform) {\n try {\n return Cursors.toFluentIterable(this, singleRowTransform);\n } finally {\n close();\n }\n }", "class_method_signature": "FluentCursor.toFluentIterable(Function<? super Cursor, T> ...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_47
{ "fields": [ { "declarator": "cursorMock", "modifier": "@Mock\n private", "original_string": "@Mock\n private Cursor cursorMock;", "type": "Cursor", "var_name": "cursorMock" }, { "declarator": "COLUMN = \"column\"", "modifier": "private static", "original...
{ "body": "@Test\n public void shouldGetNullForExistingStringColumn() throws Exception {\n when(cursorMock.isNull(1)).thenReturn(true);\n\n assertThat(SingleRowTransforms.getColumn(COLUMN).asString().apply(cursorMock)).isNull();\n }", "class_method_signature": "SingleRowTransformsTest.shouldGetNullForExisti...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/SingleRowTransforms.java", "identifier": "SingleRowTransforms", "interfaces": "", "methods": [ { "class_method_signature": "SingleRowTransforms.SingleRowTransforms()", "constructor": true, "full_signature": "pr...
{ "body": "public static Builder getColumn(String columnName) {\n return new Builder(columnName);\n }", "class_method_signature": "SingleRowTransforms.getColumn(String columnName)", "constructor": false, "full_signature": "public static Builder getColumn(String columnName)", "identifier": "getColumn", "...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_30
{ "fields": [ { "declarator": "cursorMock", "modifier": "@Mock\n private", "original_string": "@Mock\n private Cursor cursorMock;", "type": "Cursor", "var_name": "cursorMock" }, { "declarator": "COLUMN = \"column\"", "modifier": "private static", "original...
{ "body": "@Test\n public void shouldCacheGetColumnIndexResult() throws Exception {\n Cursor c = mock(Cursor.class);\n\n Function<Cursor, Integer> transform = SingleRowTransforms.getColumn(COLUMN).asInteger();\n transform.apply(c);\n transform.apply(c);\n\n verify(c, times(1)).getColumnIndexOrThrow(an...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/SingleRowTransforms.java", "identifier": "SingleRowTransforms", "interfaces": "", "methods": [ { "class_method_signature": "SingleRowTransforms.SingleRowTransforms()", "constructor": true, "full_signature": "pr...
{ "body": "public static Builder getColumn(String columnName) {\n return new Builder(columnName);\n }", "class_method_signature": "SingleRowTransforms.getColumn(String columnName)", "constructor": false, "full_signature": "public static Builder getColumn(String columnName)", "identifier": "getColumn", "...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_67
{ "fields": [ { "declarator": "mDb", "modifier": "@Mock\n private", "original_string": "@Mock\n private SQLiteDatabase mDb;", "type": "SQLiteDatabase", "var_name": "mDb" } ], "file": "library/src/test/java/com/getbase/android/db/fluentsqlite/QueryTest.java", "identifier":...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void shouldRejectExpressionInOrderByWithUnboundArgsPlaceholders() throws Exception {\n select().orderBy(column(\"col2\").eq().arg());\n }", "class_method_signature": "QueryTest.shouldRejectExpressionInOrderByWithUnboundArgsPlaceholders()", ...
{ "fields": [ { "declarator": "mQueryBuilder", "modifier": "private final", "original_string": "private final QueryBuilderImpl mQueryBuilder;", "type": "QueryBuilderImpl", "var_name": "mQueryBuilder" }, { "declarator": "SURROUND_WITH_PARENS = new Function<String, String...
{ "body": "public static QueryBuilder select() {\n return new QueryBuilderImpl();\n }", "class_method_signature": "Query.select()", "constructor": false, "full_signature": "public static QueryBuilder select()", "identifier": "select", "invocations": [], "modifiers": "public static", "parameters": "(...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_71
{ "fields": [ { "declarator": "mStatement", "modifier": "@Mock\n private", "original_string": "@Mock\n private SQLiteStatement mStatement;", "type": "SQLiteStatement", "var_name": "mStatement" } ], "file": "library/src/test/java/com/getbase/android/db/provider/UtilsTest.jav...
{ "body": "@Test\n public void shouldBindIntegerArgs() throws Exception {\n Utils.bindContentValueArg(mStatement, 1, 42);\n verify(mStatement).bindLong(eq(1), eq(42L));\n }", "class_method_signature": "UtilsTest.shouldBindIntegerArgs()", "constructor": false, "full_signature": "@Test public void shouldB...
{ "fields": [ { "declarator": "DUMMY_URI_DECORATOR = new UriDecorator() {\n @Override\n public Uri decorate(Uri uri) {\n return uri;\n }\n }", "modifier": "public static final", "original_string": "public static final UriDecorator DUMMY_URI_DECORATOR = new UriDecorator() {\n @O...
{ "body": "public static void bindContentValueArg(SQLiteStatement statement, int index, Object value) {\n if (value == null) {\n statement.bindNull(index);\n } else if (value instanceof String) {\n statement.bindString(index, (String) value);\n } else if (value instanceof Byte) {\n statement.b...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_26
{ "fields": [ { "declarator": "TEST_COLUMN = \"test_column\"", "modifier": "private static final", "original_string": "private static final String TEST_COLUMN = \"test_column\";", "type": "String", "var_name": "TEST_COLUMN" }, { "declarator": "OTHER_COLUMN = \"other_col...
{ "body": "@Test\n public void shouldApplyGivenFunctionWhenTransformingCursorToOnlyElementWithDefaultValue() throws Exception {\n MatrixCursor cursor = buildMatrixCursor(1);\n\n Integer onlyElement = new FluentCursor(cursor).toOnlyElement(Functions.constant(1500), 2900);\n\n assertThat(onlyElement).isEqualT...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java", "identifier": "FluentCursor", "interfaces": "", "methods": [ { "class_method_signature": "FluentCursor.FluentCursor(Cursor cursor)", "constructor": true, "full_signature": "public FluentCur...
{ "body": "public <T> T toOnlyElement(Function<? super Cursor, T> singleRowTransform) {\n try {\n switch (getCount()) {\n case 0:\n throw new NoSuchElementException();\n case 1:\n moveToFirst();\n return singleRowTransform.apply(this);\n default:\n throw new IllegalA...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_27
{ "fields": [ { "declarator": "TEST_COLUMN = \"test_column\"", "modifier": "private static final", "original_string": "private static final String TEST_COLUMN = \"test_column\";", "type": "String", "var_name": "TEST_COLUMN" }, { "declarator": "OTHER_COLUMN = \"other_col...
{ "body": "@Test\n public void shouldNotIterateOverCursorWhenTransformingCursorToOnlyElement() throws Exception {\n Cursor cursor = spy(buildMatrixCursor(1));\n\n new FluentCursor(cursor).toOnlyElement(Functions.constant(null));\n\n verify(cursor, never()).moveToNext();\n verify(cursor, never()).moveToLa...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java", "identifier": "FluentCursor", "interfaces": "", "methods": [ { "class_method_signature": "FluentCursor.FluentCursor(Cursor cursor)", "constructor": true, "full_signature": "public FluentCur...
{ "body": "public <T> T toOnlyElement(Function<? super Cursor, T> singleRowTransform) {\n try {\n switch (getCount()) {\n case 0:\n throw new NoSuchElementException();\n case 1:\n moveToFirst();\n return singleRowTransform.apply(this);\n default:\n throw new IllegalA...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_70
{ "fields": [ { "declarator": "mStatement", "modifier": "@Mock\n private", "original_string": "@Mock\n private SQLiteStatement mStatement;", "type": "SQLiteStatement", "var_name": "mStatement" } ], "file": "library/src/test/java/com/getbase/android/db/provider/UtilsTest.jav...
{ "body": "@Test\n public void shouldBindShortArgs() throws Exception {\n Utils.bindContentValueArg(mStatement, 1, (short) 42);\n verify(mStatement).bindLong(eq(1), eq(42L));\n }", "class_method_signature": "UtilsTest.shouldBindShortArgs()", "constructor": false, "full_signature": "@Test public void sho...
{ "fields": [ { "declarator": "DUMMY_URI_DECORATOR = new UriDecorator() {\n @Override\n public Uri decorate(Uri uri) {\n return uri;\n }\n }", "modifier": "public static final", "original_string": "public static final UriDecorator DUMMY_URI_DECORATOR = new UriDecorator() {\n @O...
{ "body": "public static void bindContentValueArg(SQLiteStatement statement, int index, Object value) {\n if (value == null) {\n statement.bindNull(index);\n } else if (value instanceof String) {\n statement.bindString(index, (String) value);\n } else if (value instanceof Byte) {\n statement.b...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_66
{ "fields": [ { "declarator": "mDb", "modifier": "@Mock\n private", "original_string": "@Mock\n private SQLiteDatabase mDb;", "type": "SQLiteDatabase", "var_name": "mDb" } ], "file": "library/src/test/java/com/getbase/android/db/fluentsqlite/QueryTest.java", "identifier":...
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void shouldRejectExpressionInGroupByWithUnboundArgsPlaceholders() throws Exception {\n select().groupBy(column(\"col2\").eq().arg());\n }", "class_method_signature": "QueryTest.shouldRejectExpressionInGroupByWithUnboundArgsPlaceholders()", ...
{ "fields": [ { "declarator": "mQueryBuilder", "modifier": "private final", "original_string": "private final QueryBuilderImpl mQueryBuilder;", "type": "QueryBuilderImpl", "var_name": "mQueryBuilder" }, { "declarator": "SURROUND_WITH_PARENS = new Function<String, String...
{ "body": "public static QueryBuilder select() {\n return new QueryBuilderImpl();\n }", "class_method_signature": "Query.select()", "constructor": false, "full_signature": "public static QueryBuilder select()", "identifier": "select", "invocations": [], "modifiers": "public static", "parameters": "(...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_31
{ "fields": [ { "declarator": "cursorMock", "modifier": "@Mock\n private", "original_string": "@Mock\n private Cursor cursorMock;", "type": "Cursor", "var_name": "cursorMock" }, { "declarator": "COLUMN = \"column\"", "modifier": "private static", "original...
{ "body": "@Test\n public void shouldHandleGracefullyUsingWithMultipleCursors() throws Exception {\n Cursor c1 = mock(Cursor.class);\n when(c1.getColumnIndexOrThrow(COLUMN)).thenReturn(1);\n when(c1.isNull(1)).thenReturn(false);\n when(c1.getInt(1)).thenReturn(42);\n when(c1.isNull(2)).thenThrow(new I...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/SingleRowTransforms.java", "identifier": "SingleRowTransforms", "interfaces": "", "methods": [ { "class_method_signature": "SingleRowTransforms.SingleRowTransforms()", "constructor": true, "full_signature": "pr...
{ "body": "public static Builder getColumn(String columnName) {\n return new Builder(columnName);\n }", "class_method_signature": "SingleRowTransforms.getColumn(String columnName)", "constructor": false, "full_signature": "public static Builder getColumn(String columnName)", "identifier": "getColumn", "...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_46
{ "fields": [ { "declarator": "cursorMock", "modifier": "@Mock\n private", "original_string": "@Mock\n private Cursor cursorMock;", "type": "Cursor", "var_name": "cursorMock" }, { "declarator": "COLUMN = \"column\"", "modifier": "private static", "original...
{ "body": "@Test\n public void shouldGetStringForExistingColumn() throws Exception {\n when(cursorMock.isNull(1)).thenReturn(false);\n when(cursorMock.getString(1)).thenReturn(\"wat?\");\n\n assertThat(SingleRowTransforms.getColumn(COLUMN).asString().apply(cursorMock)).isEqualTo(\"wat?\");\n }", "class_m...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/SingleRowTransforms.java", "identifier": "SingleRowTransforms", "interfaces": "", "methods": [ { "class_method_signature": "SingleRowTransforms.SingleRowTransforms()", "constructor": true, "full_signature": "pr...
{ "body": "public static Builder getColumn(String columnName) {\n return new Builder(columnName);\n }", "class_method_signature": "SingleRowTransforms.getColumn(String columnName)", "constructor": false, "full_signature": "public static Builder getColumn(String columnName)", "identifier": "getColumn", "...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }
12134164_7
{ "fields": [ { "declarator": "TEST_COLUMN = \"test_column\"", "modifier": "private static final", "original_string": "private static final String TEST_COLUMN = \"test_column\";", "type": "String", "var_name": "TEST_COLUMN" }, { "declarator": "OTHER_COLUMN = \"other_col...
{ "body": "@Test\n public void shouldSuccessfullyTransformToMultimap() throws Exception {\n final MatrixCursor cursor = buildMatrixCursor(10);\n final FluentCursor fluentCursor = new FluentCursor(cursor);\n final LinkedHashMultimap<Integer, Long> transformed = fluentCursor.toMultimap(\n SingleRowTran...
{ "fields": [], "file": "library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java", "identifier": "FluentCursor", "interfaces": "", "methods": [ { "class_method_signature": "FluentCursor.FluentCursor(Cursor cursor)", "constructor": true, "full_signature": "public FluentCur...
{ "body": "public <TKey, TValue> LinkedHashMultimap<TKey, TValue> toMultimap(Function<? super Cursor, TKey> keyTransform, Function<? super Cursor, TValue> valueTransform) {\n try {\n LinkedHashMultimap<TKey, TValue> result = LinkedHashMultimap.create(getCount(), 1);\n\n for (moveToFirst(); !isAfterLast()...
{ "created": null, "fork": null, "fork_count": 27, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12134164, "size": 732, "stargazer_count": 228, "stars": null, "updates": null, "url": "https://github.com/zendesk/android-db-commons" }