public FacesEnvironment withFilter(String name, Filter filter) { checkNotInitialized(); filterContainer = new FilterHolder(facesServletContainer.getMapping(), filter); filterContainer.setName(name); return this; }
public FacesEnvironment withRichFaces() { checkNotInitialized(); try { Filter ajaxFilter = createInstance("org.ajax4jsf.Filter"); withFilter("ajax4jsf", ajaxFilter); webXmlDefault = "org/jboss/test/faces/ajax-web.xml"; return this; } catch (ClassNotFoundException e) { throw new TestException(e); } }
/** * */ protected FacesRule(FacesEnvironment environment){ this.environment = environment; this.environment.getServer().addWebListener(this); }
/** * <p class="changed_added_4_0"> * </p> */ public FacesEnvironment(ApplicationServer applicationServer) { this.facesServer = applicationServer; setupFacesServlet(); setupFacesListener(); setupJsfInitParameters(); setupWebContent(); }
/** * Run the test in an environment where * we can handle the exceptions generated by the test method.*/ public void run() { try { runTestCase(); } catch(Throwable t) /* Any other exception we handle and then we interrupt the other threads.*/ { handleException(t); interruptThreads(); } } }
/** * <p class="changed_added_4_0"> * </p> * * @param name * @param value * @see org.jboss.test.faces.staging.StagingServer#addInitParameter(java.lang.String, java.lang.String) */ public FacesEnvironment withInitParameter(String name, String value) { checkNotInitialized(); this.facesServer.addInitParameter(name, value); return this; }
public static FacesRule create(ApplicationServer server) { return new FacesRule(new FacesEnvironment(server)); }
@Override public ServletContext getContext() { if (!initialised) { throw new TestException("Staging server have not been initialised"); } return contextProxy; }
public FacesEnvironment withResourcesFromDirectory(String path, URL resource){ this.facesServer.addResourcesFromDirectory(path, resource); return this; } /**
/** * This template method called from the {@link #setupFacesListener()} if Sun JSF reference implementation presents. * The default implementation sets the "com.sun.faces.validateXml" "com.sun.faces.verifyObjects" init parameters to * the "true" */ protected void setupSunFaces() { facesServer.addInitParameter("com.sun.faces.validateXml", "true"); facesServer.addInitParameter("com.sun.faces.verifyObjects", "true"); }
public FacesEnvironment withSeam() { checkNotInitialized(); try { Filter ajaxFilter = createInstance("org.jboss.seam.servlet.SeamFilter"); withFilter("ajax4jsf", ajaxFilter); EventListener seamListener = createInstance("org.jboss.seam.servlet.SeamListener"); facesServer.addWebListener(seamListener); webXmlDefault = "org/jboss/test/faces/ajax-web.xml"; return this; } catch (ClassNotFoundException e) { throw new TestException(e); } }
public FacesEnvironment withFilter(String name, Filter filter) { checkNotInitialized(); filterContainer = new FilterHolder(facesServletContainer.getMapping(), filter); filterContainer.setName(name); return this; }
/** * */ protected FacesRule(FacesEnvironment environment){ this.environment = environment; this.environment.getServer().addWebListener(this); }
/** * Run the test in an environment where * we can handle the exceptions generated by the test method.*/ public void run() { try { runTestCase(); } catch(Throwable t) /* Any other exception we handle and then we interrupt the other threads.*/ { handleException(t); interruptThreads(); } } }
/** * <p class="changed_added_4_0"> * </p> * * @param name * @param value * @see org.jboss.test.faces.staging.StagingServer#addInitParameter(java.lang.String, java.lang.String) */ public FacesEnvironment withInitParameter(String name, String value) { checkNotInitialized(); this.facesServer.addInitParameter(name, value); return this; }
public static FacesRule create() { return new FacesRule(new FacesEnvironment()); }
public FacesEnvironment withRichFaces() { checkNotInitialized(); try { Filter ajaxFilter = createInstance("org.ajax4jsf.Filter"); withFilter("ajax4jsf", ajaxFilter); webXmlDefault = "org/jboss/test/faces/ajax-web.xml"; return this; } catch (ClassNotFoundException e) { throw new TestException(e); } }
public FacesRule withListener(EventListener listener) { environment.getServer().addWebListener(listener); return this; }
public FacesEnvironment withSeam() { checkNotInitialized(); try { Filter ajaxFilter = createInstance("org.jboss.seam.servlet.SeamFilter"); withFilter("ajax4jsf", ajaxFilter); EventListener seamListener = createInstance("org.jboss.seam.servlet.SeamListener"); facesServer.addWebListener(seamListener); webXmlDefault = "org/jboss/test/faces/ajax-web.xml"; return this; } catch (ClassNotFoundException e) { throw new TestException(e); } }
public FacesRule withListener(EventListener listener) { environment.getServer().addWebListener(listener); return this; }