Search in sources :

Example 6 with FooBarConverter

use of com.opensymphony.xwork2.conversion.impl.FooBarConverter in project struts by apache.

the class PropertyTest method testTypeConverterReturningNullShouldLeadToDisplayOfDefaultValue.

public void testTypeConverterReturningNullShouldLeadToDisplayOfDefaultValue() {
    final ValueStack stack = ActionContext.getContext().getValueStack();
    converter.registerConverter("org.apache.struts2.components.PropertyTest$FooBar", new FooBarConverter());
    stack.push(new FooBar("foo-value", null));
    final Property property = new Property(stack);
    property.setDefault("default");
    property.setValue("top");
    assertPropertyOutput("default", property);
}
Also used : ValueStack(com.opensymphony.xwork2.util.ValueStack)

Aggregations

ValueStack (com.opensymphony.xwork2.util.ValueStack)4 FooBarConverter (com.opensymphony.xwork2.conversion.impl.FooBarConverter)2 XWorkConverter (com.opensymphony.xwork2.conversion.impl.XWorkConverter)2 Bar (com.opensymphony.xwork2.util.Bar)2 Cat (com.opensymphony.xwork2.util.Cat)2 Foo (com.opensymphony.xwork2.util.Foo)2