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:

martes, 5 de enero de 2016

Complete the database

While yesterday i was create the conection. i see that my BD needs more Sp. A Sp that tellme if a code has the state repeted, maybe this is the most complex because need make queries in all tables. I test the procedures but with very simplify examples in database. the rest of the day i continue try to test the SPs using this example. i look that i need a XML with the tables information, then i try the mysql generate to me this information. I use this Informtion to create the file, but with this export all the information and dont need.

lunes, 4 de enero de 2016

Testing the Data Base

Today i continue with the implementation the data base to Java, and incredibly i dont have problems to this. Thanks to this guide. The next step and question was, how can i test my storage procedures of the Data Base. In investigate and found this library, this seems good technique. i go to  ask to Avalos and he say me that i need firt understand the Junit, and i implemented a easy examples of the calculator, but not before problems with the jar and netbeans. The next step test the conection with the database i try for a some minutes but i cant doit. I saw this tutorial but i cant implements for time questions