Package net.sf.joafip.entity.rel400

Examples of net.sf.joafip.entity.rel400.BobForAutoSaveInMethodTest


      FilePersistenceNotSerializableException,
      FilePersistenceTooBigForSerializationException {
    session.open();
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    saveDoneFlag = false;
    BobASDelegatingListenDelegate bob = BobASDelegatingListenDelegate
        .newInstance(instanceFactory);
    assertTrue(MUST_SAVE, saveDoneFlag);
    saveDoneFlag = false;
    bob.action();
    assertTrue(MUST_SAVE, saveDoneFlag);
    session.setObject(KEY, bob);
    bob = null;// NOPMD
    session.close();

    session.open();
    bob = (BobASDelegatingListenDelegate) session.getObject(KEY);
    bob.action();
    session.close();
  }
View Full Code Here


    session.open();
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    assertNotNull(MUST_HAS_INSTANCE_FACTORY, instanceFactory);
    saveDoneFlag = false;

    BobASDelegatingListenDelegate bob = new BobASDelegatingListenDelegate(
        instanceFactory);

    assertTrue(MUST_SAVE, saveDoneFlag);
    saveDoneFlag = false;
    bob.action();
    assertTrue(MUST_SAVE, saveDoneFlag);
    session.setObject(KEY, bob);
    bob = null;// NOPMD
    session.close();

    session.open();
    bob = (BobASDelegatingListenDelegate) session.getObject(KEY);
    bob.action();
    session.close();
  }
View Full Code Here

    session.open();
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    assertNotNull(MUST_HAS_INSTANCE_FACTORY, instanceFactory);
    saveDoneFlag = false;

    BobASDelegatingListenDelegate bob = BobASDelegatingListenDelegate
        .newInstance(instanceFactory);

    assertTrue(MUST_SAVE, saveDoneFlag);
    saveDoneFlag = false;
    bob.action();
    assertTrue(MUST_SAVE, saveDoneFlag);
    session.setObject(KEY, bob);
    bob = null;// NOPMD
    session.close();

    session.open();
    bob = (BobASDelegatingListenDelegate) session.getObject(KEY);
    bob.action();
    session.close();
  }
View Full Code Here

      FilePersistenceNotSerializableException,
      FilePersistenceTooBigForSerializationException, ProxyException {
    session.open();
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    assertNotNull(MUST_HAS_INSTANCE_FACTORY, instanceFactory);
    final BobASDelegatingListenDelegate bob = BobASDelegatingListenDelegate
        .newInstance(instanceFactory);
    assertTrue("must be a proxy", ProxyManager2.isProxyOrEnhanced(bob));
    assertTrue("must be unloaded", ProxyManager2.isUnloaded(bob));
    assertTrue("bad state saved", bob.isConstructed());
  }
View Full Code Here

      FilePersistenceTooBigForSerializationException, ProxyException {
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    assertNotNull(MUST_HAS_INSTANCE_FACTORY, instanceFactory);

    session.open();
    BobASDelegatingListenDelegate bob = BobASDelegatingListenDelegate
        .newInstance(instanceFactory);
    BobAsDelegateNotifyDelegating delegate = bob.getDelegate();
    final long delegateDataRecordIdentifier = ProxyManager2
        .getObjectAndPersistInfo(delegate).dataRecordIdentifier.value;
    bob = null;// NOPMD unreference
    session.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);

    session.open();
    delegate = (BobAsDelegateNotifyDelegating) session
        .getObject(delegateDataRecordIdentifier);
    bob = delegate.getBobASDelegatingListenDelegate();
    assertNotNull("bob is in bad state", bob.getDelegate());
  }
View Full Code Here

      FilePersistenceTooBigForSerializationException {

    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    session.open();
    saveDoneFlag = false;
    BobASWithTransientCaller bob = BobASWithTransientCaller.newInstance(
        instanceFactory, true);
    assertTrue(MUST_SAVE, saveDoneFlag);
    saveDoneFlag = false;
    bob.action();
    assertTrue(MUST_SAVE, saveDoneFlag);
    session.setObject(KEY, bob);
    bob = null;// NOPMD
    session.close();

    session.open();
    bob = (BobASWithTransientCaller) session.getObject(KEY);
    bob.action();
    session.close();
  }
View Full Code Here

      FilePersistenceNotSerializableException,
      FilePersistenceTooBigForSerializationException {
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    session.open();
    saveDoneFlag = false;
    BobASWithTransientCaller bob = BobASWithTransientCaller.newInstance(
        instanceFactory, false);
    assertTrue(MUST_SAVE, saveDoneFlag);
    saveDoneFlag = false;
    bob.action();
    assertTrue(MUST_SAVE, saveDoneFlag);
    session.setObject(KEY, bob);
    bob = null;// NOPMD
    session.close();

    session.open();
    bob = (BobASWithTransientCaller) session.getObject(KEY);
    bob.action();
    session.close();
  }
View Full Code Here

    assertNotNull(MUST_HAS_INSTANCE_FACTORY, instanceFactory);

    session.open();
    BobASDelegatingListenDelegate bob = BobASDelegatingListenDelegate
        .newInstance(instanceFactory);
    BobAsDelegateNotifyDelegating delegate = bob.getDelegate();
    final long delegateDataRecordIdentifier = ProxyManager2
        .getObjectAndPersistInfo(delegate).dataRecordIdentifier.value;
    bob = null;// NOPMD unreference
    session.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);

    session.open();
    delegate = (BobAsDelegateNotifyDelegating) session
        .getObject(delegateDataRecordIdentifier);
    bob = delegate.getBobASDelegatingListenDelegate();
    assertNotNull("bob is in bad state", bob.getDelegate());
  }
View Full Code Here

      FilePersistenceDataCorruptedException,
      FilePersistenceNotSerializableException,
      FilePersistenceTooBigForSerializationException, ProxyException {
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    session.open();
    BobForAutoSaveInMethodTest bob = BobForAutoSaveInMethodTest
        .newInstance(instanceFactory);
    assertEquals("bad initial state", 0, bob.getValue());
    saveDoneFlag = false;
    int expectedIncrement = 1;
    for (int count = 0; count < 5; count++) {
      bob.incrementValue();
      assertTrue(MUST_SAVE, saveDoneFlag);
      assertTrue("must be unloaded", ProxyManager2.isUnloaded(bob));
      assertEquals("bad state", expectedIncrement, bob.getValue());
      expectedIncrement++;
    }
    session.setObject(KEY, bob);
    session.close();

    session.open();
    bob = (BobForAutoSaveInMethodTest) session.getObject(KEY);
    assertEquals("bad state", expectedIncrement - 1, bob.getValue());
    session.close();

  }
View Full Code Here

    final Bob1 bob1 = (Bob1) instanceFactory.newInstance(Bob1.class);
    session.save();
    assertFalse("must not be loaded",
        ProxyManager2.proxiedObjectIsLoaded(bob1));
    saveDoneFlag = false;
    final BobForAutoSaveWhenConstructTest bobForAutoSaveTest = (BobForAutoSaveWhenConstructTest) instanceFactory
        .newInstance(BobForAutoSaveWhenConstructTest.class,
            new Class[] { Bob1.class }, new Object[] { bob1 });
    assertTrue(MUST_SAVE, saveDoneFlag);
    session.setObject(KEY, bobForAutoSaveTest);
    session.close();
View Full Code Here

TOP

Related Classes of net.sf.joafip.entity.rel400.BobForAutoSaveInMethodTest

Copyright © 2018 www.massapicom. 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.