Re: unit testing Cayenne objects

From: Erik Hatcher (eri..hatchersolutions.com)
Date: Fri May 06 2005 - 06:27:29 EDT

  • Next message: Dhruti Ramani: "Re: Getting complex queries in cayenne"

    On May 5, 2005, at 11:18 PM, Cris Daniluk wrote:
    >> I'll need to rearrange the creation of the DB to a place where it
    >> only occurs once rather than for every testXXX method, but as it
    >> stands it works great for my couple of simple tests thus far.
    >>
    >>
    >
    > This all looks very cool. For what its worth, I use a little static
    > isInit boolean in the setUp() to selectively skip stuff. It gets the
    > job done, but don't tell Dave Thomas :)

    Dave would be proud.... you'd done something *pragmatic* after all :)

    > How has your experience been with using the generator via code? I am
    > working on a packaged application and I was thinking about using it as
    > the way to generate the database on new installations.

    The generator has done a great job for me (caveat: I've only got a
    couple of unit tests thus far as I iron out the process a bit before
    going full on). The beauty of it is that I do not have any
    intermediate .sql files - which is vastly different than a Hibernate/
    DBUnit expert pal of mine told me of his unit testing trickery. He
    used some type of schema export tool and then read in the .sql line
    by line and executed. Internally this is what the generator is
    doing, of course, but its encapsulated with nothing in the middle.

    My workflow is now entirely driven from the Cayenne model, and I'm
    extremely pleased! If XDoclet had been in the equation (and I'm a
    committer on that project :O) it would have driven me far far away!

         Erik



    This archive was generated by hypermail 2.0.0 : Fri May 06 2005 - 06:27:47 EDT