Debugging TimesheetManagerTest End-to-End (Browser to Database)


As I mentioned earlier, debugging can be a painful experience at times. It would be nice if we could simply tell the computer what the problem is and have it fix the bug for us. Considering that's not possible today, we have to find ways to make this experience slightly more pleasant, and Eclipse does a good job.

Being able to completely debug my server-side code (web and database, for example) is perhaps my favorite feature related to debugging in Eclipse. As we discussed Chapter 8, Eclipse has plug-ins galore. One of these is the Data related plug-in that is part of the Web Tools Platform (WTP) Eclipse project. Combining this with the built-in server-side debugging features makes for a very powerful concept! Let's look at an example of what I'm referring to.

Figure 9.6 shows a screenshot of Eclipse. Here I'm stepping through TimesheetManagerTest.java, inspecting the various memory variables, viewing the output in the Console view, viewing the test results in the JUnit view, andare you ready?watching the data in the database change (by manually refreshing it) right in front of my eyes (as I step over the timesheetManager.deleteTimesheet method) using the Data Output view. Now, that's cool!

Figure 9.6. Consolidated debugging of Time Expression in Eclipse.


On the client side, I like using some of the extensions I mentioned earlier, such as the JavaScript debugger, JavaScript console, and Web Developer. For example, Figure 9.7 shows a screenshot of our Enter Hours form with the field names, sizes, and other information displayed. This extension has helped me find field truncation errors because my HTML input text filed was too small, for example.

Figure 9.7. Firefox Web Developer extension.




Agile Java Development with Spring, Hibernate and Eclipse
Agile Java Development with Spring, Hibernate and Eclipse
ISBN: 0672328968
EAN: 2147483647
Year: 2006
Pages: 219

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net