Examples of Bob2


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

    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);
View Full Code Here

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

    storeForTest.setRoot(rootBob1);
    rootBob1.setBob1(new Bob1());
    // use storeForTest.newInstance(Bob2.class) because rootBob1 will be
    // never unreferenced
    // Bob2 bob2RefByRootBob1 = new Bob2();
    Bob2 bob2RefByRootBob1 = (Bob2) storeForTest.newInstance(Bob2.class);
    Bob3 bob3RefByBob2RefByRootBob1 = new Bob3();
    bob2RefByRootBob1.setBob3(bob3RefByBob2RefByRootBob1);
    rootBob1.setBob2(bob2RefByRootBob1);
    rootBob1.setBob3(new Bob3());
    rootBob1 = null;// NOPMD want to unreference
    // save not for close
    storeForTest.save(false, false);
    final ObjectAndPersistInfo opiBob3 = storeForTest
        .getObjectAndPersistInfoOfObjectFromQueue(bob3RefByBob2RefByRootBob1);
    assertTrue("must be weaked", opiBob3.isWeak());
    bob2RefByRootBob1 = null;// NOPMD want to unreference
    rootBob1 = null;// NOPMD want to unreference
    bob3RefByBob2RefByRootBob1 = null;// NOPMD want to unreference
    storeForTest.save(false, false);
    assertTrue("must be weaked", opiBob3.isWeak());
    MemoryEater.useAllMemoryThenRelease();
    assertTrue("must be free", opiBob3.hasNoReferences());

    rootBob1 = (Bob1) storeForTest.readAndGetRoot();
    assertNotNull("must be set", rootBob1.getBob1());// NOPMD
    bob2RefByRootBob1 = rootBob1.getBob2();
    assertNotNull("must be set", bob2RefByRootBob1);
    assertNotNull("must be set", rootBob1.getBob3());
    // not below assert because load bob2RefByRootBob1
    // assertNotNull("must be set", bob2RefByRootBob1.getBob3());

    // test can not work with bob1 because read of root record
    // assertTrue("must be a proxy: "+bob1.getClass(),
    // ProxyManager2.isProxyOrEnhanced(bob1));
    // assertTrue("must be loaded",
    // ProxyManager2.proxiedObjectIsLoaded(bob1));

    assertTrue("must be a proxy: " + bob2RefByRootBob1.getClass(),
        ProxyManager2.isProxyOrEnhanced(bob2RefByRootBob1));
    assertFalse("must be unloaded",
        ProxyManager2.proxiedObjectIsLoaded(bob2RefByRootBob1));
    bob2RefByRootBob1.getBob1();
    assertTrue("must be loaded",
        ProxyManager2.proxiedObjectIsLoaded(bob2RefByRootBob1));

    /*
     * can not assert below because rootBob1 is the initial created instance
View Full Code Here

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

     * creation of object graph
     */
    BobContainer bobContainer = new BobContainer();
    Bob1 bob1 = new Bob1();
    bobContainer.setObject1(bob1);
    Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    store.setRoot(bobContainer);
    store.save(true, false);
    logger.debug("initial save");

View Full Code Here

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

    store.setRoot(bob1);
    store.save(true, false);
    assertEquals("no more object state expected", 0,
        store.getNumberOfObjectState());
    bob1 = (Bob1) store.readAndGetRoot();
    final Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    bob2.setVal(1);
    final Bob3 bob3 = new Bob3();
    bob3.setVal(2);
    bob2.setBob3(bob3);

    store.save(true, false);
    assertEquals("no more object state expected", 0,
        store.getNumberOfObjectState());
    // store.checkIntegrity();
View Full Code Here

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

    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    final Bob1 bob1Lu = (Bob1) store.readAndGetRoot();
    assertNotNull(MUST_FIND_OBJECT, bob1Lu);

    final Bob2 bob2 = new Bob2();
    bob1Lu.setBob2(bob2);
    bob2.setVal(1);
    final Bob3 bob3 = new Bob3();
    bob3.setVal(2);
    bob2.setBob3(bob3);

    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
View Full Code Here

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

      StoreNotSerializableException, StoreClassNotFoundException,
      StoreDataCorruptedException {
    Bob1 bob1Lu;
    bob1Lu = (Bob1) store.readAndGetRoot();
    assertNotNull(MUST_FIND_OBJECT, bob1Lu);
    final Bob2 bob2Lu = bob1Lu.getBob2();
    assertNotNull("read bob1 must contains bob2", bob2Lu);
    assertNotSame("read bob2 must be a copy", bob2, bob2Lu);
    assertEquals(BAD_VALUE, 1, bob2.getVal());
    final Bob3 bob3Lu = bob2Lu.getBob3();
    assertNotNull("read bob2 must contains bob3", bob3Lu);
    assertNotSame("read bob3 must be a copy", bob3, bob3Lu);
    assertEquals(BAD_VALUE, 2, bob3.getVal());
  }
View Full Code Here

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

      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      HeapException, StoreTooBigForSerializationException {
    final Bob1 bob1 = new Bob1();
    bob1.setVal(0);
    final Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    bob2.setVal(1);
    final Bob3 bob3 = new Bob3();
    bob2.setBob3(bob3);
    bob3.setVal(2);
    bob3.setBob1(bob1);
    bob3.setBob2(bob2);
    store.setRoot(bob1);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    final Bob1 bob1Lu = (Bob1) store.readAndGetRoot();
    assertNotNull(MUST_FIND_OBJECT, bob1Lu);
    final Bob2 Bob2Lu = bob1Lu.getBob2();
    /* Bob2Lu.getVal() should load object */
    assertEquals("read bob2 value must be 1", 1, Bob2Lu.getVal());
    final Bob3 bob3Lu = Bob2Lu.getBob3();
    assertEquals("read bob3 value must be 2", 2, bob3Lu.getVal());
    assertSame("must be same object", bob1Lu, bob3Lu.getBob1());
    assertSame("must be same object", Bob2Lu, bob3Lu.getBob2());
  }
View Full Code Here

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

  public void testAlreadyLoaded() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      HeapException, StoreTooBigForSerializationException {
    final Bob1 bob1 = new Bob1();
    final Bob2 bob2 = new Bob2();
    final Bob3 bob3 = new Bob3();
    bob1.setBob2(bob2);
    bob1.setBob3(bob3);
    bob2.setBob3(bob3);

    bob1.setVal(1);
    bob2.setVal(2);
    bob3.setVal(3);

    store.setRoot(bob1);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    final Bob1 bob1Lu = (Bob1) store.readAndGetRoot();
    assertNotNull(MUST_FIND_OBJECT, bob1Lu);
    final Bob3 bob3Lu = bob1Lu.getBob3();
    final Bob2 bob2Lu = bob1Lu.getBob2();
    final Bob3 bob3LuBis = bob2Lu.getBob3();
    assertEquals("value for read bob1 must be 1", 1, bob1Lu.getVal());
    assertEquals("value for read bob2 must be 2", 2, bob2Lu.getVal());
    assertEquals("value for read bob3 must be 3", 3, bob3Lu.getVal());
    assertEquals("value for second read of bob3 must be 3", 3,
        bob3LuBis.getVal());
    bob3Lu.setVal(0);
    assertEquals("must also change second read of bob3", 0,
View Full Code Here

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

  @SuppressWarnings("PMD")
  public void testObjectCycle() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException {
    final Bob1 bob1 = new Bob1();
    final Bob2 bob2 = new Bob2();
    bob2.setBob1(bob1);
    bob1.setBob2(bob2);
    final Bob3 bob3 = new Bob3();
    bob3.setBob1(bob1);
    bob3.setBob2(bob2);
    store.setRoot(bob1);
View Full Code Here

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

  public void testAddLink() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      StoreTooBigForSerializationException {
    final Bob1 bob1 = new Bob1();
    final Bob2 bob2 = new Bob2();
    final Bob3 bob3 = new Bob3();
    bob1.setBob3(bob3);
    bob1.setBob2(bob2);
    store.setRoot(bob1);
    store.save(true, false);

    final Bob1 bob1Lu = (Bob1) store.readAndGetRoot();
    final Bob2 bob2Lu = bob1Lu.getBob2();
    final Bob3 bob3Lu = bob1Lu.getBob3();
    bob2Lu.setBob3(bob3Lu);
    store.save(true, false);
    assertNotNull(ROOT_MUST_BE_DEFINED, store.readAndGetRoot());// for
    // PMD
    // warning
  }
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.