* @throws ClassInfoException
*/
public void test4() throws StoreException, FilePersistenceException,
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);
conversionDefEntry.addToFieldList(fieldInfo);
replacementDefMap.add(conversionDefEntry);
// check class "0"
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();