Package net.sf.joafip.store.entity.conversion

Examples of net.sf.joafip.store.entity.conversion.ClassReplacementDef


            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


    assertNotNull("must have a definition", replacementDef);

    assertEquals("bad number of replacement def", 1, replacementDef.size());
    final Iterator<ClassReplacementDef> iterator = replacementDef
        .iterator();
    final ClassReplacementDef classReplacementDef = iterator.next();
    assertEquals("bad original class", classInfoForA, classReplacementDef// NOPMD
        .getOriginalClass());
    assertEquals("bad replacement class", classInfoForA,// NOPMD
        classReplacementDef.getReplacementClass());

    assertTrue("must not have static replacement def", classReplacementDef
        .getStaticFieldConversionMap().isEmpty());
    final FieldConversionMap fieldConversionMap = classReplacementDef
        .getFieldConversionMap();
    assertFalse("must have field replacement def",
        fieldConversionMap.isEmpty());

    final Set<Entry<FieldInfo, FieldReplacementDef>> set = fieldConversionMap
View Full Code Here

    Deque<ClassReplacementDef> replacementDef = replacementDefMap
        .replacementClassDef(version0, version1, classInfoFor0);
    assertNotNull("must have a definition", replacementDef);
    assertEquals("bad number of replacement def", 1, replacementDef.size());
    Iterator<ClassReplacementDef> iterator = replacementDef.iterator();
    ClassReplacementDef classReplacementDef = iterator.next();
    assertEquals("bad original class", classInfoFor0,
        classReplacementDef.getOriginalClass());
    assertEquals("bad replacement class", classInfoFor1,
        classReplacementDef.getReplacementClass());
    assertTrue("must not have static replacement def", classReplacementDef
        .getStaticFieldConversionMap().isEmpty());
    assertTrue("must not have replacement def", classReplacementDef
        .getFieldConversionMap().isEmpty());

    // check class "a"
    replacementDef = replacementDefMap.replacementClassDef(version0,
        version1, classInfoForA);
    assertNotNull("must have a definition", replacementDef);

    assertEquals("bad number of replacement def", 1, replacementDef.size());
    iterator = replacementDef.iterator();
    classReplacementDef = iterator.next();
    assertEquals("bad original class", classInfoForA,
        classReplacementDef.getOriginalClass());
    assertEquals("bad replacement class", classInfoForA,
        classReplacementDef.getReplacementClass());

    assertTrue("must not have static replacement def", classReplacementDef
        .getStaticFieldConversionMap().isEmpty());
    final FieldConversionMap fieldConversionMap = classReplacementDef
        .getFieldConversionMap();
    assertFalse("must have field replacement def",
        fieldConversionMap.isEmpty());

    final Set<Entry<FieldInfo, FieldReplacementDef>> set = fieldConversionMap
View Full Code Here

        .replacementClassDef(version0, version1, classInfoForA);
    assertNotNull("must have a definition", replacementDef);
    assertEquals("bad number of replacement def", 1, replacementDef.size());
    final Iterator<ClassReplacementDef> iterator = replacementDef
        .iterator();
    final ClassReplacementDef classReplacementDef = iterator.next();

    assertEquals("bad original class", classInfoForA,
        classReplacementDef.getOriginalClass());
    assertEquals("bad replacement class", classInfoForB,
        classReplacementDef.getReplacementClass());

    final FieldConversionMap fieldConversionMap = classReplacementDef
        .getFieldConversionMap();
    assertFalse("must have field replacement def",
        fieldConversionMap.isEmpty());

    final Set<Entry<FieldInfo, FieldReplacementDef>> set = fieldConversionMap
View Full Code Here

      final String replacementFieldName = (strings.length < 4 || strings[3]
          .length() == 0) ? null : strings[3];// NOPMD

      final Deque<ClassReplacementDef> replacementDef = replacementDefSet
          .replacementClassDef(previous, current, originalClass);
      final ClassReplacementDef lastClassReplacementDef = replacementDef
          .peekLast();

      assertNotNull("replacement must exist for '" + originalClassName
          + "'", replacementDef);
      assertEquals("for result #" + resultIndex
          + " bad replacement class name", replacementClass,
          lastClassReplacementDef.getReplacementClass());
      if (originalFieldName != null) {
        assertNotNull(
            "expected result must define a replacement field name",
            replacementFieldName);
View Full Code Here

        replacementDef.isEmpty());
    if (_LOG.debugEnabled) {
      _LOG.debug("net.sf.joafip.java.util.support.ArrayListSupportIterator replacement def:\n"
          + replacementDef.toString());
    }
    final ClassReplacementDef classReplacementDef = replacementDef
        .peekFirst();
    assertEquals("bad original class", classInfo,
        classReplacementDef.getOriginalClass());
    final ClassInfo replacementClass = classInfoFactory
        .getNoProxyClassInfo(ArrayListSupportIterator.class);
    assertEquals("bad replacement class", replacementClass,
        classReplacementDef.getReplacementClass());
    // FIXMELUC x check other replacement definition
  }
View Full Code Here

    final int joafipReleaseId = Version.releaseId("2.2.2");
    final String className = "net.sf.joafip.java.util.PTreeMap";
    final ClassInfo classInfo = classInfoFactory.getClassInfo(className);
    final Deque<ClassReplacementDef> replacementDef = classInfo
        .getReplacementDef(joafipReleaseId, dataModelIdentifier);
    final ClassReplacementDef classReplacementDef = replacementDef
        .peekFirst();
    assertFalse("must have replacement definition",
        replacementDef.isEmpty());
    if (_LOG.debugEnabled) {
      _LOG.debug("net.sf.joafip.java.util.PTreeMap replacement def:\n"
          + replacementDef.toString());
    }
    assertEquals("bad original class", classInfo,
        classReplacementDef.getOriginalClass());
    final ClassInfo replacementClass = classInfoFactory
        .getNoProxyClassInfo(PTreeMap.class);
    assertEquals("bad replacement class", replacementClass,
        classReplacementDef.getReplacementClass());

    final ClassInfo fieldType = classInfoFactory
        .getClassInfo("net.sf.joafip.java.util.IPNavigableTreeSet");
    final FieldInfo originalFieldInfo = new FieldInfo(classInfo,
        "pTreeSet", fieldType/* fieldType */, null/* staticField */, null/* transientField */);
    final FieldReplacementDef replacementFieldinfo = classReplacementDef
        .getReplacementFieldInfo(originalFieldInfo);
    assertFalse("must not be a deleted field",
        replacementFieldinfo.isDeletedField());
    final FieldInfo newFieldInfo = replacementFieldinfo.getFieldInfo();
    final FieldInfo expected = new FieldInfo(classInfo, "treeSet",
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.conversion.ClassReplacementDef

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.