Package net.sf.joafip.store.service.heaprecordable

Examples of net.sf.joafip.store.service.heaprecordable.HeapRecordableManager


  @Override
  protected void setUp() throws Exception {// NOPMD
    super.setUp();
    final HelperBinaryConversion helperBinaryConversion = new HelperBinaryConversion();
    heapRecordableManager = new HeapRecordableManager(dataManager);
    storeHeader = new StoreHeader(heapRecordableManager,
        helperBinaryConversion);
    // garbageCandidateRecordManager = new GarbageCandidateRecordManager(
    // storeHeader, heapRecordableManager, helperBinaryConversion);
    // toGarbageRecordManager = new ToGarbageRecordManager(storeHeader,
View Full Code Here


    // before 1000 create in the test, after used by manager
    dataManager.setNextFreeDataRecordIdentifier(new DataRecordIdentifier(
        1000));
    dataManager.flush();

    final HeapRecordableManager heapRecordableManager = new HeapRecordableManager(
        dataManager);
    final HelperBinaryConversion helperBinaryConversion =
    /**/new HelperBinaryConversion();
    final StoreHeader storeHeader = new StoreHeader(heapRecordableManager,
        helperBinaryConversion);
View Full Code Here

  @Override
  protected void setUp() throws Exception {// NOPMD
    super.setUp();
    dataManager = new HeapMemoryDataManagerMock();
    final HeapRecordableManager heapRecordableManager = new HeapRecordableManager(
        dataManager);
    final HelperBinaryConversion helperBinaryConversion = new HelperBinaryConversion();
    final StoreHeader storeHeader = new StoreHeader(heapRecordableManager,
        helperBinaryConversion);
    final LinkRecordManager linkRecordManager = new LinkRecordManager(
View Full Code Here

      HeapRecordableException, ObjectIOException, RBTException,
      ObjectIOClassNotFoundException, ClassInfoException {
    final HelperBinaryConversion helperBinaryConversion = new HelperBinaryConversion();
    // FIXMELUC x needed helperBinaryConversion.initialize ?
    // helperBinaryConversion.initialize(classInfoFactory, objectIOManager);
    final HeapRecordableManager recordableManager = new HeapRecordableManager(
        dataManager);
    final StoreHeader storeHeader = new StoreHeader(recordableManager,
        helperBinaryConversion);
    assertNull("not root for class name list",
        storeHeader.getClassNameListRootDataRecordIdentifier());
    assertNull("no root for to garbage",
        storeHeader.getGarbageCandidateRootDataRecordIdentifier());
    recordableManager.attach(storeHeader);
    assertEquals("must be first record",
        StoreForTest.IDENTIFIER_FOR_STORE_HEADER,
        storeHeader.getDataRecordIdentifier());
    storeHeader.setStateHaveChanged();
    recordableManager.save();
    dataManager.flush();

    final ClassInfoFactory classInfoFactory = new ClassInfoFactory(1);
    classInfoFactory.setConversionManager(new ConversionManager(
        classInfoFactory));
    final ClassNameManager classNameManager = new ClassNameManager(
        recordableManager, storeHeader, classInfoFactory,
        helperBinaryConversion);
    classNameManager.load();

    assertEquals("must be class #0", 0,
        classNameManager.getIdentifier(classInfoFactory
            .getNoProxyClassInfo(this.getClass())));
    assertTrue("store header must changed", storeHeader.isStateChanged());
    recordableManager.save();
    assertFalse("store header must unchanged", storeHeader.isStateChanged());
    assertEquals("must be class #1", 1,
        classNameManager.getIdentifier(classInfoFactory
            .getNoProxyClassInfo(Integer.class)));
    assertTrue("store header must changed", storeHeader.isStateChanged());
    recordableManager.save();
    assertFalse("store header must unchanged", storeHeader.isStateChanged());
    dataManager.flush();
    classNameManager.clear();
    classNameManager.load();

    assertEquals("must be class #0", 0,
        classNameManager.getIdentifier(classInfoFactory
            .getNoProxyClassInfo(this.getClass())));
    assertEquals("must be class #1", 1,
        classNameManager.getIdentifier(classInfoFactory
            .getNoProxyClassInfo(Integer.class)));
    assertEquals("must be class #2", 2,
        classNameManager.getIdentifier(classInfoFactory
            .getNoProxyClassInfo(String.class)));

    assertEquals("must be this.getClass", this.getClass(), classNameManager
        .getObjectClassInfo(0).getObjectClass());
    assertEquals("must be Integer.class", Integer.class, classNameManager
        .getObjectClassInfo(1).getObjectClass());
    assertEquals("must be String.class", String.class, classNameManager
        .getObjectClassInfo(2).getObjectClass());

    assertTrue("store header must changed", storeHeader.isStateChanged());
    recordableManager.save();
    dataManager.flush();
    classNameManager.clear();
    classNameManager.load();

    assertEquals("must be class #0", 0,
View Full Code Here

    storeSynchro.setPersistenceId(0);
    storeSynchro.newCurrentFileAccessSession();
    final IHeapDataManager dataManager = new HeapMemoryDataManagerMock();
    dataManager.startService(true);
    dataManager.setNextFreeDataRecordIdentifier(DataRecordIdentifier.LAST);
    final HeapRecordableManager heapRecordableManager =
    /**/new HeapRecordableManager(dataManager);
    final HelperBinaryConversion helperBinaryConversion = new HelperBinaryConversion();
    final StoreHeader storeHeader = new StoreHeader(heapRecordableManager,
        helperBinaryConversion);
    classInfoFactory = new ClassInfoFactory(1);
    classInfoFactory.setConversionManager(new ConversionManager(
View Full Code Here

      final File dataFile = new File(storageFileName);
      final HeapFileSetup setup = new HeapFileSetup(
          EnumFileAccessMode.NIO_RANDOM_FILE_ACCESS, dataFile, false,
          false, false, false, 1, 0, null);
      dataManager = new HeapFileDataManager(setup, false);
      final HeapRecordableManager heapRecordableManager = new HeapRecordableManager(
          dataManager);
      final HelperBinaryConversion helperBinaryConversion = new HelperBinaryConversion();
      final StoreHeader storeHeader = new StoreHeader(
          heapRecordableManager, helperBinaryConversion);
      final ClassInfoFactory classInfoFactory =
View Full Code Here

    this.currentDataModelIdentifier = currentDataModelIdentifier;
    final IHeapDataManager dataManager = getDataManager();
    if (dataManager == null) {
      throw new StoreException("data manager must be defined");
    }
    heapRecordableManager = new HeapRecordableManager(dataManager);
    helperBinaryConversion = new HelperBinaryConversion();
    storeHeader = new StoreHeader(heapRecordableManager,
        helperBinaryConversion);
    classInfoFactory = new ClassInfoFactory(currentDataModelIdentifier);
    conversionManager = new ConversionManager(classInfoFactory);
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.service.heaprecordable.HeapRecordableManager

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.