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.

Reply via email to