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

@BeforeTest / @AfterTest in parent classes #215

Open
electrum opened this issue Mar 30, 2017 · 4 comments
Open

@BeforeTest / @AfterTest in parent classes #215

electrum opened this issue Mar 30, 2017 · 4 comments

Comments

@electrum
Copy link
Contributor

Are @BeforeTestWithContext / @AfterTestWithContext supposed to work in parent classes? The method TestInitializationListenerinvokeMethodsAnnotatedWith() uses getDeclaredMethods() which only finds methods on that exact class. Should it look for methods recursively in the super classes?

@kokosing
Copy link
Contributor

IMO it should wok. I mean it should check super class.

However, till now nobody got to this issue and we had really complicated use cases with usage of Teradata and Presto together. Have you considered to use composition over inheritance?

@electrum
Copy link
Contributor Author

electrum commented Mar 31, 2017 via email

@kokosing
Copy link
Contributor

I think it is always possible to use composition ; )

Do you mean: https://github.com/prestodb/presto/blob/f65d06fa2f9e38e3fc1d79445f56210ed4e126a5/presto-product-tests/src/main/java/com/facebook/presto/tests/jdbc/LdapTests.java ?

One of ideas is to write tempto Fulfiller (take a look at the example: https://github.com/prestodb/presto-yarn/blob/master/presto-yarn-test/src/main/java/com/teradata/presto/yarn/test/fulfillment/SliderClusterFulfiller.java this class provides Slider which is then injected into test here: https://github.com/prestodb/presto-yarn/blob/master/presto-yarn-test/src/main/java/com/teradata/presto/yarn/test/PrestoClusterTest.java).

Using that way, you could setup some entity in your brand new Fulfiller with the usage of injected fields, and that entity could be used in your LDAP test and some other.

How does it sound to you?

@electrum
Copy link
Contributor Author

Thanks for the tip! I didn't know this existed. It looks like it can work here, too.

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

No branches or pull requests

2 participants