Examples of Bob2


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

    BobWithSerializeMethod.unshared = false;
    final BobWithSerializeMethod bobWithSerializeMethod = new BobWithSerializeMethod();
    final BobContainer bobContainer = new BobContainer();
    bobContainer.setObject1(bobWithSerializeMethod);
    bobWithSerializeMethod.setObject1(bobContainer);
    final Bob2 bob2 = new Bob2();
    bobWithSerializeMethod.setObject2(bob2);
    final Object[] referenceds = new Object[] { bobContainer, bob2 };
    return new ObjectAndReferenced(bobWithSerializeMethod, referenceds);
  }
View Full Code Here

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

    /* check only StoreRoot referencing bob1 */
    assertReferencing(dataRecordIdentifierForBob1,
        new DataRecordIdentifier[] { StoreForTest.IDENTIFIER_FOR_ROOT });

    /* add bob1 --> bob2 */
    Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    store.save(true, false);

    /* check bob1 --> bob2 */
    assertRef1();

    /* add bob1 --> bob3 */
    bob1 = (Bob1) store.readAndGetRoot();
    Bob3 bob3 = new Bob3();
    bob1.setBob3(bob3);
    store.save(true, false);

    /* check bob1 --> bob2, bob1 --> bob3 */
    assertRef2();

    /* add bob2 --> bob1 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob2 = bob1.getBob2();
    bob2.setBob1(bob1);
    store.save(true, false);

    /* check bob1 --> bob2, bob1 --> bob3,bob2 --> bob1 */
    assertRef3();

    /* add bob2 --> bob3 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob2 = bob1.getBob2();
    bob3 = bob1.getBob3();
    bob2.setBob3(bob3);
    store.save(true, false);

    /* check bob1 --> bob2, bob1 --> bob3,bob2 --> bob1,bob2 --> bob3 */
    assertRef4();

    /* add bob3 --> bob1 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob3 = bob1.getBob3();
    bob3.setBob1(bob1);
    store.save(true, false);

    /*
     * check bob1 --> bob2, bob1 --> bob3, bob2 --> bob1, bob2 --> bob3,
     * bob3 --> bob1
     */
    assertRef5();

    /* add bob3 --> bob2 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob2 = bob1.getBob2();
    bob3 = bob1.getBob3();
    bob3.setBob2(bob2);
    store.save(true, false);

    /*
     * check bob1 --> bob2, bob1 --> bob3, bob2 --> bob1, bob2 --> bob3,
     * bob3 --> bob1, bob3 --> bob2
     */
    assertRef6();

    /* remove bob3 --> bob2 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob3 = bob1.getBob3();
    bob3.setBob2(null);
    store.save(true, false);

    /*
     * check bob1 --> bob2, bob1 --> bob3, bob2 --> bob1, bob2 --> bob3,
     * bob3 --> bob1
     */
    assertRef5();

    /* remove bob3 --> bob1 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob3 = bob1.getBob3();
    bob3.setBob1(null);
    store.save(true, false);

    /* check bob1 --> bob2, bob1 --> bob3,bob2 --> bob1,bob2 --> bob3 */
    assertRef4();

    /* remove bob2 --> bob3 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob2 = bob1.getBob2();
    bob2.setBob3(null);
    store.save(true, false);

    /* check bob1 --> bob2, bob1 --> bob3,bob2 --> bob1 */
    assertRef3();

    /* remove bob2 --> bob1 */
    bob1 = (Bob1) store.readAndGetRoot();
    bob2 = bob1.getBob2();
    bob2.setBob1(null);
    store.save(true, false);

    /* check bob1 --> bob2, bob1 --> bob3 */
    assertRef2();

 
View Full Code Here

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

      StoreClassNotFoundException, StoreInvalidClassException,
      StoreDataCorruptedException, StoreNotSerializableException,
      ReferenceLinkGarbageException {
    final Bob1 bob1 = (Bob1) store.readAndGetRoot();
    final DataRecordIdentifier dataRecordIdentifierForBob1 = getDataRecordIdentifier(bob1);
    final Bob2 bob2 = bob1.getBob2();
    final DataRecordIdentifier dataRecordIdentifierForBob2 = getDataRecordIdentifier(bob2);

    /* check only StoreRoot referencing bob1 */
    assertReferencing(dataRecordIdentifierForBob1,
        new DataRecordIdentifier[] { StoreForTest.IDENTIFIER_FOR_ROOT });
View Full Code Here

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

      StoreClassNotFoundException, StoreInvalidClassException,
      StoreDataCorruptedException, StoreNotSerializableException,
      ReferenceLinkGarbageException {
    final Bob1 bob1 = (Bob1) store.readAndGetRoot();
    final DataRecordIdentifier dataRecordIdentifierForBob1 = getDataRecordIdentifier(bob1);
    final Bob2 bob2 = bob1.getBob2();
    final DataRecordIdentifier dataRecordIdentifierForBob2 = getDataRecordIdentifier(bob2);
    final Bob3 bob3 = bob1.getBob3();
    final DataRecordIdentifier dataRecordIdentifierForBob3 = getDataRecordIdentifier(bob3);

    /* check only StoreRoot referencing bob1 */
 
View Full Code Here

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

      StoreClassNotFoundException, StoreInvalidClassException,
      StoreDataCorruptedException, StoreNotSerializableException,
      ReferenceLinkGarbageException {
    final Bob1 bob1 = (Bob1) store.readAndGetRoot();
    final DataRecordIdentifier dataRecordIdentifierForBob1 = getDataRecordIdentifier(bob1);
    final Bob2 bob2 = bob1.getBob2();
    final DataRecordIdentifier dataRecordIdentifierForBob2 = getDataRecordIdentifier(bob2);
    final Bob3 bob3 = bob1.getBob3();
    final DataRecordIdentifier dataRecordIdentifierForBob3 = getDataRecordIdentifier(bob3);

    assertSame(MUST_BE_SAME_INSTANCE, bob1, bob2.getBob1());

    /* bob2 referencing bob1 */
    assertReferencing(dataRecordIdentifierForBob1,
        new DataRecordIdentifier[] { dataRecordIdentifierForBob2,
            StoreForTest.IDENTIFIER_FOR_ROOT });
View Full Code Here

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

      StoreClassNotFoundException, StoreInvalidClassException,
      StoreDataCorruptedException, StoreNotSerializableException,
      ReferenceLinkGarbageException {
    final Bob1 bob1 = (Bob1) store.readAndGetRoot();
    final DataRecordIdentifier dataRecordIdentifierForBob1 = getDataRecordIdentifier(bob1);
    final Bob2 bob2 = bob1.getBob2();
    final DataRecordIdentifier dataRecordIdentifierForBob2 = getDataRecordIdentifier(bob2);
    final Bob3 bob3 = bob1.getBob3();
    final DataRecordIdentifier dataRecordIdentifierForBob3 = getDataRecordIdentifier(bob3);

    assertSame(MUST_BE_SAME_INSTANCE, bob1, bob2.getBob1());
    assertSame(MUST_BE_SAME_INSTANCE, bob3, bob2.getBob3());

    /* bob2 referencing bob1 */
    assertReferencing(dataRecordIdentifierForBob1,
        new DataRecordIdentifier[] { dataRecordIdentifierForBob2,
            StoreForTest.IDENTIFIER_FOR_ROOT });
View Full Code Here

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

      StoreClassNotFoundException, StoreInvalidClassException,
      StoreDataCorruptedException, StoreNotSerializableException,
      ReferenceLinkGarbageException {
    final Bob1 bob1 = (Bob1) store.readAndGetRoot();
    final DataRecordIdentifier dataRecordIdentifierForBob1 = getDataRecordIdentifier(bob1);
    final Bob2 bob2 = bob1.getBob2();
    final DataRecordIdentifier dataRecordIdentifierForBob2 = getDataRecordIdentifier(bob2);
    final Bob3 bob3 = bob1.getBob3();
    final DataRecordIdentifier dataRecordIdentifierForBob3 = getDataRecordIdentifier(bob3);

    assertSame(MUST_BE_SAME_INSTANCE, bob1, bob2.getBob1());
    assertSame(MUST_BE_SAME_INSTANCE, bob3, bob2.getBob3());
    assertSame(MUST_BE_SAME_INSTANCE, bob1, bob3.getBob1());

    /* bob2 referencing bob1, bob3 referencing bob1 */
    assertReferencing(dataRecordIdentifierForBob1,
        new DataRecordIdentifier[] { dataRecordIdentifierForBob2,
View Full Code Here

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

      StoreClassNotFoundException, StoreInvalidClassException,
      StoreDataCorruptedException, StoreNotSerializableException,
      ReferenceLinkGarbageException {
    final Bob1 bob1 = (Bob1) store.readAndGetRoot();
    final DataRecordIdentifier dataRecordIdentifierForBob1 = getDataRecordIdentifier(bob1);
    final Bob2 bob2 = bob1.getBob2();
    final DataRecordIdentifier dataRecordIdentifierForBob2 = getDataRecordIdentifier(bob2);
    final Bob3 bob3 = bob1.getBob3();
    final DataRecordIdentifier dataRecordIdentifierForBob3 = getDataRecordIdentifier(bob3);

    assertSame(MUST_BE_SAME_INSTANCE, bob1, bob2.getBob1());
    assertSame(MUST_BE_SAME_INSTANCE, bob3, bob2.getBob3());
    assertSame(MUST_BE_SAME_INSTANCE, bob1, bob3.getBob1());
    assertSame(MUST_BE_SAME_INSTANCE, bob2, bob3.getBob2());

    /* bob2 referencing bob1, bob3 referencing bob1 */
    assertReferencing(dataRecordIdentifierForBob1,
 
View Full Code Here

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

  }

  public void setProxyObjectState(
      final ObjectAndPersistInfo objectAndItsClassInfo)
      throws ObjectIOException, ObjectIODataRecordNotFoundException {
    ((Bob1) objectAndItsClassInfo.getObject()).bob2 = new Bob2();
  }
View Full Code Here

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

    DataRecordIdentifier id1 = store
        .getDataRecordIdentifierAssociatedToObject(bob1);
    assertNotNull(BOB1_MUST_HAVE_DATA_RECORD_IDENTIFIER, id1);
    assertObjectLink(Bob1.class, id1, new DataRecordIdentifier[] {});

    Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    store.save(true, false);

    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    bob1 = (Bob1) store.readAndGetRoot();
    id1 = store.getDataRecordIdentifierAssociatedToObject(bob1);
    assertNotNull(BOB1_MUST_HAVE_DATA_RECORD_IDENTIFIER, id1);
    bob2 = bob1.getBob2();
    assertNotNull("bob1 must reference bob2", bob2);
    DataRecordIdentifier id2 = store
        .getDataRecordIdentifierAssociatedToObject(bob2);
    assertNotNull(BOB2_MUST_HAVE_DATA_RECORD_IDENTIFIER, id2);
    assertObjectLink(Bob1.class, id1, new DataRecordIdentifier[] { id2 });
    assertObjectLink(Bob2.class, id2, new DataRecordIdentifier[] {});

    bob2.setBob1(bob1);
    store.save(true, false);

    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    bob1 = (Bob1) store.readAndGetRoot();
    id1 = store.getDataRecordIdentifierAssociatedToObject(bob1);
    assertNotNull(BOB1_MUST_HAVE_DATA_RECORD_IDENTIFIER, id1);
    bob2 = bob1.getBob2();
    id2 = store.getDataRecordIdentifierAssociatedToObject(bob2);
    assertNotNull(BOB2_MUST_HAVE_DATA_RECORD_IDENTIFIER, id2);
    assertObjectLink(Bob1.class, id1, new DataRecordIdentifier[] { id2 });
    assertObjectLink(Bob2.class, id2, new DataRecordIdentifier[] { id1 });

    Bob3 bob3 = new Bob3();
    bob2.setBob3(bob3);
    store.save(true, false);

    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    bob1 = (Bob1) store.readAndGetRoot();
    id1 = store.getDataRecordIdentifierAssociatedToObject(bob1);
    assertNotNull(BOB1_MUST_HAVE_DATA_RECORD_IDENTIFIER, id1);
    bob2 = bob1.getBob2();
    id2 = store.getDataRecordIdentifierAssociatedToObject(bob2);
    assertNotNull(BOB2_MUST_HAVE_DATA_RECORD_IDENTIFIER, id2);
    bob3 = bob2.getBob3();
    final DataRecordIdentifier id3 = store
        .getDataRecordIdentifierAssociatedToObject(bob3);
    assertNotNull("bob3 must have data record identifier", id3);

    assertObjectLink(Bob1.class, id1, new DataRecordIdentifier[] { id2 });
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.