Thanks for filing this, Junping Du.
- I'm not favor of assertTrue(Level.ERROR.equals(log.getEffectiveLevel()));. IMHO assertEquals("some case specific error message", Level.ERROR, log.getEffectiveLevel()); seems better.
- My minor concern is that, in case of invalid argument, the error message should better include the original user-provided level. Or else, if the user provides inffo, and we report error message saying Bad level : INFFO. The user may be confused as she's pretty sure she did not input any uppercase char.
- That said, org.apache.log4j.Level.toLevel() accepts mixing upper/lower-case string. We can simply replace the level.equals() with level.equalsIgnoreCase(). Changing the input to uppercase should work just work fine. java.util.logging.Logger seems different.
+1 (non-binding) after the comments above are considered/addressed.