Hi John,

Hey Geert. Once again, I'm impressed at the speed of your response. Aren't you at JavaOne? I just hope that you were at a bar with your laptop when you
wrote this...

Hehe, I was at my hotel actually :-)

Thanks, good info. The db abstraction layer is perhaps my favorite part of Rife. I love the meta data system: I want to write Java, not spend all my time with XML configurbation. Still, I don't want to have any dependencies on a specific ORM in my pojos. I think maybe the simplist approach, that still
affords me some reversability, is this:  Create my own, simple
PersistenceDataManager and Factory. Then make implementations of these that wraps ContentQueryManager. I might also make a simple Context class that
houses my factory(ies) and also provides access to the Repository.

That sounds like a good plan.

- Anybody have any example tests that inject a datasource, etc.?

Can you give more information here? Inject a test into an element
during testing?

I'm really talking about OOC testing of pojos. So it is a matter of having the test inject the necessary dependencies. I think I have this partially figured out. I can at least get a test version of a Repository and build
stufff with that:

ResourceFinder resourceFinder = ResourceFinderClasspath.getInstance();
        Rep.initialize("rep/participants.xml", resourceFinder, null);

        DS = (Datasource) Datasources.getRepInstance().getDatasource
("test_derby");
...

Once I get my abstraction stuff figured out above, I can create a Test
superclass that sets it all up and injects it into the pojos.

That sounds about right. However, if you want to set it up without any XML files (not even participants.xml), that should be possible too. Let me know if you want the details about that.

Actually, if you're looking at test examples for RIFE stuff, you can just delve into the sources and find the relevant test case there. For example: https://svn.rifers.org/rife/trunk/src/unittests/com/uwyn/rife/ database/TestDbQueryManager.java

Hope this helps.

Best regards,

Geert
--
Geert Bevin             Uwyn bvba               GTalk: [EMAIL PROTECTED]
"Use what you need"     Avenue de Scailmont 34  Skype: gbevin
http://www.uwyn.com     7170 Manage, Belgium      AIM: geertbevin
gbevin at uwyn dot com  Tel: +32 64 84 80 03   Mobile: +32 477 302 599

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to