Framework Testing

This page is for developers who are working on AndHow and need to write tests for AndHow itself. If you are writing tests for an application using AndHow, see the User Guild Testing section.

  • AndHow ties into the Java compiler as an annotation processor so testing requires running the javac compiler and verifying compilation results in some places.

  • At runtime, the main AndHow class is an immutable singleton, however, for good testing we want to put that immutable singleton into lots of different states to ensure it works correctly - Those two things cannot both (easily) be true

  • Never hold a reference to the AndHow singleton object in a way that survives beyond a single test (This would be the object returned from AndHow.instance() ) or the even more hidden AndHowCore (referenced inside the AndHow class). The AndHow testing framework 'cheats' and actually destroys the AndHow and AndHowCore singleton instances, allowing it to be recreated. Thus, any reference to an AndHow instance held by test code has the potential to be pointing to an old instance left from a previous test.

Last updated