myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1523342 - /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java
Date Sat, 14 Sep 2013 22:23:22 GMT
Author: lu4242
Date: Sat Sep 14 22:23:21 2013
New Revision: 1523342

URL: http://svn.apache.org/r1523342
Log:
small improvement add some junit tests for a regex

Added:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java
  (with props)

Added: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java?rev=1523342&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java
(added)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java
Sat Sep 14 22:23:21 2013
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.el;
+
+import javax.el.ExpressionFactory;
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ *
+ * @author Leonardo Uribe
+ */
+public class CompositeComponentELUtilsTestCase extends FaceletTestCase
+{
+    
+    @Override
+    protected ExpressionFactory createExpressionFactory()
+    {
+        return new org.apache.el.ExpressionFactoryImpl();
+    }
+    
+    @Test
+    public void test_cc_attrs_method_expression1() throws Exception
+    {
+        Assert.assertTrue(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{cc.attrs.someProp}"));
+        Assert.assertTrue(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{ cc.attrs.someProp}"));
+        Assert.assertFalse(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{cc.attrs.someProp.someKey}"));
+        Assert.assertFalse(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{xy:call(cc.attrs.someProp)}"));
+        Assert.assertFalse(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{xy:call( cc.attrs.someProp)}"));
+        Assert.assertFalse(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{xy:call(zz, cc.attrs.someProp)}"));        
+        Assert.assertFalse(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{xy:call(zz,cc.attrs.someProp)}"));
+        Assert.assertTrue(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{cc.attrs.method(someProp)}"));
+        Assert.assertTrue(
+            CompositeComponentELUtils.isCompositeComponentAttrsMethodExpression(
+            "#{cc.attrs.method( someProp, someAttr )}"));
+    }
+}

Propchange: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/el/CompositeComponentELUtilsTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message