You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cases where you create transient database objects in test cases, you want to make sure that the are dropped after the test case.
The cleanest way to get rid of test-case-specific objects would be to initialize them in a try-with-resources and let Java clean them up. This also works if the test fails.
Acceptance Criteria
Database objects that support drop() also implement AutoClosable
The text was updated successfully, but these errors were encountered:
After prototyping this idea, it turns out, it has the side effect of requiring users to use close() in cases where they don't use try-with-resources. This would make it necessary to wrap drop() in close() instead of the other way round and that not only breaks the existing interface, it is also awkward to read in the code.
Situation
In cases where you create transient database objects in test cases, you want to make sure that the are dropped after the test case.
The cleanest way to get rid of test-case-specific objects would be to initialize them in a
try
-with-resources and let Java clean them up. This also works if the test fails.Acceptance Criteria
drop()
also implementAutoClosable
The text was updated successfully, but these errors were encountered: