Skip to content

Move and port tests from EventBusTest to EventBus module#283

Open
greenrobot-team wants to merge 3 commits intogreenrobot:plain-javafrom
greenrobot-team:plain-java
Open

Move and port tests from EventBusTest to EventBus module#283
greenrobot-team wants to merge 3 commits intogreenrobot:plain-javafrom
greenrobot-team:plain-java

Conversation

@greenrobot-team
Copy link
Copy Markdown
Collaborator

This is the fix for #279:

  • 20% of the tests was simply moved from test to main project
  • 20% of the tests had to be partially rewritten, because there is no Handler/Looper on JVM (support for Android is preserved with conditional logic)
  • 10% of the tests are not ported, because they are relying too much on Android

50% of the tests are tests for EventBus with Subscriber Index: it makes sense to run them only with Annotation processing support. That is not yet supported in EventBus for JVM (and there is no plan for now). So these tests are remained in EventBusTest project.

The first two commits contain required changes to the core project.

@greenrobot-team
Copy link
Copy Markdown
Collaborator Author

There are no mirrored classes in EventBusTest project, like in essentials project. I found that it works fine without them: both Android Studio and gradle take classes from the main project and run them as they would be in EventBusTest project. Otherwise all the tests will run twice: one for original version and one for generated.
The only downside is it is not so strait-forward to run one specific test from main project on Android (you should perform manual configuration with setting up class name), but I think it is not so big issue, because now you can develop such tests on JVM and just run all available tests on Android once you are done.
What do you think?

Alex

@patton73
Copy link
Copy Markdown

I leave the comment here. It is not related to the tests but is related to the Logger.
The project as it is does not compile without android dependencies. You should use something like slf4j to inject the logger implementation from outside. Otherwise it will never compile with plain java.
Andrea.

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.

2 participants