miércoles, 13 de enero de 2016

How to test on the database?

The testing in the programation is mandatory, therefore, i gotta tell about the test on the database. When my mentor says me that i need test the Sp of the database, i begin to investigate how i will do it. Into a blog of stackoverflow see that many people to test the database on java recommended the framework dbunit. This tool only help us to load the information of the database before of the test. Then we also need the framework Junit to the test.
To test the DB, we need create the test on JUnit:

  1. On the @Before we need:
    1. Load the Script of SQL (To run in any machine, and helpus to any change on the database)
    2. Load the database information into a .XML (DBUnit)
      • To do this, we need configurate the DBunit to use a large dataset and we get the information on the XML.
  2. On the @Test, we can do the test normaly
I need remember that isnt necesary if you are working with the framework ORM, because you can get the information till the code, but today not all the database works on this way.

References:
Stackoverflow:

Others:

No hay comentarios:

Publicar un comentario