tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1499932 - /tomcat/trunk/test/javax/el/TestBeanNameELResolver.java
Date Fri, 05 Jul 2013 08:19:17 GMT
Author: markt
Date: Fri Jul  5 08:19:17 2013
New Revision: 1499932

URL: http://svn.apache.org/r1499932
Log:
More unit tests for BeanNameELResolver
Add tests for remaining methods

Modified:
    tomcat/trunk/test/javax/el/TestBeanNameELResolver.java

Modified: tomcat/trunk/test/javax/el/TestBeanNameELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/javax/el/TestBeanNameELResolver.java?rev=1499932&r1=1499931&r2=1499932&view=diff
==============================================================================
--- tomcat/trunk/test/javax/el/TestBeanNameELResolver.java (original)
+++ tomcat/trunk/test/javax/el/TestBeanNameELResolver.java Fri Jul  5 08:19:17 2013
@@ -468,6 +468,60 @@ public class TestBeanNameELResolver {
     }
 
 
+    /**
+     * Confirm it returns null for 'valid' input.
+     */
+    public void testGetFeatureDescriptors01() {
+        BeanNameELResolver resolver = createBeanNameELResolver();
+        ELContext context =
+                new StandardELContext(ELManager.getExpressionFactory());
+
+        Object result = resolver.getFeatureDescriptors(context, null);
+
+        Assert.assertNull(result);
+        Assert.assertFalse(context.isPropertyResolved());
+    }
+
+
+    /**
+     * Confirm it returns null for invalid input.
+     */
+    public void testGetFeatureDescriptors02() {
+        BeanNameELResolver resolver = createBeanNameELResolver();
+
+        Object result = resolver.getFeatureDescriptors(null, new Object());
+
+        Assert.assertNull(result);
+    }
+
+
+    /**
+     * Confirm it returns String.class for 'valid' input.
+     */
+    public void testGetCommonPropertyType01() {
+        BeanNameELResolver resolver = createBeanNameELResolver();
+        ELContext context =
+                new StandardELContext(ELManager.getExpressionFactory());
+
+        Object result = resolver.getCommonPropertyType(context, null);
+
+        Assert.assertNull(result);
+        Assert.assertFalse(context.isPropertyResolved());
+    }
+
+
+    /**
+     * Confirm it returns String.class for invalid input.
+     */
+    public void testGetCommonPropertyType02() {
+        BeanNameELResolver resolver = createBeanNameELResolver();
+
+        Object result = resolver.getCommonPropertyType(null, new Object());
+
+        Assert.assertNull(result);
+    }
+
+
     private void doThrowableTest(String trigger, MethodUnderTest method) {
         BeanNameELResolver resolver = createBeanNameELResolver();
         ELContext context =



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message