nbhatia wrote:
Here's my simple test which tries to call the Dao:





    public void testCreateTrade() throws Exception

    {

        TradeDao tradeDao = new TradeDaoImpl();

        tradeDao.create(this.trade);

    }





What could I be doing wrong?
(end of quote)




In general, I believe you shouldn't be instantiating "Impl()" methods directly. 
 You need to use Spring services to get a handle to your Dao.  There is too 
much "set-up" code (like creating session objects, etc.) that needs to be done 
to the Doa.  You can either use Spring to make those for you, OR you can set 
them yourself.  If you take a close look at your Dao, you'll see all types of 
things that need to be "set" manually before you test it (if you are NOT using 
Spring to "wire up" your objects). In particular, you'll need to set up a 
session factory.



See my next message for help (I'm about to answer another question)...
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=3852#3852
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to