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.


Book review: Designing with web standards

Are you using HTML tables when designing your web site ? Many space GIFs ? Are you using browser detector scripts ? Got a feeling that these HTML hacks smells (like teen spirit ;-) ? Well then Designing with web standards might be the book for you.


I've been working with Java technology for quite some time now, but I never actually done any major web client programming. Mostly the focus have been server side components or swing programming. I just started working in a new company and I actually got my first web project with JSPs and stuff. I started out trying to avoid using scriptlets and learned JSTL and a few of Jakarta's tag libraries, but I still ended up with crappy HTML code because of tables wrapped inside tables in order to get the layout to look good. So it occurred to me that I had to do something about my HTML skills. My friend André got this book recommended by a web designer and he spoke warmly about it - so I gave it a try.

Diving into the problems...

Being ignorant about the browser wars and web standards, this book gave me historical background and points out that 99,9% of the web sites are crappy and ignorant about the fact that most browsers now actually support the important web standards; CSS, XHTML, ECMAScript and DOM. It's possible to make a site without having to write HTML specific for Internet Explorer (don't understand why anyone still wants to use such a browser - but that's another story) or any other browsers.

The book takes us through the history and how things gotten better. This section could have been a bit shorter for my taste. After that the focus is on the different Web standards and explaining them and then showing examples. Zeldman also addresses problem areas with older browsers and how one can work around these issues. The last chapter shows how he changes his homepage from a table based layout to a CSS driven layout. A really good wrap up on the technology.

Might not be your cup of tea...

This is a great book to get an overview on the technologies and some practical advice, but still it's not a HOWTO or reference on for instance CSS. If that's what you're looking for, you might consider some like Eric Meyer on CSS. I've bought the follow up called "More Eric Meyer on CSS".

Summing up

  To conclude, my dice landed on five. The ovations of web standards and historical background is a bit verbose. On a few occasions I had some problems following the arguments in the text with the examples. Other than that - I'm pleased with the book.

Hopefully this ends up with me finally getting my homepage up and running...