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

Align before/after with class hierarchy #127

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

findepi
Copy link
Member

@findepi findepi commented Feb 12, 2024

Order @BeforeMethodWithContext according to class hierarchy: parent
class first; like in other test frameworks. This allows a subclass to
leverage parent class state.

Order @AfterMethodWithContext in a reversed order.

Remove "override" from `TestClassOverrideAdditionalAnnotatedMethod`
since there are no overrides involved.

Use different constants for testing overrides and for testing additional
methods.
Order `@BeforeMethodWithContext` according to class hierarchy: parent
class first; like in other test frameworks. This allows a subclass to
leverage parent class state.

Order `@AfterMethodWithContext` in a reversed order.
@findepi
Copy link
Member Author

findepi commented Feb 12, 2024

In Trino, this will allow child classes not to invoke io.trino.tests.product.deltalake.BaseTestDeltaLakeS3Storage#setUp explicitly.

@@ -61,7 +61,9 @@ class TestInitializationListenerTest
static final String BEFORE_METHOD = "beforeMethod"
static final String AFTER_METHOD = "afterMethod"
public static final String BEFORE_METHOD_OVERRIDE = "beforeMethodOverride"
public static final String BEFORE_METHOD_ADDITIONAL = "beforeMethodAdditional"
Copy link
Member

Choose a reason for hiding this comment

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

why are you keeping beforeMethodOverride? I think I do not follow

Copy link
Member Author

Choose a reason for hiding this comment

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

it's used in separate test case, with actual overrides

@findepi findepi merged commit a91cdb3 into trinodb:master Feb 12, 2024
2 checks passed
@findepi findepi deleted the findepi/in-order branch February 12, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants