Package net.sf.joafip.store.entity.classinfo

Examples of net.sf.joafip.store.entity.classinfo.ClassInfo


   */
  public void testProxyReflect() throws ProxyException,
      SecurityException,// NOPMD
      NoSuchFieldException, IllegalArgumentException,
      IllegalAccessException, ObjectIOException, ClassInfoException {
    final ClassInfo classInfo = classInfoFactory
        .getNoProxyClassInfo(Bob1.class);
    final StorageInfo storageInfo = new StorageInfo();
    final Bob1 proxyObject = (Bob1) proxyManager2.newInstanceConstruct(
        classInfo, storageInfo, objectIOManager,
        DataRecordIdentifier.LAST, true);
View Full Code Here


      ObjectIOClassNotFoundException, ObjectIODataCorruptedException,
      ObjectIODataRecordNotFoundException, ClassInfoException,
      ObjectIOTooBigForSerializationException {
    final Bob1 bob1 = new Bob1();
    bob1.setVal(10);
    final ClassInfo bob1ClassInfo = classInfoFactory
        .getNoProxyClassInfo(Bob1.class);
    // FIXMELUC ___must use objectStateMap as factory
    // final ObjectAndPersistInfo objectAndItsClassInfo = new
    // ObjectAndPersistInfo(
    // bob1, false, bob1ClassInfo, new StorageInfo(0));
    final ObjectAndPersistInfo objectAndItsClassInfo = objectStateMap
        .createObjectAndPersistInfoOfObject(bob1, false, bob1ClassInfo);
    objectAndItsClassInfo.setObjectStateMap(objectStateMap);
    final DataRecordIdentifier identifier = objectIOManager
        .getOrCreateDataRecordIdentifierAssociatedToObject(objectAndItsClassInfo);
    objectIOManager.prepareWrite(objectAndItsClassInfo);
    objectIOManager.write(objectAndItsClassInfo);

    // removedFromCandidateIdentifier = null;// NOPMD

    final ClassInfo classInfo = classInfoFactory
        .getNoProxyClassInfo(Bob1.class);
    final StorageInfo storageInfo = new StorageInfo();
    storageInfo
        .setHeaderDataSize(AbstractObjectIOManagerIOForObject.HEADER_DATA_SIZE);
    objectIOManager
View Full Code Here

    /**/"0.0.0;a;;0.0.2;b;;aTob",
    /**/"0.0.2;b;;0.0.4;c;;" };
    final ReplacementDefMap replacementDefMap =
    /**/new ReplacementDefMap();
    replacementDefSetSetup(replacementDefMap, convertionDefArray);
    final ClassInfo classForA = classInfoFactory.getClassInfo("a");
    final Deque<ClassReplacementDef> replacementDef = replacementDefMap
        .replacementClassDef(version0, Version.releaseId("0.0.5"),
            classForA);
    assertNotNull("must have a definition", replacementDef);// NOPMD
    assertEquals("bad number of replacement def", 2, replacementDef.size());// NOPMD
    final Iterator<ClassReplacementDef> iterator = replacementDef
        .iterator();
    final ClassReplacementDef classReplacementDef = iterator.next();
    assertEquals("bad original", classForA,
        classReplacementDef.getOriginalClass());
    final ClassInfo classForB = classInfoFactory.getClassInfo("b");
    assertEquals("bad replacement", classForB,
        classReplacementDef.getReplacementClass());
    assertEquals("bad converter", classInfoFactory.getClassInfo("aTob"),
        classReplacementDef.getConverterClass());
  }
View Full Code Here

   * @throws ClassInfoException
   */
  public void test3() throws StoreException, FilePersistenceException,
      ConversionException, ClassInfoException, ClassNotFoundException {

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final FieldInfo fieldInfo = new FieldInfo(
    /**/classInfoForA/* declaringClass */,
    /**/VALUE,
    /**/fieldType,
    /**/false, false);
View Full Code Here

      ConversionException, ClassInfoException, ClassNotFoundException {

    final ReplacementDefMap replacementDefMap =
    /**/new ReplacementDefMap();

    final ClassInfo classInfoFor0 = classInfoFactory.getClassInfo("0");
    final ClassInfo classInfoFor1 = classInfoFactory.getClassInfo("1");

    ConversionDefEntry conversionDefEntry = new ConversionDefEntry(
        classInfoFor0, version0, classInfoFor1, version1,
        ClassInfo.NULL, ClassInfo.NULL);

    replacementDefMap.add(conversionDefEntry);

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final FieldInfo fieldInfo = new FieldInfo(classInfoForA, VALUE,
        fieldType, false, false);

    conversionDefEntry = new ConversionDefEntry(classInfoForA, version0,
        version1);
View Full Code Here

      ConversionException, ClassInfoException, ClassNotFoundException {

    final ReplacementDefMap replacementDefMap =
    /**/new ReplacementDefMap();

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final FieldInfo fieldInfo = new FieldInfo(
    /**/classInfoForA/* declaring class */,
    /**/VALUE,
    /**/fieldType,
    /**/false, false);
    ConversionDefEntry conversionDefEntry = new ConversionDefEntry(
        classInfoForA, version0, version1);
    conversionDefEntry.addToFieldList(fieldInfo);

    replacementDefMap.add(conversionDefEntry);

    final ClassInfo classInfoForB = classInfoFactory.getClassInfo("b");
    conversionDefEntry = new ConversionDefEntry(classInfoForA, version0,
        classInfoForB, version1, ClassInfo.NULL, ClassInfo.NULL);
    replacementDefMap.add(conversionDefEntry);

    final Deque<ClassReplacementDef> replacementDef = replacementDefMap
View Full Code Here

  public void test6() throws ConversionException, FilePersistenceException,
      ClassInfoException, ClassNotFoundException {
    final ReplacementDefMap replacementDefMap =
    /**/new ReplacementDefMap();

    final ClassInfo classInfoForA = classInfoFactory.getClassInfo("a");
    final ClassInfo classInfoForB = classInfoFactory.getClassInfo("b");

    ConversionDefEntry conversionDefEntry = new ConversionDefEntry(
        classInfoForA, version0, classInfoForB, version1,
        ClassInfo.NULL, ClassInfo.NULL);
    replacementDefMap.add(conversionDefEntry);
View Full Code Here

    // old identifier
    final String oldIdentifierName = strings[0];
    final int oldIdentifier = Version.releaseId(oldIdentifierName);
    // original class
    final String originalClassName = strings[1];
    final ClassInfo originalClass = classInfoFactory
        .getClassInfo(originalClassName);
    // original field, optional
    final ClassInfo fieldType = classInfoFactory
        .getNoProxyClassInfo(Object.class);
    final FieldInfo originalField;
    if (strings[2].length() == 0) {
      originalField = null;
    } else {
      final String fieldName = strings[2];
      originalField = new FieldInfo(originalClass, fieldName, fieldType,
          Boolean.FALSE, Boolean.TRUE);
    }
    // new identifier
    final String newIdentifierName = strings[3];
    final int newIdentifier = Version.releaseId(newIdentifierName);
    // replacement class name
    final String replacementClassName = strings[4];
    final ClassInfo replacementClass = classInfoFactory
        .getClassInfo(replacementClassName);
    // replacement field name, optional
    final FieldInfo replacementField;
    if (strings.length < 6 || strings[5].length() == 0) {
      replacementField = null;
    } else {
      replacementField = new FieldInfo(replacementClass,
          strings[5]/* fieldName */, fieldType, Boolean.FALSE,
          Boolean.FALSE);
    }
    // converter class name, optional
    final ClassInfo converterClass;
    if (strings.length < 7 || strings[6].length() == 0) {
      converterClass = ClassInfo.NULL;
    } else {
      converterClass = classInfoFactory.getClassInfo(strings[6]);
    }
View Full Code Here

      ClassNotFoundException {
    int resultIndex = 0;
    for (String string : result) {
      final String[] strings = string.split(";");
      final String originalClassName = strings[0];
      final ClassInfo originalClass = classInfoFactory
          .getClassInfo(originalClassName);
      final String originalFieldName = strings[1].length() == 0 ? null
          : strings[1];
      final String replacementClassName = strings[2];
      final ClassInfo replacementClass = classInfoFactory
          .getClassInfo(replacementClassName);
      final String replacementFieldName = (strings.length < 4 || strings[3]
          .length() == 0) ? null : strings[3];// NOPMD

      final Deque<ClassReplacementDef> replacementDef = replacementDefSet
View Full Code Here

    super(name);
  }

  public void test() throws ClassInfoException, ProxyException {
    final Class<?> objectClass = BobCallInConstructor.class;
    final ClassInfo classInfo = classInfoFactory
        .getNoProxyClassInfo(objectClass);
    final ProxyManager2 proxyManager2 = new ProxyManager2(
        new ClassLoaderProvider(), classInfoFactory);
    final StorageInfo storageInfo = new StorageInfo();
    inConstruction = true;
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.classinfo.ClassInfo

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.