assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_20, true));
assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_0, true));
assertEquals(1, getBeansWrapperInstanceCacheSize());
BeansWrapperBuilder factory = new BeansWrapperBuilder(new Version(2, 3, 5));
factory.setSimpleMapWrapper(true);
assertSame(bw, factory.build());
assertEquals(1, getBeansWrapperInstanceCacheSize());
hardReferences.add(bw);
}
{
BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_21, true);
assertEquals(2, getBeansWrapperInstanceCacheSize());
assertSame(bw.getClass(), BeansWrapper.class);
assertEquals(Configuration.VERSION_2_3_21, bw.getIncompatibleImprovements());
assertTrue(bw.isWriteProtected());
assertTrue(bw.isSimpleMapWrapper());
assertTrue(bw.wrap(new HashMap()) instanceof SimpleMapModel);
assertTrue(bw.isClassIntrospectionCacheRestricted());
assertNull(bw.getMethodAppearanceFineTuner());
assertNull(bw.getMethodSorter());
BeansWrapperBuilder factory = new BeansWrapperBuilder(Configuration.VERSION_2_3_21);
factory.setSimpleMapWrapper(true);
assertSame(bw, factory.build());
assertEquals(2, getBeansWrapperInstanceCacheSize());
hardReferences.add(bw);
}
{
// Again... same as the very first
BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_19, true);
assertEquals(2, getBeansWrapperInstanceCacheSize());
assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
}
{
BeansWrapper bw = getBeansWrapperWithSetting(Configuration.VERSION_2_3_19, false);
assertEquals(3, getBeansWrapperInstanceCacheSize());
assertSame(bw.getClass(), BeansWrapper.class);
assertEquals(Configuration.VERSION_2_3_0, bw.getIncompatibleImprovements());
assertTrue(bw.isWriteProtected());
assertFalse(bw.isSimpleMapWrapper());
assertTrue(bw.wrap(new HashMap()) instanceof MapModel);
assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_20, false));
assertSame(bw, getBeansWrapperWithSetting(Configuration.VERSION_2_3_0, false));
assertSame(bw, new BeansWrapperBuilder(new Version(2, 3, 5)).build());
assertEquals(3, getBeansWrapperInstanceCacheSize());
hardReferences.add(bw);
}