spoon icon indicating copy to clipboard operation
spoon copied to clipboard

Move or delete spoon testing package from src/main

Open MartinWitt opened this issue 1 year ago • 1 comments

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 avatar Jan 09 '24 09:01 MartinWitt

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.

MartinWitt avatar Jan 12 '24 13:01 MartinWitt