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

Move or delete spoon testing package from src/main #5605

Open
MartinWitt opened this issue Jan 9, 2024 · 1 comment
Open

Move or delete spoon testing package from src/main #5605

MartinWitt opened this issue Jan 9, 2024 · 1 comment
Labels
java17 Contains PRs for the java 17 switch

Comments

@MartinWitt
Copy link
Collaborator

Currently, we have assertions/testutils in src/main instead of src/test see https://github.com/INRIA/spoon/tree/master/src/main/java/spoon/testing. Given the java 17 release will be an already breaking major release, I propose to either remove or move these classes. A good replacement is either the default junit methods or we create our on SpoonAssertions extending AssertJ , see https://joel-costigliola.github.io/assertj/assertj-core-custom-assertions.html.

@MartinWitt MartinWitt added the java17 Contains PRs for the java 17 switch label Jan 9, 2024
@MartinWitt
Copy link
Collaborator Author

I had a brief look into extending AssertJ. Every custom Assertion class needs to extend AbstractAssert<$Classname, $CtElement>. But we don't want to repeat very basic assertions like CtElement#isImplicit. If we have multiple assertion classes like assertThat(CtElement) and assertThat(CtMethod) we need ugly casts to call the basic CtElement assertions. A possible solution is we use some code generation to copy the basic assertions to the more advanced methods. Almost like we do with our visitor codegen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java17 Contains PRs for the java 17 switch
Projects
None yet
Development

No branches or pull requests

1 participant