Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional test with AndroidTestRule #84

Closed
wants to merge 4 commits into from

Conversation

MehdiChouag
Copy link

Replace activities testing by AndroidJUnit4 and AndroidTestRule

androidTestCompile presentationTestDependencies.espresso
androidTestCompile presentationTestDependencies.testingSupportLib
androidTestCompile (presentationTestDependencies.espresso) {
exclude group: 'com.android.support', module: 'support-annotations'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to exclude annotations here? Is this a transitive dependency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a conflict with dependencies, because of different versions of android support annotation. If I remove this line a I get this error :

Warning:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (21.0.3) and test app (23.0.1) differ.

@spirosoik
Copy link

@MehdiChouag you must also re-write mapper tests as currently they are using the old AndroidTestCase and with junit4 and AndroidJUnitRunner they won't work. In general seems OK 👍

@android10
Copy link
Owner

Closing due to inactivity. I'm planing to refactor the whole test suite.
@spirosoik thanks for reviewing it. 👏

@MehdiChouag I really appreciate your efforts and contribution, I'm gonna reuse part of your code such as AndroidTestRule. 👏 😄

@android10 android10 closed this Jan 31, 2016
@spirosoik
Copy link

@android10 yes must be completely different. We must split down the unit tests and the instrumentation tests in presentation layer according to junit4 and AndroidJUnitRunner .

@android10
Copy link
Owner

@spirosoik right. My next step is to refactor the project, so only one module exist. I need to re organize projects as well :). As usual, any ideas are welcome.

@spirosoik
Copy link

@android10 do you mean one module for every layer?

@android10
Copy link
Owner

@spirosoik it is not necessary to have 3 different modules for each layer as the current project has.
It is a work in progress and before merging I will create a discussion in order to get feedback.
Here it is: #103

@spirosoik
Copy link

@android10 why did you decide this, just I am wondering your thoughts :) ? My opinion, it's great the multiple module approach as it's easier the code navigation and minimises the scope in different independent modules.

@android10
Copy link
Owner

@spirosoik of course there is no final decision here, that is why I opened a PR, 😃 and I want most people to agree before moving parts on master 🔥

From my perspective, having everything in a single module favors classes scopes and package organization (the current approach obligate us to have many public classes that should not be public).

Also I don't see this organization into modules scaling so well since there is no package organization by feature, that is why I would like to get input on this.

@spirosoik
Copy link

@android10 the only problem with current implementation as you said is the API by the software's design perspective. If we go through Effective java for sure some rules are not applied here but I think these can be used in this case also. During our implementation we changed the visibility for a few things and we used eg. package-level especially in data module. We also have a core module with some stuff like Presenter, UIThread etc.

BTW based on your approach we are packaging by feature and it scales nicely until now and we have a lot of code.

But it's a good time to discuss your new approach :)

@android10
Copy link
Owner

@spirosoik glad to hear that. Let's keep it up in another discussion. Once I'm done with the PR, I will open one to get input and see whether or not it worth a try 😃
Thanks again buddy!

@spirosoik
Copy link

👍 I am fan of your great work. @android10 BTW are you open for a presentation here in Greece?

@android10
Copy link
Owner

@spirosoik Thank you! About a presentation, of course! Would love to and meet you guys in person! 😃

@spirosoik
Copy link

@android10 Great I will inform you soon for the details 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants