BEA's sorry excuse for unit testing in Workshop

dev2dev.bea.com have posted both an article and a tech talk on unit testing in BEA Workshop. When I saw this article, I thought 'YES ! This is exactly what I need' because my new employer have a strong focus on the tools from BEA. I absolutely see the productivity gain using BEA workshop, but I've been skeptic since I've tried TDD and liked the confidence it gave me. Doing so in Workshop seems like a struggle.

So then I started on the article in hope for all my concerns to be redeemed. I haven't started developing with Workshop yet, but it's just around the corner. The article shows how you can launch JUnit from Workshop using command line. Well... OK... that wasn't very useful. That's NOT the problem. There's a discussion about the classloading stuff in JUnit, but it fails to mention that disabling this can be done in a property file on the user's home area - which is what I do. The author suggest doing this either on the command line or in code. A bit awkward I thought and moved on...

Then he starts to talk about the difficult stuff. How to test Java Page Flows, Java Controls, Web Services and EJBs. The author names it "Unit testing Externally Testable Components" - and then the bad feeling got worse. He's actually talking about doing FUNCTIONAL testing at the UI level and calls it testable components !!! I think that must be as far away from testable components as you can get.

Further down he talks about testing web services and EJBs through their remote interface when running in the container. Testable components - sure !!!

Then he uses the term "Unit testing Internally testable components" which in practice is the usage of Cactus. I have great respect for the work around Cactus and I think the Java world owns a lot to Vincent, but I consider Cactus as work-around when you can't do unit testing. Vincent himself mentioned that Cactus test are probably more like integration tests: "Type 2: integration unit testing. Cactus is typically in this category" (from start page of Cactus).

So the conclusion is that unit testing will be very difficult with the Java Page Flow and Java Controls stuff included in BEA platform 8.1 and the only way to work around this probably is to embrace Cactus for all it's worth and that's a shame when you think about that TestNG is created by a former BEA employee.

No comments: