android-training-2017
android-training-2017 copied to clipboard
HW #2
https://github.com/VasiliZ/WheelsRocket Please check tests. I correctly understood the idea of unit tests?
AuthService authorize you are completely wrong use asynctask. Please read about it if you would like use it in homework
AuthServiceTest nothing checked
It's good that you know about aar, but I can't review all your code because of that. in UserAuthPresenterTest you mock and spy UserAuthPresenter and just call methods. So as result you check nothing
I don't see that you try to use robolectric
any updates?
@ilya-shknaj Sorry, i have a problem with tests. Method that triggers the progress bar, falls from NullPointer. I did not decide how to defeat him. https://github.com/VasiliZ/RocketWheels/compare/c8d673509778bab5446a1d41a0bfe720a9905c14...808222e1c9747c8462c0835b7a3d42667f75ff33 Refactor AsynkTask, add Robolectric test for activity, add some test. Can you help me with methods call to progress bar? In this case, why the whole problem.
@VasiliZ I can't compile your project and tests because of you don't commit all important files.
Error:Execution failed for task ':app:processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it. Searched Location: /Users/ilya_shknai/workspace_android/training/RocketWheels/app/src/debug/google-services.json /Users/ilya_shknai/workspace_android/training/RocketWheels/app/google-services.json
gitignore not contain filter for *.iml files
@ilya-shknaj Can you check again? https://github.com/VasiliZ/RocketWheels/compare/808222e1c9747c8462c0835b7a3d42667f75ff33...dev
@VasiliZ project not compiling Information:Gradle tasks [:app:assembleDebug] /Users/ilya_shknai/workspace_android/training/RocketWheels/app/src/main/java/com/github/vasiliz/rocketswheel/backend/BackendSample.java Error:(29, 36) error: cannot find symbol class User /Users/ilya_shknai/workspace_android/training/RocketWheels/app/src/main/java/com/github/vasiliz/rocketswheel/userAuth/view/WebForLoginActivity.java Error:(35, 32) error: cannot find symbol variable web_view_for_login Error:(42, 37) error: cannot find symbol variable wv_for_login Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
@ilya-shknaj Sorry, should work
if you completely remove your project, fetch it from git and run, it still compiling ?
@ilya-shknaj, I clone remote project to new folder with soursethree, build and run on emulator. I did't have errors.
after commit https://github.com/VasiliZ/RocketWheels/commit/cba5079c535543449cea03c2e7421a2e526ad147 project compiling.
What question?
LoginActivityTest not compiling because set_login_view not exists I don't catch NullPointer in application. Please attach crash log and steps how to reproduce it. If it happend in tests, please give me test class name
@ilya-shknaj
If uncomment line #31 in WebViewPresenter and run TestWebViewPresenter again. I can see in log this exeption
java.lang.NullPointerException at com.github.vasiliz.rocketswheel.userAuth.presenter.WebViewPresenter.parseUrl(WebViewPresenter.java:31) at com.github.vasiliz.rocketswheel.TestWebViewPresenter.testParseUrl(TestWebViewPresenter.java:35)
NullPointer mean that object is null and you try to do something with it. In your case call showProgress.
In your case you should set mocked 'WebClientView' into 'WebViewPresenter', but if you do it, you will have java.lang.ClassCastException: com.github.vasiliz.rocketswheel.userAuth.view.WebClientView$MockitoMock$946116891 cannot be cast to com.github.vasiliz.rocketswheel.userAuth.view.WebForLoginActivity exception
It happen because in 'attachView' method you have 'WebClientView' param and cast it to 'WebForLoginActivity' what is wrong, and thats why test will fail.
Solution WebClientView should have 'showProgress' method
@ilya-shknaj, Could you recheck? This correct way? https://github.com/VasiliZ/RocketWheels/compare/06281797a508efca23741e9865f76a5e719d0249...dev