initializer, anonymClass.getParent());
}
@Test
public void testInnerAnonymClassFromInterface() {
FamixMethod foo = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool.foo(java.lang.String)", null));
FamixClass anonymClass = (FamixClass) aModel.getElement(aFactory.createClass("testPackage.InnerAnonym$MemoryMapPool$3", null));
FamixMethod initializer = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool$3.<oinit>()", null));
FamixMethod constructor = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool$3.<init>()", null));
FamixMethod compute = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool$3.compute()", null));
FamixClass innerAnonymClass = (FamixClass) aModel.getElement(aFactory.createClass("testPackage.InnerAnonym$MemoryMapPool$3$1", null));
FamixMethod innerInitializer = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool$3$1.<oinit>()", null));
FamixMethod innerCompute = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool$3$1.compute()", null));
FamixMethod innerConstructor = (FamixMethod) aModel.getElement(aFactory.createMethod("testPackage.InnerAnonym$MemoryMapPool$3$1.<init>()", null));
assertNotNull("FamixModel must contain method testPackage.InnerAnonym$MemoryMapPool.foo(java.lang.String)", foo);
assertNotNull("FamixModel must contain anonymous class testPackage.InnerAnonym$MemoryMapPool$3", anonymClass);
assertNotNull("FamixModel must contain initializer testPackage.InnerAnonym$MemoryMapPool$3.<oinit>", initializer);
assertNotNull("FamixModel must contain method testPackage.InnerAnonym$MemoryMapPool$3.<init>", constructor);
assertNotNull("FamixModel must contain method testPackage.InnerAnonym$MemoryMapPool$3.compute()", compute);
assertNotNull("FamixModel must contain inner anonymous class testPackage.InnerAnonym$MemoryMapPool$3$1", innerAnonymClass);
assertNotNull("FamixModel must contain initializer testPackage.InnerAnonym$MemoryMapPool$3$1.<oinit>", innerInitializer);
assertNotNull("FamixModel must contain method testPackage.InnerAnonym$MemoryMapPool$3$1.compute()", innerCompute);
assertNotNull("FamixModel must contain method testPackage.InnerAnonym$MemoryMapPool$3$1.<init>", innerConstructor);
assertTrue("FamixMethod " + foo.getUniqueName() + " must contain anonym class " + anonymClass.getUniqueName(), foo.getAnonymClasses().contains(anonymClass));
assertEquals("Parent of anonym class " + anonymClass.getUniqueName() + " must be " + foo.getUniqueName(), foo, anonymClass.getParent());
assertTrue("FamixClass " + anonymClass.getUniqueName() + " must contain method " + compute.getUniqueName(), anonymClass.getMethods().contains(compute));
Set<FamixAssociation> lRelations = aModel.getAssociations(foo);
int nrInvocationTo = TestHelper.containsRelationTo(constructor, lRelations);
assertEquals("Missing invocation relationship from " + foo.getUniqueName() + " to " + constructor.getUniqueName(), 1, nrInvocationTo);
lRelations = aModel.getAssociations(compute);
nrInvocationTo = TestHelper.containsRelationTo(innerConstructor, lRelations);
assertEquals("Missing invocation relationship from " + compute.getUniqueName() + " to " + innerConstructor.getUniqueName(), 1, nrInvocationTo);
}