3 Replies Latest reply on May 29, 2009 12:54 PM by Paul Keogh

    Null log inside EntityQuery while testing with TestNG

    Ivan B Novice


      How can one setup getLog() working with TestNG? I've got the problem that getLog() doesn't return the actual logger, and that breaks testing with NPE.

      Here is the component I'd like to test:

      public class RegionList extends EntityQuery<Region>
          public RegionList()
              setEjbql("select region from Region region");
          public List<Region> getResultList() {
              List<Region> regionList = super.getResultList();
              //## Here it breaks in testNG ##
              getLog().warn("Size is #0", regionList.size()); 
              return regionList;

      The test class for the component:

      public class RegionListTest extends SeamTest {
          public void testGetRegions() throws Exception {
              new ComponentTest() {
                  protected void testComponents() throws Exception {
                      RegionList regionList = new RegionList();
                      List<Region> resultList = regionList.getResultList();
                      for (Region region : resultList) {
                          System.out.println("region = " + region.getFullName());

      Any advice is appreciated,