It is dependant on the framework which you invoke to run the test cases. If you run with JUNIT , then the JUNIT annotations will be read and the TestNG annotations will be skipped. Same scenario is with TestNG. The TestNG does not understand the JUNIT annotations.
subject: Testng is skipping @Before annotation from junit