[JIRA] Created: (CAY-862) Simplify (junit) testing in cayenne

From: Marcin Skladaniec (JIRA) ("Marcin)
Date: Tue Sep 04 2007 - 21:55:51 EDT

  • Next message: Mike Kienenberger: "Re: Simplify (junit) testing in cayenne"

    Simplify (junit) testing in cayenne
    -----------------------------------

                     Key: CAY-862
                     URL: https://issues.apache.org/cayenne/browse/CAY-862
                 Project: Cayenne
              Issue Type: New Feature
              Components: Cayenne Core Library
        Affects Versions: 3.0
             Environment: All
                Reporter: Marcin Skladaniec
                Assignee: Andrus Adamchik

    Junit tests are becoming very important once the project reaches a certain point. Cayenne has dozens of junit tests but writing a junit test for cayenne based application is not easy at all.

    For me the main trouble is when there is no need to fetch or commit something (like testing GUI or lifecycle events). I tried to reproduce the tests found in cayenne,but always ended up with problems with mocking up the context, datachannel, entityResolver, altering the configuration to point to different db etc.

    To solve that my idea was that one might specify a package in the CayenneModeler, this package will than be populated with generated a set of _MockupXXX extends XXX (like _MockupArtist extends Artist, _MockupPainting extends Painting etc.) and a MockupDataContext etc. There could be a second set of _MockupEntities for ROP client.

    Another thing is to specify the testing environment with ease. I think there should be also a possibility to create a "testing" DataNode pointing to a different database than deployment, and for the DataMap could be related to the real or testing DataNode at the same time. To choose the testing environment a system param like -Dcayenne.testing=TRUE could be utilised.
    I might have missed something here: is there a simply way of having two DataNodes for one DataMap ?

    I think that simplified testcase writing feature would be a great advantage for Cayenne over any other ORM.

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Tue Sep 04 2007 - 21:56:18 EDT