I am reading the head first servlets & jsp book and was wondering if anyone had the code for writing the test file for testing the model class. I have never written one so I have no clue. Thanks in advance for any help.
Welcome to the Ranch. There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Originally posted by Gloria LL: Hello one and all.
I am reading the head first servlets & jsp book and was wondering if anyone had the code for writing the test file for testing the model class. I have never written one so I have no clue. Thanks in advance for any help.
The reason to seperate the model from the controller...or in words keeping the business login at some other layer not in the servlet is testing.so that for testing the business logic we should not be needing the servlet container.. for testing of the business logic you can use JUnit testing.
Originally posted by Rahul Bhattacharjee: you can use JUnit testing.
JUnit might overkill here. You just need to add a main method to your business classes/class in order to test. Then you just need to execute that like normal java application.
Thanks.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.