/** * This hook method called from the {@link #setUp()} should append JSF implementation listener to the test server. * Default version applends "com.sun.faces.config.ConfigureListener" or * "org.apache.myfaces.webapp.StartupServletContextListener" for the existed SUN RI or MyFaces implementation. This * metod also calls appropriate {@link #setupSunFaces()} or {@link #setupMyFaces()} methods. */ protected void setupFacesListener() { EventListener listener = null; try { // Check Sun RI configuration listener class. listener = createInstance("com.sun.faces.config.ConfigureListener"); setupSunFaces(); } catch (ClassNotFoundException e) { // No JSF RI listener, check MyFaces. try { listener = createInstance("org.apache.myfaces.webapp.StartupServletContextListener"); setupMyFaces(); } catch (ClassNotFoundException e1) { throw new TestException("No JSF listeners have been found", e1); } } facesServer.addWebListener(listener); }
/** * This hook method called from the {@link #setUp()} should append JSF implementation listener to the test server. * Default version applends "com.sun.faces.config.ConfigureListener" or * "org.apache.myfaces.webapp.StartupServletContextListener" for the existed SUN RI or MyFaces implementation. This * metod also calls appropriate {@link #setupSunFaces()} or {@link #setupMyFaces()} methods. */ protected void setupFacesListener() { EventListener listener = null; try { // Check Sun RI configuration listener class. listener = createInstance("com.sun.faces.config.ConfigureListener"); setupSunFaces(); } catch (ClassNotFoundException e) { // No JSF RI listener, check MyFaces. try { listener = createInstance("org.apache.myfaces.webapp.StartupServletContextListener"); setupMyFaces(); } catch (ClassNotFoundException e1) { throw new TestException("No JSF listeners have been found", e1); } } facesServer.addWebListener(listener); }