Package net.sf.joafip.entity.rel400

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


      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

    final IExclusiveDataAccessSession session = filePersistence
        .createExclusiveDataAccessSession();
    session.open();
    final IInstanceFactory instanceFactory = session.getInstanceFactory();

    final Element element = Element.newInstance(instanceFactory);
    element.addNameSpace(HELLO);
    final Element clone = element.clone();
    List<String> list = clone.getAdditionalNamespaces();
    assertEquals(BAD_CONTENT, HELLO, list.get(0));
    list = clone.getAdditionalNamespacesList();
    assertEquals(BAD_CONTENT, HELLO, list.get(0));

    session.close();
    filePersistence.close();
  }
View Full Code Here

      FilePersistenceTooBigForSerializationException {

    IFilePersistence filePersistence = createFilePersistence(true);
    IDataAccessSession session = filePersistence.createDataAccessSession();
    session.open();
    Item item = new Item(0, "value");
    session.setObject("key", item);
    session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
    filePersistence.close();

    filePersistence = createFilePersistence(false);
    session = filePersistence.createDataAccessSession();
    session.open();
    item = (Item) session.getObject("key");
    assertEquals("bad state", 0, item.getIdentifier());
    assertEquals("bad state", "value", item.getValue());
    session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
    filePersistence.close();
  }
View Full Code Here

TOP

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

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.