Examples of BobIntegerArray


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

  public void testEmptyArray() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      HeapException, StoreTooBigForSerializationException {// NOPMD
    logger.info("testEmptyArray");
    final BobIntegerArray bobArray = new BobIntegerArray();
    store.setRoot(bobArray);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
    assertNotNull(ROOT_MUST_BE_DEFINED, store.readAndGetRoot());// for
View Full Code Here

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

  public void testNotEmptyArray() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      HeapException, StoreTooBigForSerializationException {
    logger.info("testNotEmptyArray2");
    final BobIntegerArray bobArray = new BobIntegerArray();
    final int[] originalValues = new int[] { 1, 2, 3 };
    bobArray.setValues(originalValues);
    store.setRoot(bobArray);
    store.save(true, false);
    BobIntegerArray read = (BobIntegerArray) store.readAndGetRoot();
    assertNotSame("must be a new instance", bobArray, read);
    assertNotNull(MUST_HAVE_ROOT, read);
    final int[] values = read.getValues();
    assertTrue("arrays fiels must have same values",// NOPMD
        /**/Arrays.equals(originalValues, values));
    logSize("after set root");
    read.setValues(null);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
    read = (BobIntegerArray) store.readAndGetRoot();
    assertNotNull(MUST_HAVE_ROOT, read);
    assertNull("values must be null", read.getValues());
    logSize("after modification");
  }
View Full Code Here

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

  public void testArraySizeChange() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      HeapException, StoreTooBigForSerializationException {
    logger.info("testNotEmptyArray3");
    final BobIntegerArray bobArray = new BobIntegerArray();
    store.setRoot(bobArray);
    final int[] originalValues = new int[] { 1, 2 };
    bobArray.setValues(originalValues);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
    final long sizeFor2 = store.usedSize();

    BobIntegerArray read = (BobIntegerArray) store.readAndGetRoot();
    final int[] newValues = new int[] { 1, 2, 3, 4, 5, 6 };
    read.setValues(newValues);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
    final long sizeForALot = store.usedSize();
    read = (BobIntegerArray) store.readAndGetRoot();
    assertTrue("arrays must be equals",// NOPMD
        /**/Arrays.equals(newValues, read.getValues()));
    /* may be failed because not data wrote under minimum data record size */
    assertTrue("memory used must increase", sizeForALot > sizeFor2);
  }
View Full Code Here

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

  public void testUnlinkArray() throws StoreException,
      StoreInvalidClassException, StoreNotSerializableException,
      StoreClassNotFoundException, StoreDataCorruptedException,
      HeapException, StoreTooBigForSerializationException {
    BobIntegerArray bobArray = new BobIntegerArray();
    store.setRoot(bobArray);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    bobArray = (BobIntegerArray) store.readAndGetRoot();
    bobArray.setValues(new int[] { 1, 2, 3 });
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);

    bobArray = (BobIntegerArray) store.readAndGetRoot();
    bobArray.setValues(null);
    store.save(true, false);
    // store.checkIntegrity();
    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
    assertNotNull(ROOT_MUST_BE_DEFINED, store.readAndGetRoot());// for
    // PMD
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.