1. The project is basically developing health information system.The back end of the project we use MySQL and the for front end we use hybernate. Hybanate is a kind of persistence framework.
2. Other than that it use Java base Jason web services for the back end. For the front end we use PHP. Actually it is a framework of PHP call php framework codeigniter.
First week
For the API we wrote test cases. The main technology that I learnt was JSON object.
JSON technology
JSON (JavaScript Object Notation) is a data interchange format and it is easy to humans to read and write and also machines to parse and generate. It s based on a subset of the Javascript programming Language.
JSON is build on two structures:
1.A collection of name/value pairs.Most of the time this realized as an object,record,struct,dictionary,hash table,keyed list, or associativ array.
2.An ordered list of values. In most languages, this is realized as an array,vector,list or sequence.
Second week
Error Codes when write test cases.
HTTP status codes prominently found when testing an API
200 OK
Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.
202 Accepted
The request has been accepted for processing, but the processing has not been completed
204 No Content
The Server successfully processed the request and is not returning any content. This might be due to no return type on the method accessed in the API.
400 Bad Request
This might be one of the major error faced when writing test cases for API. Caused due to server cannot or will not process the request due to an apparent client error. (These error can range from: common syntax error in both url or the requesr message, The request message not formed properly etc.)
403 Forbidden
The request was a valid request, but the server is refusing to respond to it. This might be caused due to user not having the necessary permission to access the resource.
404 Not Found
This Commonly occur due to request resource could not be found. (Bad URL)
405 Method Not Allowed
Cause by a mismatch of request method and requested resource. for example, a GET request on a form method which requires data to be presented via POST.
415 Unsupported Media Type
The request entity has a media type which the server or resource does not support.
500 Internal Server Error
A generic error message and on of the harder one to pin-point is triggered due to various reasons on both server-side or client. (few examples are: server is not up, user trying to insert a value which is already existing in the database and constraint by primary key)
Hint: Use POSTMAN for your API testing, https://www.getpostman.com/
Inward API testcases in HIS that I built.
1.TemperatureChartResourceTestCase.java
2.DiagnoseResourceTestCase.java
3.LiquidBalanceChartResourceTestCase.java
4.TempPrescribeResourceTestCase
5.WardAdmissionResourceTestCase.java