M
markspace
I'd like to get a bit more info from a class I'm unit testing. So I
added a testMode method:
public class AppletBootstrap extends JApplet
{
// Init logger
private static final Logger logger = Logger.getLogger(
AppletBootstrap.class.getName() );
static void testMode() {
ConsoleHandler h = new ConsoleHandler();
h.setLevel( Level.ALL );
logger.addHandler( h );
logger.setLevel( Level.ALL );
}
...
}
Overall this feels like code smell to me, putting a class into "test
mode" when exercising it. I think this particular use is benign, but I
thought I'd ask the floor what it thinks (that's you guys and gals).
added a testMode method:
public class AppletBootstrap extends JApplet
{
// Init logger
private static final Logger logger = Logger.getLogger(
AppletBootstrap.class.getName() );
static void testMode() {
ConsoleHandler h = new ConsoleHandler();
h.setLevel( Level.ALL );
logger.addHandler( h );
logger.setLevel( Level.ALL );
}
...
}
Overall this feels like code smell to me, putting a class into "test
mode" when exercising it. I think this particular use is benign, but I
thought I'd ask the floor what it thinks (that's you guys and gals).