Junit & Basic Annotations

What is Junit:
Junit is the testing framework used to test Java application.

@Test
* It is used to mention the method as test method in the test class.
@BeforeClass
* Before annotation is used to load any specific data before loading test cases only once. eg. create database connection
@Before
* Before annotation is used to load any specific data before loading each test cases. eg. create Values
@After
* After annotation is used to load any specific data after loading the test cases. eg. Deleting the values
@AfterClass
* Before annotation is used to load any specific data after loading test cases only once. eg. closing database connection
@Ignore
* If you want to ignore some method in the test class then will use.
@Test(timeout=500)
* When you dont want to wait for other system for more time then will use this.
@Test(expected=IllegalArgumentException.class)
* Error Handling. If you want to check particular method is throwing IllegalArgumentException or not.



Comments

Popular posts from this blog

How to set Java Object into JaxBElement ?

GitLab