Hi all, I know very little about XDoclet but someone told me it could be used to genarate the basic Junittest that you want to run on set and set method. For example if i wanted to test a set and get method:
I could get Xdoclet to help me genarate a test method, just like to one below:
Could I actually genarate Junit if i had the correct XDoclet in my code. I undersand that it could not genarate all my test, but if it could just give me a templete it would be useful. Thanks Chris.
With XDoclet 1.2 (the current version), there is no JUnit module that comes out of the box. That's not to say that you couldn't write one for yourself (in fact, if you do and it proves to be useful, perhaps you could contribute it back to the project). XDoclet 1.2 does, however, include a mockobjects module. Hands-down, this is one of my favorite XDoclet modules, because with just a single tag, you can generate hundreds (thousands?) of lines of mock object code. In XDoclet 2, there is a JUnit plugin that has been started. I took a look at it just yesterday and it seems to be very much in a state of just-getting-started. Certainly not ready for primetime. There's been a lot of talk by a lot of people about generating JUnit test cases using XDoclet. I even attempted to write one at one time. My thoughts (and I share these with a lot of other people) is that any test cases other than the very trivial test cases are probably too tough to generate and need to be hand-written. That said, I am looking forward to seeing someone prove me wrong. Therefore I challenge you (and anyone else) to write a JUnit module for XDoclet that generates test cases for trivial and non-trivial test cases.
Craig, I need to buy your book. I am a big XDoclet fan myself and have done quite a bit of writing about it for IBM developerWorks.
XDoclet 1.2 does, however, include a mockobjects module. Hands-down, this is one of my favorite XDoclet modules, because with just a single tag, you can generate hundreds (thousands?) of lines of mock object code.
Hi, Does XDoclet 2 support as much functionality as junitdoclet? I was thinking of using junitdoclet but am worried that it will be redundant once XDoclet 2 is released. Thanks Chris.
posted 15 years ago
Originally posted by Chris Harris: Does XDoclet 2 support as much functionality as junitdoclet?
Honestly, I know very little about junitdoclet and I've not given more than 2 minutes of a look at the XDoclet 2 JUnit plugin. However, I can tell with full certainty that the XDoclet plugin, as it stands today, is nowhere near being complete. I am very certain that junitdoclet is much more complete. Of course, XDoclet 2 is still not final and its plugins can be released on a separate schedule than XDoclet itself. Therefore, there's lots of time for the JUnit plugin developer to flesh out his stuff. In the end it may end up being better than junitdoclet...or it may never be finished at all. At this point it's way too early to say for certain. If you're that interested, perhaps you could pick up the JUnit stuff out of CVS and work on it yourself. Contribute your changes back to the project and maybe you'll even be allowed to be a committer. That's what's so wonderful about open-source...you don't have to wait to get the features you need.
Originally posted by Chris Harris: Hi, Does XDoclet 2 support as much functionality as junitdoclet? I was thinking of using junitdoclet but am worried that it will be redundant once XDoclet 2 is released. Thanks Chris.
JUnitDoclet just generates skeleton code for Junit tests - which is basically just a main method and empty methods for all methods in the class. I used it on my project and found that I only used it once. It's hardly maintained either - no updates in quite some time. It is kinda cool, but once you get an initial test (i.e. DAOTest or ActionTest), you can easily copy that as a template for new tests. At least, that's how I do it. Matt