JBoss vs. Glassfish - and the quality of testing

The quality of the Unit-Tests can be in general projected to the quality of the production code. In source code reviews, I look first at the Unit-Tests and try to find out, how the code was intended to be used.
I was also curious, how the JPA layer was tested by different application server vendors and reviewed glassfish and jboss code. Fortunately, you can access both source branches directly from the browser

The results are amazing, but perhaps I was not able to find all the tests :-). I took the following aspects into account (redundancies, consistent approach, completeness, naming conventions, code coverage etc.).
I'm curious about your results - you can use the comments in my blog to document these :-).


SO what is your conclusion? The glassfish tests were not very easy to find.

Posted by Bob Robertson on December 20, 2006 at 04:39 PM CET #

For the JBoss JPA I guess you should also look at


since it is based on Hibernate3 Annotations.

Posted by Tobias on December 20, 2006 at 07:00 PM CET #

The GlassFish dev tests and sqe tests are located under glassfish/appserv-tests. You have rightly picked the entity-persistence-tests dir under glassfish for the persistence related tests.

BTW, the fisheye source browsing facility is available for GlassFish as well :

Posted by Shreedhar Ganapathy on December 20, 2006 at 07:12 PM CET #

Ahem, as pointed out, JBoss EJB3 is based on Hibernate which has thousands of unit tests .... in the Hibernate SVN repository.

Posted by Gavin on December 20, 2006 at 07:35 PM CET #

Hi Gavin,
Hibernate or JPA tests? (it is slightly different :-))
Are the Hibernate tests executed together with JBoss test-suite? :-),



Posted by Adam Bien on December 21, 2006 at 08:59 PM CET #

"Hibernate or JPA tests? (it is slightly different :-))"

Hibernate Core holds all the core features test (which is the core of the spec),
Hibernate Annotations holds all the JPA annotations tests
Hibernate EntityManager holds all the API specific and packaging JPA tests

"Are the Hibernate tests executed together with JBoss test-suite? :-)"

What you say does not make sense. Hibernate (EntityManager) runs *everywhere* JavaSE 5 is available. All HEM versions embedded in JBoss AS have been tested and released, JBoss EJB3 contains additional integration tests wrt JPA itegration (you should be able to test other JPA implementations).

Last time I checked, the number of classes in src was about the same as the number of classes in test all Hibernate projects.

Now please follow up on the real figures :-)

Posted by Emmanuel Bernard on December 23, 2006 at 01:10 PM CET #

Hi Bernard,

"What you say does not make sense."

From the hibernate perspective not, but from the application server perspective it makes sense. Persistence behaves differently inside and outside an EJB-Container (injection, transactions etc.).

JBoss Tests should be JPA-provider independent, but in case JBoss uses Hibernate the unit-tests should be executed with hibernate in a realistic environment (e.g. Stateless Session Bean).

Where I can find the additional integration JPA-Tests in EJB-container context?

Posted by Adam Bien on December 29, 2006 at 06:28 PM CET #

Stupid question, if pluggable JPA providers isn't a JBossAS design goal, why should there be tests outside of JBoss's own JPA provider exactly? Whether it should be is another question. Whether any JEE vendor that has their own JPA provider will make it one is yet to be seen (Glassfish HAS to make this a design goal).

Posted by Andy on January 03, 2007 at 03:47 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments