-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Lifecycle method called twice when subclassing #562
Labels
Comments
@translatenix Thanks for the catch. Which jqwik version(s) have you tried? |
jqwik 1.8.4. |
Can confirm as bug. Workaround: Pull concrete classes outside of the abstract class' compilation scope: public abstract class ListTest {
private final List<String> list;
public ListTest(List<String> list) {
this.list = list;
}
@AfterProperty
public void afterProperty() {
System.out.println("afterProperty");
}
@Example
public void example() {
System.out.println("example");
}
}
class ArrayListTest extends ListTest {
public ArrayListTest() {
super(new ArrayList<>());
}
}
class LinkedListTest extends ListTest {
public LinkedListTest() {
super(new LinkedList<>());
}
} |
Fixed and released in 1.8.5-SNAPSHOT. @translatenix Please re-open if fix doesn't work for you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using a subclassing pattern to test multiple implementations/configurations of a class.
This pattern works well with JUnit. But with jqwik, the
@AfterProperty
method gets called twice. Debugging this, it looks like a reflection problem related to subclassing (two@AfterProperty
methods are found).The text was updated successfully, but these errors were encountered: