Projects:Import Gift Card Process/QA
Testing
Some new automatic tests have been added to cover some specific behaviors:
- Importation and Exportation of GiftCards through Retail API
- Test JSONObjectStreamSupplier which provides a JSONObject Iterator given an InputStream
- ImportFileHandler selector based in the FileExtension and the EntityId taking into account the priority
- Transformation of CSV file of JSONObject Stream through the CSVToJSONTransformer class
All these new tests have been included in the src-test folder of Retail API and Retail API for Gift cards modules.
Together with this, all the existing test infrastructure in CI should help to ensure that everything continues working as expected and all the functionality has also been tested manually.
Performance
We have done a Performance Analysis with several files to ensure that we can cover cases with several entities to import.
We have tested also the conversion of InputStream to JSON<Stream> in CSVToJSONTransformer class it performs well with huge amount of data.
There is a memory limit when working with really big files. For our tests, we have used a JVM heap size of 1 GB. In the Performance Analysis done you can find more details on this topic. In the particular case of the analysis we reach the Out Of Memory error trying to import a file with 350.000 GiftCards (134.6 MB). The size of the JSONArray objectto be imported was almost 700 MB (70% of the VM heap size).
The limitation of the memory is when we create the JSONArray to be send to EDL Process. If we need to improve the performance of the Importation of files we should improve that point.
We can conclude that this numbers are enough to import entities taking into account that the size of the file will be limited to 10MB by default (25.000 Giftcards). We won't reach Out Of Memory error analysing the number of the performance and the file limitation.