cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Furbacher <>
Subject Re: out-of-container JNDI
Date Tue, 08 Jul 2008 03:38:28 GMT
Have you looked at Spring mocks?

I used it quite successfully some time ago when I was doing this kind  
of work, along with


or its subclass


Good stuff.

Paul Furbacher

On Jul 4, 2008, at 10:32 AM, Jon Sharp wrote:

> Hey guys,
> I'm using Cayenne 3.0M3, and have been using JNDI to get my  
> datasource.  This works just fine when deploying our app to our  
> Glassfish container, as we have our JNDI resource defined there.   
> However, we are now attempting to do some JUnit testing of our data  
> access layer and therefore need to provide a JNDI reference out-of- 
> container.  I've found this helpful blog entry by Randy Carver:
> and it really seemed to address our issue.  It seems to get us  
> close, but Cayenne doesn't seem to pick up on our "jdbc/sunrise"  
> reference.  (this matches the reference in our Cayenne data map.)   
> It attempts to find a resource by using the modeler user  
> preferences, instead.  The JNDI docs I found relating to Cayenne  
> seemed to be for 1.2, so I don't know how relevant they still are.   
> They seem to indicate that Cayenne will look for the "default"  
> provider first, then the user prefs.  My question is, do we need to  
> do anything else in our JUnit setup method to make our "jdbc/ 
> sunrise" reference the "default"?
> Does anyone do out-of-container JUnit testing with Cayenne and JNDI?
> Thanks,
> Jon
> --
> Jon Sharp
> CTO & Senior Engineer
> Campground Automation Systems, Inc.
> (615) 579-5868

View raw message