Preparing Test Data for OFBiz JUnit Tests

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Preparing Test Data for OFBiz JUnit Tests

Mridul Pathak-2
Hi All,
    Here are some of my opinions  for everyone in the community who are working on JUnit Test Case implementation for various processes in OFBiz:

1) While doing entry for any Test Data file in ofbiz-component.xml use reader-name="ext-test".
2) While running test cases use following build target with ant: "run-install-exttest".
3) These are the test case specific reader-name and target in OFBiz, so I think it is more appropriate to use them.
4) While using the target "run-install-exttest",  no OFBiz Demo Data is uploaded to the database.  So while preparing the Test Data make sure that it has no dependencies on any Demo Data.

    Any comments for improvement or correction in my thoughts are appreciable.

--
Thanks & Regards

Mridul Pathak
Team Lead
HotWax Media Inc.
http://www.hotwaxmedia.com
[hidden email]
_____________________________
Office     : 509.855.4113
Mobile     : +919425926892
Reply | Threaded
Open this post in threaded view
|

Re: Preparing Test Data for OFBiz JUnit Tests

David E Jones

1. tests SHOULD use the demo data; it is there for demonstration and  
testing, and not using it would make various test scenarios more  
complicated, and also introduce more dependencies between test cases  
(as data that could be simply used would also have to be prepared)

2. please don't use the ext-test data file group; all of the ext* file  
groups are meant to be used by components added onto OFBiz, and not by  
anything in OFBiz itself; generally the best place for this is in the  
"demo" file group, as then the data can be used for manual testing and  
demonstration in addition to automated tests

-David


On Mar 12, 2008, at 11:30 PM, Mridul Pathak wrote:

> Hi All,
>     Here are some of my opinions  for everyone in the community who  
> are working on JUnit Test Case implementation for various processes  
> in OFBiz:
>
> 1) While doing entry for any Test Data file in ofbiz-component.xml  
> use reader-name="ext-test".
> 2) While running test cases use following build target with ant:  
> "run-install-exttest".
> 3) These are the test case specific reader-name and target in OFBiz,  
> so I think it is more appropriate to use them.
> 4) While using the target "run-install-exttest",  no OFBiz Demo Data  
> is uploaded to the database.  So while preparing the Test Data make  
> sure that it has no dependencies on any Demo Data.
>
>     Any comments for improvement or correction in my thoughts are  
> appreciable.
>
> --
> Thanks & Regards
>
> Mridul Pathak
> Team Lead
> HotWax Media Inc.
> http://www.hotwaxmedia.com
> [hidden email]
> _____________________________
> Office     : 509.855.4113
> Mobile     : +919425926892

Reply | Threaded
Open this post in threaded view
|

Re: Preparing Test Data for OFBiz JUnit Tests

Mridul Pathak-2
David,
    Thanks for correcting me.  Actually, there was a problem using Demo
Data while preparing test data for order component.  OrderTestData.xml
goes in the Order component.  All the Demo Data for ProductStore,
DemoCustomer, etc. is in Ecommerce.  Now, as the data for order
component is loaded before the data in ecommerce component, it is
getting difficult to use the demo data for the order.  Is it possible
and appropriate to move the OrderTestData.xml file in ecommerce component?
    Can you please suggest solution for this problem?

--
Thanks & Regards

Mridul Pathak
Team Lead
HotWax Media Inc.
http://www.hotwaxmedia.com
[hidden email]
_____________________________
Office     : 509.855.4113
Mobile     : +919425926892



David E Jones wrote:

>
> 1. tests SHOULD use the demo data; it is there for demonstration and
> testing, and not using it would make various test scenarios more
> complicated, and also introduce more dependencies between test cases
> (as data that could be simply used would also have to be prepared)
>
> 2. please don't use the ext-test data file group; all of the ext* file
> groups are meant to be used by components added onto OFBiz, and not by
> anything in OFBiz itself; generally the best place for this is in the
> "demo" file group, as then the data can be used for manual testing and
> demonstration in addition to automated tests
>
> -David
>
>
> On Mar 12, 2008, at 11:30 PM, Mridul Pathak wrote:
>
>> Hi All,
>>     Here are some of my opinions  for everyone in the community who
>> are working on JUnit Test Case implementation for various processes
>> in OFBiz:
>>
>> 1) While doing entry for any Test Data file in ofbiz-component.xml
>> use reader-name="ext-test".
>> 2) While running test cases use following build target with ant:
>> "run-install-exttest".
>> 3) These are the test case specific reader-name and target in OFBiz,
>> so I think it is more appropriate to use them.
>> 4) While using the target "run-install-exttest",  no OFBiz Demo Data
>> is uploaded to the database.  So while preparing the Test Data make
>> sure that it has no dependencies on any Demo Data.
>>
>>     Any comments for improvement or correction in my thoughts are
>> appreciable.
>>
>> --
>> Thanks & Regards
>>
>> Mridul Pathak
>> Team Lead
>> HotWax Media Inc.
>> http://www.hotwaxmedia.com
>> [hidden email]
>> _____________________________
>> Office     : 509.855.4113
>> Mobile     : +919425926892
>
Reply | Threaded
Open this post in threaded view
|

Re: Preparing Test Data for OFBiz JUnit Tests

David E Jones

Why not run "ant run-install" before running the "ant run-tests"?

With that all data would be in place before the tests run.

-David


On Mar 13, 2008, at 12:16 AM, Mridul Pathak wrote:

> David,
>   Thanks for correcting me.  Actually, there was a problem using  
> Demo Data while preparing test data for order component.  
> OrderTestData.xml goes in the Order component.  All the Demo Data  
> for ProductStore, DemoCustomer, etc. is in Ecommerce.  Now, as the  
> data for order component is loaded before the data in ecommerce  
> component, it is getting difficult to use the demo data for the  
> order.  Is it possible and appropriate to move the OrderTestData.xml  
> file in ecommerce component?
>   Can you please suggest solution for this problem?
>
> --
> Thanks & Regards
>
> Mridul Pathak
> Team Lead
> HotWax Media Inc.
> http://www.hotwaxmedia.com
> [hidden email]
> _____________________________
> Office     : 509.855.4113
> Mobile     : +919425926892
>
>
>
> David E Jones wrote:
>>
>> 1. tests SHOULD use the demo data; it is there for demonstration  
>> and testing, and not using it would make various test scenarios  
>> more complicated, and also introduce more dependencies between test  
>> cases (as data that could be simply used would also have to be  
>> prepared)
>>
>> 2. please don't use the ext-test data file group; all of the ext*  
>> file groups are meant to be used by components added onto OFBiz,  
>> and not by anything in OFBiz itself; generally the best place for  
>> this is in the "demo" file group, as then the data can be used for  
>> manual testing and demonstration in addition to automated tests
>>
>> -David
>>
>>
>> On Mar 12, 2008, at 11:30 PM, Mridul Pathak wrote:
>>
>>> Hi All,
>>>    Here are some of my opinions  for everyone in the community who  
>>> are working on JUnit Test Case implementation for various  
>>> processes in OFBiz:
>>>
>>> 1) While doing entry for any Test Data file in ofbiz-component.xml  
>>> use reader-name="ext-test".
>>> 2) While running test cases use following build target with ant:  
>>> "run-install-exttest".
>>> 3) These are the test case specific reader-name and target in  
>>> OFBiz, so I think it is more appropriate to use them.
>>> 4) While using the target "run-install-exttest",  no OFBiz Demo  
>>> Data is uploaded to the database.  So while preparing the Test  
>>> Data make sure that it has no dependencies on any Demo Data.
>>>
>>>    Any comments for improvement or correction in my thoughts are  
>>> appreciable.
>>>
>>> --
>>> Thanks & Regards
>>>
>>> Mridul Pathak
>>> Team Lead
>>> HotWax Media Inc.
>>> http://www.hotwaxmedia.com
>>> [hidden email]
>>> _____________________________
>>> Office     : 509.855.4113
>>> Mobile     : +919425926892
>>

Reply | Threaded
Open this post in threaded view
|

Re: Preparing Test Data for OFBiz JUnit Tests

Mridul Pathak-2

That is a great idea.  I think most of the people who are currently
working on JUnit Tests are just using "ant run-install" and nobody has
used "ant run-tests" yet.

I have a confusion though with "ant run-tests".  In the main build.xml
file, where this target is defined, there are no arguments passed for
the reader-name.  Actually I think that for Test Data files there should
be a different reader-name e.g. "test", because if we use "demo" it will
get loaded when we run "ant run-install".  So for using "ant
run-install" followed by "ant run-tests", we should create a new
reader-name for test data files and pass only this reader-name to the
"run-tests" target in main build.xml file.  This way "run-install" will
load all the data and after that running "run-tests" will just load the
test data.

Am I thinking correct??

--
Thanks & Regards

Mridul Pathak
Team Lead
HotWax Media Inc.
http://www.hotwaxmedia.com
[hidden email]
_____________________________
Office     : 509.855.4113
Mobile     : +919425926892



David E Jones wrote:

>
> Why not run "ant run-install" before running the "ant run-tests"?
>
> With that all data would be in place before the tests run.
>
> -David
>
>
> On Mar 13, 2008, at 12:16 AM, Mridul Pathak wrote:
>
>> David,
>>   Thanks for correcting me.  Actually, there was a problem using Demo
>> Data while preparing test data for order component.  
>> OrderTestData.xml goes in the Order component.  All the Demo Data for
>> ProductStore, DemoCustomer, etc. is in Ecommerce.  Now, as the data
>> for order component is loaded before the data in ecommerce component,
>> it is getting difficult to use the demo data for the order.  Is it
>> possible and appropriate to move the OrderTestData.xml file in
>> ecommerce component?
>>   Can you please suggest solution for this problem?
>>
>> --
>> Thanks & Regards
>>
>> Mridul Pathak
>> Team Lead
>> HotWax Media Inc.
>> http://www.hotwaxmedia.com
>> [hidden email]
>> _____________________________
>> Office     : 509.855.4113
>> Mobile     : +919425926892
>>
>>
>>
>> David E Jones wrote:
>>>
>>> 1. tests SHOULD use the demo data; it is there for demonstration and
>>> testing, and not using it would make various test scenarios more
>>> complicated, and also introduce more dependencies between test cases
>>> (as data that could be simply used would also have to be prepared)
>>>
>>> 2. please don't use the ext-test data file group; all of the ext*
>>> file groups are meant to be used by components added onto OFBiz, and
>>> not by anything in OFBiz itself; generally the best place for this
>>> is in the "demo" file group, as then the data can be used for manual
>>> testing and demonstration in addition to automated tests
>>>
>>> -David
>>>
>>>
>>> On Mar 12, 2008, at 11:30 PM, Mridul Pathak wrote:
>>>
>>>> Hi All,
>>>>    Here are some of my opinions  for everyone in the community who
>>>> are working on JUnit Test Case implementation for various processes
>>>> in OFBiz:
>>>>
>>>> 1) While doing entry for any Test Data file in ofbiz-component.xml
>>>> use reader-name="ext-test".
>>>> 2) While running test cases use following build target with ant:
>>>> "run-install-exttest".
>>>> 3) These are the test case specific reader-name and target in
>>>> OFBiz, so I think it is more appropriate to use them.
>>>> 4) While using the target "run-install-exttest",  no OFBiz Demo
>>>> Data is uploaded to the database.  So while preparing the Test Data
>>>> make sure that it has no dependencies on any Demo Data.
>>>>
>>>>    Any comments for improvement or correction in my thoughts are
>>>> appreciable.
>>>>
>>>> --Thanks & Regards
>>>>
>>>> Mridul Pathak
>>>> Team Lead
>>>> HotWax Media Inc.
>>>> http://www.hotwaxmedia.com
>>>> [hidden email]
>>>> _____________________________
>>>> Office     : 509.855.4113
>>>> Mobile     : +919425926892
>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Preparing Test Data for OFBiz JUnit Tests

Jacques Le Roux
Administrator
In reply to this post by David E Jones
In such case be sure that your default delegator use the same datasource than the test delegator.

Jacques

From: "David E Jones" <[hidden email]>

>
> Why not run "ant run-install" before running the "ant run-tests"?
>
> With that all data would be in place before the tests run.
>
> -David
>
>
> On Mar 13, 2008, at 12:16 AM, Mridul Pathak wrote:
>
>> David,
>>   Thanks for correcting me.  Actually, there was a problem using  
>> Demo Data while preparing test data for order component.  
>> OrderTestData.xml goes in the Order component.  All the Demo Data  
>> for ProductStore, DemoCustomer, etc. is in Ecommerce.  Now, as the  
>> data for order component is loaded before the data in ecommerce  
>> component, it is getting difficult to use the demo data for the  
>> order.  Is it possible and appropriate to move the OrderTestData.xml  
>> file in ecommerce component?
>>   Can you please suggest solution for this problem?
>>
>> --
>> Thanks & Regards
>>
>> Mridul Pathak
>> Team Lead
>> HotWax Media Inc.
>> http://www.hotwaxmedia.com
>> [hidden email]
>> _____________________________
>> Office     : 509.855.4113
>> Mobile     : +919425926892
>>
>>
>>
>> David E Jones wrote:
>>>
>>> 1. tests SHOULD use the demo data; it is there for demonstration  
>>> and testing, and not using it would make various test scenarios  
>>> more complicated, and also introduce more dependencies between test  
>>> cases (as data that could be simply used would also have to be  
>>> prepared)
>>>
>>> 2. please don't use the ext-test data file group; all of the ext*  
>>> file groups are meant to be used by components added onto OFBiz,  
>>> and not by anything in OFBiz itself; generally the best place for  
>>> this is in the "demo" file group, as then the data can be used for  
>>> manual testing and demonstration in addition to automated tests
>>>
>>> -David
>>>
>>>
>>> On Mar 12, 2008, at 11:30 PM, Mridul Pathak wrote:
>>>
>>>> Hi All,
>>>>    Here are some of my opinions  for everyone in the community who  
>>>> are working on JUnit Test Case implementation for various  
>>>> processes in OFBiz:
>>>>
>>>> 1) While doing entry for any Test Data file in ofbiz-component.xml  
>>>> use reader-name="ext-test".
>>>> 2) While running test cases use following build target with ant:  
>>>> "run-install-exttest".
>>>> 3) These are the test case specific reader-name and target in  
>>>> OFBiz, so I think it is more appropriate to use them.
>>>> 4) While using the target "run-install-exttest",  no OFBiz Demo  
>>>> Data is uploaded to the database.  So while preparing the Test  
>>>> Data make sure that it has no dependencies on any Demo Data.
>>>>
>>>>    Any comments for improvement or correction in my thoughts are  
>>>> appreciable.
>>>>
>>>> --
>>>> Thanks & Regards
>>>>
>>>> Mridul Pathak
>>>> Team Lead
>>>> HotWax Media Inc.
>>>> http://www.hotwaxmedia.com
>>>> [hidden email]
>>>> _____________________________
>>>> Office     : 509.855.4113
>>>> Mobile     : +919425926892
>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Preparing Test Data for OFBiz JUnit Tests

David E Jones
In reply to this post by Mridul Pathak-2

The point is that there is no reason to separate the demo and test  
data, and there are lots of reasons for combining them. Data that we  
use for demonstration and manual tests is just as good for automated  
tests, and for the most part the reverse is true (data good for  
automated tests is also good for demonstration and manual tests).

-David


On Mar 14, 2008, at 1:09 AM, Mridul Pathak wrote:

>
> That is a great idea.  I think most of the people who are currently  
> working on JUnit Tests are just using "ant run-install" and nobody  
> has used "ant run-tests" yet.
>
> I have a confusion though with "ant run-tests".  In the main  
> build.xml file, where this target is defined, there are no arguments  
> passed for the reader-name.  Actually I think that for Test Data  
> files there should be a different reader-name e.g. "test", because  
> if we use "demo" it will get loaded when we run "ant run-install".  
> So for using "ant run-install" followed by "ant run-tests", we  
> should create a new reader-name for test data files and pass only  
> this reader-name to the "run-tests" target in main build.xml file.  
> This way "run-install" will load all the data and after that running  
> "run-tests" will just load the test data.
>
> Am I thinking correct??
>
> --
> Thanks & Regards
>
> Mridul Pathak
> Team Lead
> HotWax Media Inc.
> http://www.hotwaxmedia.com
> [hidden email]
> _____________________________
> Office     : 509.855.4113
> Mobile     : +919425926892
>
>
>
> David E Jones wrote:
>>
>> Why not run "ant run-install" before running the "ant run-tests"?
>>
>> With that all data would be in place before the tests run.
>>
>> -David
>>
>>
>> On Mar 13, 2008, at 12:16 AM, Mridul Pathak wrote:
>>
>>> David,
>>>  Thanks for correcting me.  Actually, there was a problem using  
>>> Demo Data while preparing test data for order component.  
>>> OrderTestData.xml goes in the Order component.  All the Demo Data  
>>> for ProductStore, DemoCustomer, etc. is in Ecommerce.  Now, as the  
>>> data for order component is loaded before the data in ecommerce  
>>> component, it is getting difficult to use the demo data for the  
>>> order.  Is it possible and appropriate to move the  
>>> OrderTestData.xml file in ecommerce component?
>>>  Can you please suggest solution for this problem?
>>>
>>> --
>>> Thanks & Regards
>>>
>>> Mridul Pathak
>>> Team Lead
>>> HotWax Media Inc.
>>> http://www.hotwaxmedia.com
>>> [hidden email]
>>> _____________________________
>>> Office     : 509.855.4113
>>> Mobile     : +919425926892
>>>
>>>
>>>
>>> David E Jones wrote:
>>>>
>>>> 1. tests SHOULD use the demo data; it is there for demonstration  
>>>> and testing, and not using it would make various test scenarios  
>>>> more complicated, and also introduce more dependencies between  
>>>> test cases (as data that could be simply used would also have to  
>>>> be prepared)
>>>>
>>>> 2. please don't use the ext-test data file group; all of the ext*  
>>>> file groups are meant to be used by components added onto OFBiz,  
>>>> and not by anything in OFBiz itself; generally the best place for  
>>>> this is in the "demo" file group, as then the data can be used  
>>>> for manual testing and demonstration in addition to automated tests
>>>>
>>>> -David
>>>>
>>>>
>>>> On Mar 12, 2008, at 11:30 PM, Mridul Pathak wrote:
>>>>
>>>>> Hi All,
>>>>>   Here are some of my opinions  for everyone in the community  
>>>>> who are working on JUnit Test Case implementation for various  
>>>>> processes in OFBiz:
>>>>>
>>>>> 1) While doing entry for any Test Data file in ofbiz-
>>>>> component.xml use reader-name="ext-test".
>>>>> 2) While running test cases use following build target with ant:  
>>>>> "run-install-exttest".
>>>>> 3) These are the test case specific reader-name and target in  
>>>>> OFBiz, so I think it is more appropriate to use them.
>>>>> 4) While using the target "run-install-exttest",  no OFBiz Demo  
>>>>> Data is uploaded to the database.  So while preparing the Test  
>>>>> Data make sure that it has no dependencies on any Demo Data.
>>>>>
>>>>>   Any comments for improvement or correction in my thoughts are  
>>>>> appreciable.
>>>>>
>>>>> --Thanks & Regards
>>>>>
>>>>> Mridul Pathak
>>>>> Team Lead
>>>>> HotWax Media Inc.
>>>>> http://www.hotwaxmedia.com
>>>>> [hidden email]
>>>>> _____________________________
>>>>> Office     : 509.855.4113
>>>>> Mobile     : +919425926892
>>>>
>>