2 Replies Latest reply on Jul 10, 2007 5:55 AM by mustaghattack

    Mocking @Logger

    mustaghattack

      I would like to unit test a Seam SFSB which uses an injected logger.
      I didn't find any MockLog so I use the logging factory like that :

      setField( editor, "log", Logging.getLog( "test" ) );

      It solves the NullPointerException and the test are working fine but when logging, the Interpolator try to access the context which doesnt exist and throws an IllegalStateException ...
      It may be useful to have a mockLog method in the SeamTest class which look for a @Logger annotation and inject a MockLog. The MockLog will basically print any log on the console.
      What do you think ?