public void testPTreeMapFieldreplacement() throws FilePersistenceException,
ClassNotFoundException, ConversionException, ClassInfoException {
final int dataModelIdentifier = 0;
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);