1.1 --- a/src/test/java/ru/indvdum/jpa/tests/AbstractJPAEntityTest.groovy Sat Nov 24 15:58:22 2012 +0400
1.2 +++ b/src/test/java/ru/indvdum/jpa/tests/AbstractJPAEntityTest.groovy Sat Nov 24 16:11:35 2012 +0400
1.3 @@ -162,6 +162,9 @@
1.4 newValue = (float) uniqueValue++ % Float.MAX_VALUE + 1f
1.5 } else if(type.toString() == 'double' || type == Double) {
1.6 newValue = (double) uniqueValue++ % Double.MAX_VALUE + 1d
1.7 + } else if(Number.class.isAssignableFrom(type)) {
1.8 + // trying to use constructor with int argument
1.9 + newValue = type.newInstance(uniqueValue++ % Byte.MAX_VALUE + 1i)
1.10 } else if(type == String.class) {
1.11 newValue = (String) "test${uniqueValue++}"
1.12 } else if(type instanceof Class && (type as Class).annotations.find {it instanceof Entity} != null) { // modifying of a primary keys is deprecated