6 Replies Latest reply on Sep 30, 2008 9:39 AM by Jim R

    What's the best way to fresh reload a page during test?

    Jim R Newbie

      Hi,

      In my unit test I have

       protected void setUp() throws Exception
       {
       super.setUp();
       WebClientSpec wcSpec = new WebClientSpec(page);
       MyAuthenticationStrategy auth = new MyAuthenticationStrategy("testuser", "test1234");
       wcSpec.setInitialRequestStrategy(auth);
       session = new JSFSession(wcSpec);
       client = session.getJSFClientSession();
       server = session.getJSFServerSession();
       }
      

      which will go to the page I want to test with authenitcation before the test begin. This works without problem. The problem is now I'd like to fresh reload this page (not just resubmit, but doing something similar to reenter the url in browser address textbox and press enter), I'm not sure how to do it. I tried to call setUp() inside my test case, but got this error
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: com.insightnt.scn.action.location.manageLocationAction at org.jboss.seam.Component.newInstance(Component.java:1986) at org.jboss.seam.Component.getInstance(Component.java:1876) at org.jboss.seam.Component.getInstance(Component.java:1843) at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1922) at org.jboss.seam.Component.getInstance(Component.java:1866) at org.jboss.seam.Component.getInstance(Component.java:1843) at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55) at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50) at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166) at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64) at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44) at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) at javax.faces.component.UIData.getValue(UIData.java:582) at javax.faces.component.UIData.getDataModel(UIData.java:1063) at javax.faces.component.UIData.getRowCount(UIData.java:310) at org.jboss.jsfunit.jsfsession.ClientIDs.addUIData(ClientIDs.java:117) at org.jboss.jsfunit.jsfsession.ClientIDs.addAllIDs(ClientIDs.java:75) at org.jboss.jsfunit.jsfsession.ClientIDs.addAllIDs(ClientIDs.java:83) at org.jboss.jsfunit.jsfsession.ClientIDs.addAllIDs(ClientIDs.java:83) at org.jboss.jsfunit.jsfsession.ClientIDs.addAllIDs(ClientIDs.java:83) at org.jboss.jsfunit.jsfsession.ClientIDs.<init>(ClientIDs.java:62) at org.jboss.jsfunit.jsfsession.JSFServerSession.pageCreated(JSFServerSession.java:181) at org.jboss.jsfunit.jsfsession.JSFServerSession.<init>(JSFServerSession.java:54) at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:84) at
      


      Any ideas?