six2six / fixture-factory

Generator fake objects from a template
Apache License 2.0
445 stars 88 forks source link

Using regex function with primitive type #39

Closed nykolaslima closed 10 years ago

nykolaslima commented 10 years ago

I have one property number of primitive int type.

If I configure my template with regex function it gives me an exception

add("number", regex("\\d{3}");

IllegalArgumentException: No such attribute: number[java.lang.String]

I believe ValueProcessor is returning the generated value as a String and than ReflectionUtils.invokeSetter is trying to call setNumber(String) but it should call setNumber(int).

Maybe change ValueProcessor to return the corresponding Wrapper class when the attribute is from a primitive type.

ahirata commented 10 years ago

Done.

nykolaslima commented 10 years ago

Thank you @ahirata

What do you think about release a new version?

Sent from my iPhone

On 25/10/2013, at 22:38, Arthur Hirata notifications@github.com wrote:

Closed #39.

— Reply to this email directly or view it on GitHub.

ahirata commented 10 years ago

We must first change that Session feature.