} else {
fail(listItemClass.getName());
}
} else {
if( TaskCommand.class.equals(listItemClass) ) {
ActivateTaskCommand cmd = new ActivateTaskCommand();
cmd.setTaskId(random.nextLong());
cmd.setUserId(UUID.randomUUID().toString());
listItem = cmd;
} else {
listItem = listItemClass.getConstructor().newInstance();
for( Field listItemField : listItemClass.getDeclaredFields() ) {
fillField(listItemField, listItem);
}
}
}
list.add(listItem);
}
field.set(obj, list);
} else if( fieldType.equals(XMLGregorianCalendar.class) ) {
XMLGregorianCalendar date = datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
field.set(obj, date);
} else if( fieldType.equals(Object.class) ) {
field.set(obj, "Object");
} else if( fieldType.equals(byte[].class) ) {
byte [] value = StringKeyObjectValueMapXmlAdapter.serializeObject("Object", "test");
field.set(obj, value);
} else {
fail("> " + obj.getClass().getSimpleName() + "." + field.getName() + ": " + fieldType.getName());
}
} else if( fieldType.isEnum() ) {
Object [] enumConstants = fieldType.getEnumConstants();
field.set(obj, enumConstants[random.nextInt(enumConstants.length)]);
} else {
if( fieldType.equals(org.kie.remote.jaxb.gen.TaskCommand.class) ) {
ActivateTaskCommand cmd = new ActivateTaskCommand();
cmd.setTaskId(2l);
cmd.setUserId(UUID.randomUUID().toString());
field.set(obj, cmd);
} else {
if( field.getAnnotation(XmlTransient.class) != null ) {
return;
}