You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by gv...@apache.org on 2006/03/23 19:25:36 UTC
svn commit: r388228 -
/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java
Author: gvanmatre
Date: Thu Mar 23 10:25:33 2006
New Revision: 388228
URL: http://svn.apache.org/viewcvs?rev=388228&view=rev
Log:
Fix for Bug# 39083 reported by Dennis C. Byrne.
Modified:
struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java
Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=388228&r1=388227&r2=388228&view=diff
==============================================================================
--- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original)
+++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Thu Mar 23 10:25:33 2006
@@ -88,57 +88,58 @@
// Set up instance variables required by this test case.
public void setUp() {
-
+
// Set up a new thread context class loader
threadContextClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0],
- this.getClass().getClassLoader()));
-
+ this.getClass().getClassLoader()));
+
// Set up Servlet API Objects
servletContext = new MockServletContext();
config = new MockServletConfig(servletContext);
session = new MockHttpSession();
request = new MockHttpServletRequest(session);
response = new MockHttpServletResponse();
-
+
// Set up JSF API Objects
FactoryFinder.releaseFactories();
- FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
- "org.apache.shale.test.mock.MockApplicationFactory");
- FactoryFinder.setFactory(FactoryFinder.FACES_CONTEXT_FACTORY,
- "org.apache.shale.test.mock.MockFacesContextFactory");
+ FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
+ "org.apache.shale.test.mock.MockApplicationFactory");
+ FactoryFinder.setFactory(FactoryFinder.FACES_CONTEXT_FACTORY,
+ "org.apache.shale.test.mock.MockFacesContextFactory");
FactoryFinder.setFactory(FactoryFinder.LIFECYCLE_FACTORY,
- "org.apache.shale.test.mock.MockLifecycleFactory");
- FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY,
- "org.apache.shale.test.mock.MockRenderKitFactory");
-
+ "org.apache.shale.test.mock.MockLifecycleFactory");
+ FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY,
+ "org.apache.shale.test.mock.MockRenderKitFactory");
+
externalContext =
new MockExternalContext(servletContext, request, response);
lifecycleFactory = (MockLifecycleFactory)
- FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
lifecycle = (MockLifecycle)
- lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
+ lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
facesContextFactory = (MockFacesContextFactory)
- FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
+ FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
facesContext = (MockFacesContext)
- facesContextFactory.getFacesContext(servletContext,
- request,
- response,
- lifecycle);
+ facesContextFactory.getFacesContext(servletContext,
+ request,
+ response,
+ lifecycle);
externalContext = (MockExternalContext) facesContext.getExternalContext();
- UIViewRoot root = new UIViewRoot();
- root.setViewId("/viewId");
+ UIViewRoot root = new UIViewRoot();
+ root.setViewId("/viewId");
+ root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
facesContext.setViewRoot(root);
ApplicationFactory applicationFactory = (ApplicationFactory)
- FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
application = new MockApplication();
applicationFactory.setApplication(application);
facesContext.setApplication(application);
RenderKitFactory renderKitFactory = (RenderKitFactory)
- FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
renderKit = new MockRenderKit();
renderKitFactory.addRenderKit(RenderKitFactory.HTML_BASIC_RENDER_KIT, renderKit);
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org