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

Deprecate old lifecycle methods #63

Merged
merged 1 commit into from
Jun 23, 2019
Merged

Conversation

LMnet
Copy link
Contributor

@LMnet LMnet commented Jun 22, 2019

testcontainers-java reworked lifecycle of the containers a bit. This pull request is to support these changes.

  • New TestLifecycleAware trait introduced. It's a copy of java's interface, but with scala's Option type. Users of the library can use it when they want to do something with the container before or after the test. Personally, I'm against this feature at all, but I didn't convince the core java team that this feature is redundant. So, we have to support this. Also, I could just reuse java's interface, but I don't think that it's a good idea. Scala's hierarchy is completely separate from the java's, and it would be very unnatural for the scala users to work with the java's Optional.
  • Container now implements Startable java interface with start and stop methods.. I didn't copy this interface, because it's absolutely minimal and usable from the scala side.
  • ForEachTestContainer and ForAllTestContainer now uses new lifecycle methods.
  • They are also a bit improved internally. These improvements are based on my work on the new API, but not related to the new API directly:
    • I handled few multithreaded corner cases with volatile.
    • Improved test description for error messages.
    • ForAllTestContainer now supports afterTest/beforeTest.
  • SeleniumContainer now implements TestLifecycleAware.
  • MultipleContainers and LazyContainer are implements TestLifecycleAware too, because they could contain containers with TestLifecycleAware.
  • Old lifecycle code, like finished, succeeded, starting, failed methods, are marked as deprecated.
  • Tests are updated.
  • I bumped a version to 0.27.0-SNAPSHOT, because of deprecations.

@dimafeng
Copy link
Collaborator

@LMnet looks great! Thank you!

@dimafeng dimafeng merged commit 25baa0b into testcontainers:master Jun 23, 2019
@LMnet LMnet deleted the lifecycle branch June 26, 2019 04:43
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