1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.el;
20
21 import javax.faces.el.PropertyResolver;
22
23 import junit.framework.Test;
24 import junit.framework.TestSuite;
25
26 import org.apache.myfaces.el.data.B;
27 import org.apache.shale.test.base.AbstractJsfTestCase;
28
29 public class PropertyResolverTestCase extends AbstractJsfTestCase
30 {
31
32 public PropertyResolverTestCase(String arg0) {
33 super(arg0);
34 }
35
36 public void setUp()
37 {
38 super.setUp();
39 PropertyResolver pr = new PropertyResolverImpl();
40 facesContext.getApplication().setPropertyResolver(pr);
41 }
42
43 public void tearDown()
44 {
45
46 super.tearDown();
47 }
48
49 public static Test suite()
50 {
51 return new TestSuite(PropertyResolverTestCase.class);
52 }
53
54 public void testComplexBean() throws Exception
55 {
56 B b = new B();
57 facesContext.getExternalContext().getSessionMap().put("b", b);
58 B o = (B) facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, "b");
59 assertEquals(o.getFirst(), "First");
60 facesContext.getApplication().getPropertyResolver().setValue(b, "first", "LALA");
61 o = (B) facesContext.getApplication().getVariableResolver().resolveVariable(facesContext, "b");
62 assertEquals(o.getFirst(), "LALA");
63
64 }
65 }