All entries for Thursday 09 June 2005
June 09, 2005
So if you right click on a Unit Test in eclipse you can run it in the embedded test runner.
But I didn't realise that you can also click on a package and that will run all the unit tests in that package.
So, no more trying to figure out which unit test failed in ant and running one-by-one in eclipse!
Just right click on your unit-test package and run all your unit tests in eclipse :)
So I have an object Content which has a ContentFetcher (strategy).
Ideally I would like to implement ContentFetcher as a dependant object of Content, but I can't for the following reasons:
– a Content's contentFetcher can change
– dependent objects cannot be polymorphic in hibernate
So I map it as a one-to-one (Content to ContentFetcher) with the primary key of ContentFetcher being the same as the primary key of Content.
Unfortunately when I try and assign a new ContentFetcher, Hibernate explodes because there are two instances of ContentFetcher with the same id, the old one and the new one. There seems to be no way to indicate to Hibernate (without explictly calling session.delete which I haven't tried) to ignore the old content.
In the end I mapped it as a many-to-one with a foreign key in Content :(