/** * Setup virtual server connection to run tests inside JSF lifecycle. * The default implementation setups virtual request to the "http://localhost/test.jsf" URL and creates {@link FacesContext} instance. * Two template methods are called : * <ol> * <li>{@link #setupConnection()} to prepare request method, parameters, headers and so</li> * <li>{@link #setupView()} to create default view.</li> * </ol> * @throws Exception */ protected void setupFacesRequest() throws Exception { String url = "http://localhost/test.jsf"; setupFacesRequest(url); UIViewRoot viewRoot = setupView(); if (null != viewRoot) { facesContext.setViewRoot(viewRoot); } }
setupFacesServlet(); setupFacesListener(); setupJsfInitParameters(); setupWebContent(); facesServer.init(); ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder
.asSubclass(EventListener.class); listener = listenerClass.newInstance(); setupSunFaces(); } catch (ClassNotFoundException e) { .asSubclass(EventListener.class); listener = listenerClass.newInstance(); setupMyFaces(); } catch (ClassNotFoundException e1) { throw new TestException("No JSF listeners have been found", e1);
/** * <p class="changed_added_2_0"></p> * @param url * @throws MalformedURLException * @throws FacesException */ protected void setupFacesRequest(String url) throws MalformedURLException, FacesException { connection = facesServer.getConnection(new URL( url)); setupConnection(); connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer .getContext(), connection.getRequest(), connection .getResponse(), lifecycle); }
setupFacesServlet(); setupFacesListener(); setupJsfInitParameters(); setupWebContent(); facesServer.init(); ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder
.asSubclass(EventListener.class); listener = listenerClass.newInstance(); setupSunFaces(); } catch (ClassNotFoundException e) { .asSubclass(EventListener.class); listener = listenerClass.newInstance(); setupMyFaces(); } catch (ClassNotFoundException e1) { throw new TestException("No JSF listeners have been found", e1);
/** * <p class="changed_added_2_0"></p> * @param url * @throws MalformedURLException * @throws FacesException */ protected void setupFacesRequest(String url) throws MalformedURLException, FacesException { connection = facesServer.getConnection(new URL( url)); setupConnection(); connection.start(); FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); facesContext = facesContextFactory.getFacesContext(facesServer .getContext(), connection.getRequest(), connection .getResponse(), lifecycle); }
/** * Setup virtual server connection to run tests inside JSF lifecycle. * The default implementation setups virtual request to the "http://localhost/test.jsf" URL and creates {@link FacesContext} instance. * Two template methods are called : * <ol> * <li>{@link #setupConnection()} to prepare request method, parameters, headers and so</li> * <li>{@link #setupView()} to create default view.</li> * </ol> * @throws Exception */ protected void setupFacesRequest() throws Exception { String url = "http://localhost/test.jsf"; setupFacesRequest(url); UIViewRoot viewRoot = setupView(); if (null != viewRoot) { facesContext.setViewRoot(viewRoot); } }