What are the important JUnit annotations?

devquora
devquora

Posted On: Feb 22, 2018

 

The test runner is used to execute the test cases.
  • @Test: This is the test method to run first unless otherwise specified.
  • @BeforeClass: This is run once before any of the other test methods present in the class.
  • @Before: This is run before @Test.
  • @After: As the name suggests, this is run after the @Test.
  • @AfterClass: This is run one after all of the tests in the class have been run.  

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JUnit Interview Questions

    Explain what is JUnit?

    JUnit is a testing framework for unit testing.  It uses Java as a programming platform, and it is an Open Source Softw..

    JUnit Interview Questions

    Mention what is the difference between JUnit and TestNG?

    JUnit TestNGIn JUnit the naming convention for annotation is a bit complicated for, e.g., “Before”, “After”..

    JUnit Interview Questions

    Mention different methods of exception handling in JUnit?

    Exceptional or analogous conditions during program execution require special processing methods and this exception hand..