Call AfterClass and BeforeClass methods of ancestors