Exemplo n.º 1
0
 /**
  * todo: Move the GenericClass creation into a utility/factory class.
  *
  * @return
  */
 public GenericClass initGenericClass() {
   GenericReflector reflector =
       new GenericReflector(null, Platform4.reflectorForType(GenericObjectsTest.class));
   GenericClass _objectIClass = (GenericClass) reflector.forClass(Object.class);
   GenericClass result = new GenericClass(reflector, null, PERSON_CLASSNAME, _objectIClass);
   result.initFields(fields(result, reflector));
   return result;
 }
Exemplo n.º 2
0
 private Object initGenericObjects() {
   GenericClass personClass = initGenericClass();
   ReflectField surname = personClass.getDeclaredField("surname");
   ReflectField birthdate = personClass.getDeclaredField("birthdate");
   // ReflectField nArray = personClass.getDeclaredField("nArray");
   Object person = personClass.newInstance();
   surname.set(person, "John");
   //		/int[][] arrayData = new int[2][2];
   // todo: FIXME: nArray doesn't work
   // nArray.set(person, arrayData);
   birthdate.set(person, new Date());
   fixture().db().store(person);
   fixture().db().commit();
   return person;
 }