I have a MVC which has this structure:
- ui
- controller
- db
- model
Basically the controller doesn't really do much more than connection ui
with db
layer.
Do I need to provide JUnit tests for the controller (if the program's point matters, it's my semester project)?
Would that help me somehow as there isn't much code - I basically take all the parameters and put them, shouldn't this be covered by model layer tests?
Example methods I have in the controller:
Inserting:
public int createEmployeeJob(String jobName)
{
int result = -3;
try
{
EmployeeJob newEmployeeJob = new EmployeeJob();
newEmployeeJob.setJobName(jobName);
DBConnection.startTransaction();
IFEmployeeJob dbEmployeeJob = new DBEmployeeJob();
result = dbEmployeeJob.createEmployeeJob(newEmployeeJob);
DBConnection.commitTransaction();
}
catch (Exception e)
{
DBConnection.rollbackTransaction();
}
return result;
}
Retrieving:
public ArrayList<EmployeeJob> printAllEmployeeJobs() throws SQLException
{
IFEmployeeJob dbEmployeeJob = new DBEmployeeJob();
return dbEmployeeJob.printAllEmployeeJobs();
}