Examples of BobObjectArray


Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

      ObjectIODataRecordNotFoundException, StoreInvalidClassException,
      StoreNotSerializableException, StoreClassNotFoundException,
      StoreDataCorruptedException, ObjectIOClassNotFoundException,
      ObjectIODataCorruptedException, HeapException,
      StoreTooBigForSerializationException {
    BobObjectArray bobObjectArray = new BobObjectArray();
    store.setRoot(bobObjectArray);
    store.save(true, false);
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
    bobObjectArray = (BobObjectArray) store.readAndGetRoot();
    DataRecordIdentifier idObjectArray = store
        .getDataRecordIdentifierAssociatedToObject(bobObjectArray);
    assertNotNull("bobObjectArray must have data record identifier",
        idObjectArray);
    Object[] objects = bobObjectArray.getValues();
    assertNull("no values must be setted", objects);
    assertObjectLink(BobObjectArray.class, idObjectArray,
        new DataRecordIdentifier[] {});

    Bob1 bob1 = new Bob1();
    Bob2 bob2 = new Bob2();
    objects = new Object[] { bob1, bob2, bob1 };
    bobObjectArray.setValues(objects);
    store.save(true, false);
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    bobObjectArray = (BobObjectArray) store.readAndGetRoot();
    idObjectArray = store
        .getDataRecordIdentifierAssociatedToObject(bobObjectArray);
    assertNotNull("bobObjectArray must have data record identifier",
        idObjectArray);
    objects = bobObjectArray.getValues();
    assertNotNull("values be setted", objects);
    final DataRecordIdentifier idArray = store
        .getDataRecordIdentifierAssociatedToObject(objects);
    assertNotNull("array must have data record identifier", idArray);
    bob1 = (Bob1) objects[0];
View Full Code Here

Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

    assertEquals("copy failed", set, setCopy);
  }

  public void testCopyToProxyWithArrayOfObject() throws CopierException,
      ProxyException, ClassInfoException {
    final BobObjectArray source = new BobObjectArray();
    Object[] sourceValues = new Object[4];
    sourceValues[0] = Integer.valueOf(0);
    sourceValues[1] = "hello";
    sourceValues[2] = EnumForTest.VAL1;
    sourceValues[3] = new BobString("luc");
    source.setValues(sourceValues);
    final Object copy;
    if (useJavaAgent) {
      copy = DeepCopier.getInstance().deepCopy(source, this, true);
    } else {
      copy = ToProxyDeepCopier.getInstance().deepCopy(source, this, true);
View Full Code Here

Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

    assertEquals("must be equals", source, copy);
    assertNotSame(MUST_NOT_BE_SAME_INSTANCE, source, copy);
  }

  public void testDeepCopyWithArrayOfObject() throws CopierException {
    final BobObjectArray source = new BobObjectArray();
    Object[] sourceValues = new Object[4];
    sourceValues[0] = Integer.valueOf(0);
    sourceValues[1] = "hello";
    sourceValues[2] = EnumForTest.VAL1;
    sourceValues[3] = new BobString("luc");
    source.setValues(sourceValues);
    final Object copy = DeepCopier.getInstance().deepCopy(source, this,
        true);
    assertEquals("bad class", BobObjectArray.class, copy.getClass());
    assertNotSame(MUST_NOT_BE_SAME_INSTANCE, source, copy);
    final Object[] copyValue = ((BobObjectArray) copy).getValues();
View Full Code Here

Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

      FilePersistenceDataCorruptedException,
      FilePersistenceNotSerializableException, SecurityException,
      NoSuchMethodException {

    dataAccessSession.open();
    final BobObjectArray bobObjectArray = initialBobObjectArray();
    dataAccessSession.setObject(KEY, bobObjectArray);
    final Bob1[] values = (Bob1[]) bobObjectArray.getValues();
    Bob1 bob1 = values[0];
    saveDone = false;
    int value = bob1.getVal();
    assertSaved();
    assertEquals(BAD_VALUE, 10, value);
    bob1 = newBob1();
    // values[1] = bob1; //can't do that
    bobObjectArray.setValue(1, bob1);
    saveDone = false;
    value = bob1.getVal();
    assertSaved();
    assertEquals(BAD_VALUE, 20, value);
  }
View Full Code Here

Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

    assertEquals(BAD_VALUE, 20, value);
  }

  private BobObjectArray initialBobObjectArray()
      throws FilePersistenceException {
    final BobObjectArray bobObjectArray = new BobObjectArray();
    final Bob1[] bob1Array = new Bob1[2];
    bobObjectArray.setValues(bob1Array);
    bob1Array[0] = new Bob1();
    bob1Array[0].setVal(10);
    // return useJavaAgent ? bobObjectArray : (BobObjectArray)
    // filePersistence
    // .newProxyInstance(bobObjectArray);
View Full Code Here

Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

      FilePersistenceTooBigForSerializationException, TestException {

    initialize();

    dataAccessSession.open();
    BobObjectArray bobObjectArray = initialBobObjectArray();
    dataAccessSession.setObject(KEY, bobObjectArray);
    dataAccessSession.save();
    bobObjectArray = (BobObjectArray) dataAccessSession.getObject(KEY);
    final Bob1[] values = (Bob1[]) bobObjectArray.getValues();
    Bob1 bob1 = values[0];
    clearSaveDone();
    int value = bob1.getVal();
    assertSaved();
    assertEquals(BAD_VALUE, 10, value);
    bob1 = newBob1();
    // values[1] = bob1; //can't do that
    bobObjectArray.setValue(1, bob1);
    clearSaveDone();
    value = bob1.getVal();
    assertSaved();
    assertEquals(BAD_VALUE, 20, value);
  }
View Full Code Here

Examples of net.sf.joafip.store.service.objectfortest.BobObjectArray

    assertEquals(BAD_VALUE, 20, value);
  }

  private BobObjectArray initialBobObjectArray()
      throws FilePersistenceException {
    final BobObjectArray bobObjectArray = new BobObjectArray();
    final Bob1[] bob1Array = new Bob1[2];
    bobObjectArray.setValues(bob1Array);
    bob1Array[0] = new Bob1();
    bob1Array[0].setVal(10);
    return (BobObjectArray) filePersistence
        .newProxyInstance(bobObjectArray);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.