jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Lybarger" <Mark.Lybar...@CBC-Companies.com>
Subject how to test Session Facade without database
Date Wed, 21 Apr 2004 12:39:50 GMT
I'd like to be able to test my Stateless Session EJB's w/o relying on data in the database.
(initially... later, i'd like to remove dependancy on a remote tuxedo call we also do).  
What's the best way to do this?  Mock the database? Hypersonic database for testing?

Our DAO layer is similar to the torque peer setup.  We have EJBs that call other EJB's or
that call static methods on Peer classes.  The Peer classes return DTOs filled with data from
the db.  All database access is done through these Peer classes.  I've read in some XP book
someplace how to test database methods by mocking the database objects, (record set mocks,
connection mocks), but I'm just not sure how that would work out if we're not directly testing
the Peer classes, but testing the EJB interface itself.  We're implementing the session facade
pattern now (moving code from turbine actions) to make functionality more available to other
processes.  And IMO, having testing on this functionality is essential.  Any insights would
be most appreciated.


View raw message