I think this code is not really behaving as expected - constructor should not output and exit anyway. Workarounding it for testsuite is an option, but I'd really prefer to have separate methods for generating output and no exit statement used here (if necessary, it should be done in calling code).