use of org.hotswap.agent.plugin.jvm.AnonymousClassInfos in project HotswapAgent by HotswapProjects.
the class AnonymousClassInfosTest method testTransitionsSameClass.
@Test
public void testTransitionsSameClass() throws Exception {
AnonymousClassInfos stateInfo = getClassPoolInfos(AnonymousTestClass1.class);
stateInfo.mapPreviousState(getClassPoolInfos(AnonymousTestClass1.class));
Map<AnonymousClassInfo, AnonymousClassInfo> mappings = stateInfo.getCompatibleTransitions();
for (Map.Entry<AnonymousClassInfo, AnonymousClassInfo> mapping : mappings.entrySet()) {
assertNotNull("Class not mapped " + mapping.getKey(), mapping.getValue());
assertTrue("Class not exact match " + mapping.getKey(), mapping.getKey().matchExact(mapping.getValue()));
assertEquals(mapping.getKey().getClassName(), AnonymousTestClass1.class.getName() + "$1");
assertEquals(mapping.getValue().getClassName(), AnonymousTestClass1.class.getName() + "$1");
}
}
Aggregations