R: [OT] JNDI datasource lookup to test classes

2003-08-23 Thread Leonardo Francalanci
The most common solution to this problem is using a Factory Method to return the correct implementation of the interface. Your classes should never know which implementation is in use because they will all ask the Factory Method for the object. You just need to change the one line in the

Re: R: [OT] JNDI datasource lookup to test classes

2003-08-23 Thread James CE Johnson
The most common solution to this problem is using a Factory Method to return the correct implementation of the interface. Your classes should never know which implementation is in use because they will all ask the Factory Method for the object. You just need to change the one line in

Re: R: [OT] JNDI datasource lookup to test classes

2003-08-23 Thread James Harman
Alternatively, If you are worried about test code in production, you could extend from ConnectionHandlerFactory with a TestConnectionHandlerFactor and override the getConnectionHandler() method to return the connectionHandler for testing. James James CE Johnson wrote: The most common

[OT] JNDI datasource lookup to test classes

2003-08-22 Thread Leonardo Francalanci
In my DB tier I use an interface to get the connection. When used under Tomcat, the class that implements the connection gets the connecton through JNDI. I want to test these classes outside of Tomcat. Is there a simple way to put objects in the Context, I mean a simple way to emulate Tomcat

Re: [OT] JNDI datasource lookup to test classes

2003-08-22 Thread Manolo Ramirez T.
Maybe this files can help you. Regards. Manolo Ramirez T. Leonardo Francalanci wrote: In my DB tier I use an interface to get the connection. When used under Tomcat, the class that implements the connection gets the connecton through JNDI. I want to test these classes outside of

Re: [OT] JNDI datasource lookup to test classes

2003-08-22 Thread David Graham
--- Leonardo Francalanci [EMAIL PROTECTED] wrote: In my DB tier I use an interface to get the connection. When used under Tomcat, the class that implements the connection gets the connecton through JNDI. I want to test these classes outside of Tomcat. Is there a simple way to put objects in

Re: [OT] JNDI datasource lookup to test classes

2003-08-22 Thread Adam Hardy
On 08/22/2003 04:43 PM Leonardo Francalanci wrote: I read the JNDI tutorial, but is the worse thing I've ever read. You've obviously never read any of my poetry. -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To