Friday January 03, 2003
JUnit Tests - Naming Conventions
I am using Interfaces in my persistence layer, as well as for my Business Delegates. These interfaces are named things like UserDAO and UserManager. Their implementations are UserDAOHibernate and UserManagerImpl. First off, I don't know that I need interfaces for my business delegates, but they're already in place, so I'm going with it.
What I'm wonder is if my JUnit TestCases should reflect the Interface name, or the implementation name? UserDAOTest.java or UserDAOHibernateTest.java. I like the first one better, but I tend to hard-code information in it so I can call UserDAOHibernate.java - like the daoType to use. I started out using UserDAOTest because I thought it made more sense - and then it could be used to test all implementations.
Lately, I've been using JUnitDoclet to generate my TestCase skeletons, and it only generates TestCases for concrete classes, not interfaces. Therefore, I've changed to using UserDAOHibernateTest, which can be a helluva lot to type (and remember) when running TestCases! Here's the Ant command I use to run this test:
ant test-ejb -Dtestcase=UserDAOHibernateTest
And User is a short word! Can you imagine what these suckers will look like when I have an object such as ChangeRequest. Ughh. What do you gents think - I'm all ears. Posted in Java at Jan 03 2003, 04:02:14 PM MST 3 Comments
Search This Site
Recent Entries
- What's Next
- Jack's Mohawk
- LinkedIn Cuts 10% (a.k.a. The Journey is Over)
- Happy Birthday Abbie!
- Moving from Spring's XML to Annotations in AppFuse
- Free Maven Training in New Orleans on Election Day
- AppFuse Light ยป AppFuse, Maven Archetypes and Shared Web Assets
- Great Weekend in Montana
- Colorado Software Summit 2008 Wrapup
- RESTful Web Applications with Subbu Allamaraju
Posted by Erik Hatcher on January 03, 2003 at 09:31 PM MST #
Posted by Matt Raible on January 03, 2003 at 09:52 PM MST #
Posted by Mathias Bogaert on January 04, 2003 at 03:04 AM MST #