> > Basically, these rules mean that 90% of the tests > written > > with JUnit are not unit tests :-) > > > > (I'm certainly not disagreeing with you, being the > creator > > of TestNG and all, but I just wanted to clarify...) > > Yeah, depends on where you are, I guess. I usually > convince teams to work like this rather early so the world > looks better from where I sit. It's sort of like saying, > "oh, grass never grows high" when you habitually mow your > lawn. > > I hope it's better than that, though. I mean, seriously, > if every unit test talks to the database because that's > the way the production code works
Well, sometimes, the purpose of a class *is* to access the database, so one might argue that accessing the database still qualifies as a unit test.
But again, it really depends on your definition of what a unit test is, and yours is simply different from the one that is commonly used ("a unit test is a test that only exercises one class in isolation of all others", or something like that).