AndHow! Java Configuration .
  • AndHow!
  • Live-Code Quickstart
  • Simple Usage Examples
  • User Guide
    • Key Concepts
    • AndHow Properties
    • Loaders & Load Order
    • Testing
    • AndHow Initialization
    • Configuring AndHow
    • Whitespace Handling
    • Integration and Exports
    • Changing the Load Order
    • Java9 and Above
    • Best Practices
  • Developer Guide
    • How to Contribute
    • First Checkout with Git
    • Project Branching Structure
    • New Workstation Setup
    • Background
    • Framework Testing
    • Conventions
    • Release Plan
    • HowTo Release
    • Troubleshooting
    • References
  • Help / Questions
  • Release Notes
    • Release 0.4.2
  • FAQs
  • Other
    • JUnit Extension Registration
Powered by GitBook
On this page

Was this helpful?

  1. Developer Guide

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.

PreviousBackgroundNextConventions

Last updated 3 years ago

Was this helpful?