mvel
mvel copied to clipboard
PropertyAccess.setProperty doesn't convert Collection's value type
I just add a test to PropertyAccessTests in MVEL
public class Datas {
private List<Long> ids = new ArrayList<Long>();
public void setIds(List<Long> ids) {
this.ids = ids;
}
public List<Long> getIds() {
return this.ids;
}
}
public void testBindingConvert() {
Datas datas = new Datas();
List values = new ArrayList();
values.add("1");
values.add("2");
values.add("3");
MVEL.setProperty(datas, "ids", values);
assertEquals(new Long(1),datas.getIds().get(0));
}
and got this:
testBindingConvert(org.mvel2.tests.core.PropertyAccessTests): expected:<1> but was:<1>