1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.myfaces.context;
17
18 import javax.faces.FactoryFinder;
19 import javax.faces.context.FacesContext;
20 import javax.faces.context.PartialViewContext;
21
22 import org.apache.myfaces.context.servlet.FacesContextImpl;
23 import org.apache.myfaces.test.base.AbstractJsfTestCase;
24
25
26
27
28
29
30
31
32 public class IsRenderedTest extends AbstractJsfTestCase {
33
34 public IsRenderedTest() {
35 super("IsRenderedTest");
36 }
37
38 @Override
39 protected void setUp() throws Exception {
40 super.setUp();
41 FactoryFinder.setFactory(FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY,
42 "org.apache.myfaces.context.PartialViewContextFactoryImpl");
43 FactoryFinder.setFactory (FactoryFinder.EXCEPTION_HANDLER_FACTORY,
44 "org.apache.myfaces.context.ExceptionHandlerFactoryImpl");
45 }
46
47
48
49
50
51
52 public void testRenderAll1() {
53 FacesContext context = new FacesContextImpl(servletContext, request, response);
54
55 PartialViewContext pprContext = context.getPartialViewContext();
56
57 pprContext.setRenderAll(true);
58 assertTrue("override should trigger no matter which condition we have", pprContext.isRenderAll());
59
60 context = new FacesContextImpl(servletContext, request, response);
61 pprContext.setRenderAll(false);
62 assertFalse("override should trigger no matter which condition we have", pprContext.isRenderAll());
63 }
64
65
66 }