Examples of Bob2


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

     */
    BobWithSerializeMethod bobContainer = new BobWithSerializeMethod();
    Bob1 bob1 = new Bob1();
    bobContainer.setObject1(bob1);
    bobContainer.setNotPrimitiveValue(Integer.valueOf(10));
    Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    store.setRoot(bobContainer);
    store.save(false, false);
    Map<DataRecordIdentifier, String> map = objectClassMap(new DataRecordIdentifier[] {});
    objectIoManager.clearObjectState();
View Full Code Here

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

      FilePersistenceNotSerializableException,
      FilePersistenceTooBigForSerializationException {

    session.open();
    Bob1 bob1 = new Bob1();
    Bob2 bob2 = new Bob2();
    bob1.setBob2(bob2);
    session.setObject(BOB1, bob1);
    if (logger.debugEnabled) {
      logger.debug("initiale save");
    }
    session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
    int nbModified = filePersistence.getNumberOfModified();
    assertEquals("bad number of modified", 16, nbModified);
    int nbVisited = filePersistence.getNumberOfVisited();
    assertEquals("bad number of visited", 20, nbVisited);

    session.open();
    bob1 = (Bob1) session.getObject(BOB1);
    bob2 = bob1.getBob2();
    bob2.setVal(bob2.getVal() + 1);// modify state
    if (logger.debugEnabled) {
      logger.debug("save modification");
    }
    session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
    nbModified = filePersistence.getNumberOfModified();
View Full Code Here

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

  private BobContainer initialBobContainer() throws FilePersistenceException {
    final BobContainer bobContainer = new BobContainer();
    final Bob1 bob1 = new Bob1();
    bob1.setVal(1);
    bobContainer.setObject1(bob1);
    final Bob2 bob2 = new Bob2();
    bob2.setVal(1);
    bobContainer.setObject2(bob2);
    return (BobContainer) filePersistence.newProxyInstance(bobContainer);
  }
View Full Code Here

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

public abstract class AbstractSerializePerf {

  protected void test() throws Exception { // NOPMD
    final Bob1 bob1 = new Bob1();
    bob1.setVal(10);
    final Bob2 bob2 = new Bob2();
    bob2.setVal(15);
    bob2.setBob1(bob1);
    bob1.setBob2(bob2);
    final Bob3 bob3 = new Bob3();
    bob3.setVal(20);
    bob2.setBob3(bob3);
    bob3.setBob1(bob1);
    bob3.setBob2(bob2);
    bob1.setBob3(bob3);

    byte[] data = marshal(bob1);
View Full Code Here

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

    final Bob1 bob1a = new Bob1();
    root.setBob1(bob1a);
    final Bob1 bob1b = new Bob1();
    bob1a.setBob1(bob1b);
    bob1b.setBob1(root);
    final Bob2 bob2 = new Bob2();
    root.setBob2(bob2);
    bob1a.setBob2(bob2);
    final ObjectGraphCreator creator = ObjectGraphCreator.getInstance();
    final ObjectGraph graph = creator.create(root);
View Full Code Here

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

      FilePersistenceInvalidClassException,
      FilePersistenceDataCorruptedException,
      FilePersistenceNotSerializableException, ProxyException,
      FilePersistenceTooBigForSerializationException {
    filePersistence.setStoreSerializeInOneRecord(Bob2.class);
    IBob bob = new Bob2();
    session.open();
    session.setObject("bob", bob);
    session.close(EnumFilePersistenceCloseAction.SAVE);

    session.open();
View Full Code Here

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

      FilePersistenceTooBigForSerializationException {
    final IDataAccessSession session = filePersistence
        .createDataAccessSession();

    final Bob1 bob1 = new Bob1();
    final Bob2 bob2 = new Bob2();
    bob2.setVal(0);
    bob1.setBob2(bob2);
    final Bob3 bob3 = new Bob3();
    bob3.setVal(0);
    bob1.setBob3(bob3);
    bob1.setVal(0);

    session.open();
    session.setObject(KEY, bob1);
    session.close(EnumFilePersistenceCloseAction.SAVE);

    session.open();
    Bob1 bob1Read = (Bob1) session.getObject(KEY);
    assertEquals("bad state for val", 0, bob1Read.getVal());
    assertEquals("read must be equals to saved", bob1, bob1Read);
    bob1Read.setVal(1);
    session.close(EnumFilePersistenceCloseAction.SAVE);

    session.open();
    bob1Read = (Bob1) session.getObject(KEY);
    assertEquals("bad state for val", 1, bob1Read.getVal());
    assertFalse("read must not be equals to modified",
        bob1.equals(bob1Read));
    bob1Read.setVal(2);
    session.close(EnumFilePersistenceCloseAction.SAVE);

    session.open();
    bob1Read = (Bob1) session.getObject(KEY);
    assertEquals("bad state for val", 2, bob1Read.getVal());
    final Bob2 bob2Bis = new Bob2();
    bob2.setVal(1);
    bob1Read.setBob2(bob2Bis);
    final Bob3 bob3Bis = new Bob3();
    bob3.setVal(1);
    bob1Read.setBob3(bob3Bis);
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.