Author: thomas.heute(a)jboss.com
Date: 2007-08-13 03:44:14 -0400 (Mon, 13 Aug 2007)
New Revision: 7899
Added:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java
Modified:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java
Log:
Test case for Delegating property resolver bug fix (Check superclass for attribute)
Modified:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-08-10
22:50:33 UTC (rev 7898)
+++
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-08-13
07:44:14 UTC (rev 7899)
@@ -53,6 +53,9 @@
private TestBeanDecorator testBeanInterfaceSuperInterfaceDecorator;
/** . */
+ private TestBeanDecorator testBeanSuperClassDecorator;
+
+ /** . */
private TestDynamicBean testDynamicBean;
/** . */
@@ -66,11 +69,13 @@
testBeanDecorator = new TestBeanDecorator(testBean.property);
testBeanInterfaceDecorator = new TestBeanDecorator(testBean.interfaceProperty);
testBeanInterfaceSuperInterfaceDecorator = new
TestBeanDecorator(testBean.interfaceSuperInterfaceProperty);
+ testBeanSuperClassDecorator = new TestBeanDecorator(testBean.superClassProperty);
testDynamicBean = new TestDynamicBean();
resolver = new DelegatingPropertyResolver();
resolver.registerDecorator(TestBean.class, testBeanDecorator);
resolver.registerDecorator(TestBeanInterface.class, testBeanInterfaceDecorator);
resolver.registerDecorator(TestBeanInterfaceSuperInterface.class,
testBeanInterfaceSuperInterfaceDecorator);
+ resolver.registerDecorator(TestBeanSuperClass.class, testBeanSuperClassDecorator);
}
public void testGetType()
@@ -96,6 +101,7 @@
assertEquals(Value.class, resolver.getType(testBean,
testBeanDecorator.property.name));
assertEquals(Value.class, resolver.getType(testBean,
testBeanInterfaceDecorator.property.name));
assertEquals(Value.class, resolver.getType(testBean,
testBeanInterfaceSuperInterfaceDecorator.property.name));
+ assertEquals(Value.class, resolver.getType(testBean,
testBeanSuperClassDecorator.property.name));
//
try
@@ -144,6 +150,7 @@
assertEquals(testBean.property.value, resolver.getValue(testBean,
testBeanDecorator.property.name));
assertEquals(testBeanInterfaceDecorator.property.value, resolver.getValue(testBean,
testBeanInterfaceDecorator.property.name));
assertEquals(testBeanInterfaceSuperInterfaceDecorator.property.value,
resolver.getValue(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name));
+ assertEquals(testBeanSuperClassDecorator.property.value,
resolver.getValue(testBean, testBeanSuperClassDecorator.property.name));
//
try
@@ -186,6 +193,9 @@
Value interfaceSuperInterfacePropertyExpectedValue = new Value();
resolver.setValue(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name,
interfaceSuperInterfacePropertyExpectedValue);
assertEquals(interfaceSuperInterfacePropertyExpectedValue,
testBeanInterfaceSuperInterfaceDecorator.property.value);
+ Value superClassPropertyExpectedValue = new Value();
+ resolver.setValue(testBean, testBeanSuperClassDecorator.property.name,
superClassPropertyExpectedValue);
+ assertEquals(superClassPropertyExpectedValue,
testBeanSuperClassDecorator.property.value);
//
try
Modified:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java 2007-08-10
22:50:33 UTC (rev 7898)
+++
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java 2007-08-13
07:44:14 UTC (rev 7899)
@@ -26,7 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestBean implements TestBeanInterface
+public class TestBean extends TestBeanSuperClass implements TestBeanInterface
{
/** . */
@@ -38,11 +38,15 @@
/** . */
Property interfaceSuperInterfaceProperty;
+ /** . */
+ Property superClassProperty;
+
public TestBean()
{
this.property = new Property();
this.interfaceProperty = new Property();
this.interfaceSuperInterfaceProperty = new Property();
+ this.superClassProperty = new Property();
}
public class Property
Added:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java 2007-08-13
07:44:14 UTC (rev 7899)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.test.faces.el;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestBeanSuperClass
+{
+
+}
+