Categories
Development

Fast testing of EJBs

Javaworld has an article where Nader Aeinehchi uses a combination of XStream, OpenEJB and JUnit to test EJBs with a low roundtrip time of 3sec. Anyone that has worked with projects that use EJBs know that this is a relatively short time.

One of the interesting concepts of the article was actually using XStream for specifying mock data to pass the EJBs and services. I feel kind of stupid for not thinking of this before. Next time around. 🙂

Categories
Development

Acceptance tests from user defined rules

A friend of mine is writing his thesis on automated acceptance testing of applications. He’s making a plugin for Eclipse that will let you specify flows, actions, inputs and outputs. Sort of what you would do if you designed a web flow…

Today I stumbled upon this article by Dave Thomas. He writes about using table driven programming for specifying rules and the next actions to take. In his experience it is easy for the users to analyze, and maintain these tables. These tables would also be somewhat along the lines of what FitNesse does for acceptance testing. So by getting the users to specify the rules you would have both the logic of some parts of the program, as well as material to validate the system.

An acceptance test would also include input and output values, but the overall logic of flows and actions could be shared between implementation and validation. The tables might be easy for users to to maintain and use, but so would something like Spring WebFlow too? Maybe even easier? Paired with the right tools like Gaijin Studio, this could make a pretty powerful tool. I havn’t tried Gaijin Studio yet, but you might have to make some special abstractions. It looks like it’s abstraction is a little bit too low level for even advanced users. Make abstrations and limit some of the possibilities the user has, and it could be really powerful. If a user makes changes and adds new steps, the developers would be responsible for implementing the additions.

When doing acceptance tests, these flows could be complemented by adding inputs and expected outputs, and run to check for expected behaviour.

Maybe it’s even been done? It seems too good a idea to not have been though about before. Or maybe it’s actually too difficult, and I don’t see the problems…

Categories
Development

Have your java-app connect through proxy-server

It’s quite simple, and you’ll find a good example her:
Notice the difference before and after jdk 1.3.1.
(The system property values has changed.)

http://www.rgagnon.com/javadetails/java-0085.html

Good Luck!