spoon
spoon copied to clipboard
Move or delete spoon testing package from src/main
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.
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.