* of the value, and the type of the value.
*/
public void testCustomScopeNoMap()
{
// create the custom scope
ManagedBean scopeBean = new ManagedBean();
// Scope is ArrayList instead of HashMap
scopeBean.setBeanClass(ArrayList.class.getName());
scopeBean.setName("scopeBean");
scopeBean.setScope("application");
runtimeConfig.addManagedBean("scopeBean", scopeBean);
// create the managed bean
ManagedBean beanInCustomScope = new ManagedBean();
beanInCustomScope.setBeanClass(ArrayList.class.getName());
beanInCustomScope.setName("beanInCustomScope");
beanInCustomScope.setScope("#{scopeBean}");
runtimeConfig.addManagedBean("beanInCustomScope", beanInCustomScope);
// resolve the managed bean
try
{
new MockValueExpression("#{beanInCustomScope}", List.class)
.getValue(facesContext.getELContext());
}
catch (FacesException fe)
{
// the message must contain ...
final String message = fe.getMessage();
// ... the expression string
assertTrue(message.contains(beanInCustomScope.getManagedBeanScope()));
Object resolvedScopeBean = new MockValueExpression("#{scopeBean}", List.class)
.getValue(facesContext.getELContext());
// ... the toString() of the value
assertTrue(message.contains(resolvedScopeBean.toString()));
// ... and the type of the value