1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.view.facelets.el;
20
21 import javax.el.ExpressionFactory;
22 import org.apache.myfaces.view.facelets.FaceletTestCase;
23 import org.junit.Assert;
24 import org.junit.Test;
25
26
27
28
29
30 public class CompositeComponentELUtilsTestCase extends FaceletTestCase
31 {
32
33 @Override
34 protected ExpressionFactory createExpressionFactory()
35 {
36 return new org.apache.el.ExpressionFactoryImpl();
37 }
38
39 @Test
40 public void test_cc_attrs_method_expression1() throws Exception
41 {
42 Assert.assertTrue(
43 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
44 "#{cc.attrs.someProp}"));
45 Assert.assertTrue(
46 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
47 "#{ cc.attrs.someProp}"));
48 Assert.assertFalse(
49 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
50 "#{cc.attrs.someProp.someKey}"));
51 Assert.assertFalse(
52 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
53 "#{xy:call(cc.attrs.someProp)}"));
54 Assert.assertFalse(
55 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
56 "#{xy:call( cc.attrs.someProp)}"));
57 Assert.assertFalse(
58 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
59 "#{xy:call(zz, cc.attrs.someProp)}"));
60 Assert.assertFalse(
61 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
62 "#{xy:call(zz,cc.attrs.someProp)}"));
63 Assert.assertTrue(
64 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
65 "#{cc.attrs.method(someProp)}"));
66 Assert.assertTrue(
67 CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
68 "#{cc.attrs.method( someProp, someAttr )}"));
69 }
70 }