6 Replies Latest reply on Mar 17, 2009 1:37 PM by Stan Silvert

    JSFUnit has very slow initialization

    Adrien Adrien Apprentice

      Hi

      The time to do jsfSession = new JSFSession("aPath"); is very expensive with 'my' tests. I take some measures and in average i measure new JSFSession("")~2000ms, sometimes i get 8000ms.

      Here the code i used for the measures.

      public void setUp(){
      
       long b=0;
       long tsNewJSFSession=0;
       long tsgetJSFClientSession=0;
       long tsNewRichFacesClientt=0;
       long tsgetJSFServerSession=0;
       try {
      
       b = System.currentTimeMillis();
       jsfSession = new JSFSession(getJSFPath());
       tsNewJSFSession=System.currentTimeMillis()-b;
       b = System.currentTimeMillis();
       client = jsfSession.getJSFClientSession();
       tsgetJSFClientSession=System.currentTimeMillis()-b;
       b = System.currentTimeMillis();
       richfaces=new RichFacesClient(client);
       tsNewRichFacesClientt=System.currentTimeMillis()-b;
       b = System.currentTimeMillis();
       server = jsfSession.getJSFServerSession();
       tsgetJSFServerSession=System.currentTimeMillis()-b;
      
      
       } catch (Exception e) {
       log.error("init():KO", e);
       throw new RuntimeException("init() doit etre appele APRES login(xx) !? or ..."+e.getMessage()+" "+e.getCause(), e);
       }
       long end= System.currentTimeMillis();
       if (log.isDebugEnabled()) {
       log.debug("init():Time to initialize JSF tsNewJSFSession="+tsNewJSFSession+" tsgetJSFClientSession="+tsgetJSFClientSession+" tsNewRichFacesClientt="+tsNewRichFacesClientt+" tsgetJSFServerSession="+tsgetJSFServerSession);
       }
      }


      Are my measures normal or it is my conf?


      I'm with jboss4.2.2/JDK1.6/jsfunit 1.0GA/Windows XP
      Processor Intel core 2duo E6750@2.66Ghz

      Thanks.