Search in sources :

Example 1 with ApplicationFactory

use of jakarta.faces.application.ApplicationFactory in project myfaces by apache.

the class AbstractJsfConfigurableMockTestCase method setUpApplication.

/**
 * Setup the <code>application</code> variable and before
 * the end by default it is assigned to the <code>facesContext</code>
 * variable, calling <code>facesContext.setApplication(application)</code>
 *
 * @throws Exception
 */
protected void setUpApplication() throws Exception {
    ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    application = applicationFactory.getApplication();
    ((MockFacesContext) facesContext).setApplication(application);
}
Also used : MockFacesContext(org.apache.myfaces.test.mock.MockFacesContext) ApplicationFactory(jakarta.faces.application.ApplicationFactory)

Example 2 with ApplicationFactory

use of jakarta.faces.application.ApplicationFactory in project myfaces by apache.

the class AbstractJsfConfigurableMultipleRequestsTestCase method setUpApplication.

/**
 * Setup the <code>application</code> variable and before
 * the end by default it is assigned to the <code>facesContext</code>
 * variable, calling <code>facesContext.setApplication(application)</code>
 *
 * @throws Exception
 */
protected void setUpApplication() throws Exception {
    ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    application = applicationFactory.getApplication();
}
Also used : ApplicationFactory(jakarta.faces.application.ApplicationFactory)

Example 3 with ApplicationFactory

use of jakarta.faces.application.ApplicationFactory in project myfaces by apache.

the class AbstractJsfTestCase method setUpApplication.

/**
 * Setup the <code>application</code> variable and before
 * the end by default it is assigned to the <code>facesContext</code>
 * variable, calling <code>facesContext.setApplication(application)</code>
 *
 * @throws Exception
 */
protected void setUpApplication() throws Exception {
    ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    application = (MockApplication) applicationFactory.getApplication();
    facesContext.setApplication(application);
}
Also used : ApplicationFactory(jakarta.faces.application.ApplicationFactory)

Example 4 with ApplicationFactory

use of jakarta.faces.application.ApplicationFactory in project jans by JanssenProject.

the class Labels method init.

@PostConstruct
private void init() {
    ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    facesApp = factory.getApplication();
}
Also used : ApplicationFactory(jakarta.faces.application.ApplicationFactory) PostConstruct(jakarta.annotation.PostConstruct)

Example 5 with ApplicationFactory

use of jakarta.faces.application.ApplicationFactory in project mojarra by eclipse-ee4j.

the class FacesContextImpl method getApplication.

/**
 * @see jakarta.faces.context.FacesContext#getApplication()
 */
@Override
public Application getApplication() {
    assertNotReleased();
    if (null != application) {
        return application;
    }
    ApplicationFactory aFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    application = aFactory.getApplication();
    assert null != application;
    return application;
}
Also used : ApplicationFactory(jakarta.faces.application.ApplicationFactory)

Aggregations

ApplicationFactory (jakarta.faces.application.ApplicationFactory)21 FacesContext (jakarta.faces.context.FacesContext)9 Application (jakarta.faces.application.Application)4 PrintWriter (java.io.PrintWriter)4 LifecycleFactory (jakarta.faces.lifecycle.LifecycleFactory)3 MockHttpServletRequest (com.sun.faces.mock.MockHttpServletRequest)2 MockHttpServletResponse (com.sun.faces.mock.MockHttpServletResponse)2 MockServletContext (com.sun.faces.mock.MockServletContext)2 FacesContextFactory (jakarta.faces.context.FacesContextFactory)2 Method (java.lang.reflect.Method)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 MockExternalContext (com.sun.faces.mock.MockExternalContext)1 MockFacesContext (com.sun.faces.mock.MockFacesContext)1 MockHttpSession (com.sun.faces.mock.MockHttpSession)1 MockLifecycle (com.sun.faces.mock.MockLifecycle)1 MockServletConfig (com.sun.faces.mock.MockServletConfig)1 PostConstruct (jakarta.annotation.PostConstruct)1 ELContext (jakarta.el.ELContext)1 FacesException (jakarta.faces.FacesException)1