Naming pattern of test definition files

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

Naming pattern of test definition files

Vikas Mayur-3
Hi,

The test definition files name is not consistent throughout the  
project. Some of the files name is all lowercase and others have camel  
case pattern.

I think we can follow the pattern used in service definition files.

The files under accounting/testdef are

accountingtests.xml
invoicetests.xml
paymenttests.xml
fixedassettests.xml

and would be (after this change)

tests.xml (generic test)
tests_invoice.xml (tests specific to invoices)
tests_payment.xml (tests specific to payments)
tests_fixedasset.xml (tests specific to fixed assets)
etc..

Any thoughts?

Vikas


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Rishi Solanki
+1.

Rishi Solanki
Enterprise Software Developer
HotWax Media Pvt. Ltd.


On Tue, Dec 29, 2009 at 6:24 PM, Vikas Mayur <[hidden email]>wrote:

> Hi,
>
> The test definition files name is not consistent throughout the project.
> Some of the files name is all lowercase and others have camel case pattern.
>
> I think we can follow the pattern used in service definition files.
>
> The files under accounting/testdef are
>
> accountingtests.xml
> invoicetests.xml
> paymenttests.xml
> fixedassettests.xml
>
> and would be (after this change)
>
> tests.xml (generic test)
> tests_invoice.xml (tests specific to invoices)
> tests_payment.xml (tests specific to payments)
> tests_fixedasset.xml (tests specific to fixed assets)
> etc..
>
> Any thoughts?
>
> Vikas
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Jacques Le Roux
Administrator
Yes sounds logical
+1

Jacques

From: "Rishi Solanki" <[hidden email]>

> +1.
>
> Rishi Solanki
> Enterprise Software Developer
> HotWax Media Pvt. Ltd.
>
>
> On Tue, Dec 29, 2009 at 6:24 PM, Vikas Mayur <[hidden email]>wrote:
>
>> Hi,
>>
>> The test definition files name is not consistent throughout the project.
>> Some of the files name is all lowercase and others have camel case pattern.
>>
>> I think we can follow the pattern used in service definition files.
>>
>> The files under accounting/testdef are
>>
>> accountingtests.xml
>> invoicetests.xml
>> paymenttests.xml
>> fixedassettests.xml
>>
>> and would be (after this change)
>>
>> tests.xml (generic test)
>> tests_invoice.xml (tests specific to invoices)
>> tests_payment.xml (tests specific to payments)
>> tests_fixedasset.xml (tests specific to fixed assets)
>> etc..
>>
>> Any thoughts?
>>
>> Vikas
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Bilgin Ibryam-2
In reply to this post by Vikas Mayur-3
Vikas Mayur wrote:

> Hi,
>
> The test definition files name is not consistent throughout the
> project. Some of the files name is all lowercase and others have camel
> case pattern.
>
> I think we can follow the pattern used in service definition files.
>
> The files under accounting/testdef are
>
> accountingtests.xml
> invoicetests.xml
> paymenttests.xml
> fixedassettests.xml
>
> and would be (after this change)
>
> tests.xml (generic test)
> tests_invoice.xml (tests specific to invoices)
> tests_payment.xml (tests specific to payments)
> tests_fixedasset.xml (tests specific to fixed assets)
> etc..
>
> Any thoughts?
>
> Vikas
>
+ 1 for a naming pattern. The above proposal is fine for me.

Bilgin
Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Scott Gray-2
In reply to this post by Vikas Mayur-3
+1

Regards
Scott

On 30/12/2009, at 1:54 AM, Vikas Mayur wrote:

> Hi,
>
> The test definition files name is not consistent throughout the  
> project. Some of the files name is all lowercase and others have  
> camel case pattern.
>
> I think we can follow the pattern used in service definition files.
>
> The files under accounting/testdef are
>
> accountingtests.xml
> invoicetests.xml
> paymenttests.xml
> fixedassettests.xml
>
> and would be (after this change)
>
> tests.xml (generic test)
> tests_invoice.xml (tests specific to invoices)
> tests_payment.xml (tests specific to payments)
> tests_fixedasset.xml (tests specific to fixed assets)
> etc..
>
> Any thoughts?
>
> Vikas
>


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

David E. Jones-2
In reply to this post by Bilgin Ibryam-2

Why not camel case them like most other files?

-David


On Dec 29, 2009, at 1:05 PM, Bilgin Ibryam wrote:

> Vikas Mayur wrote:
>> Hi,
>>
>> The test definition files name is not consistent throughout the project. Some of the files name is all lowercase and others have camel case pattern.
>>
>> I think we can follow the pattern used in service definition files.
>>
>> The files under accounting/testdef are
>>
>> accountingtests.xml
>> invoicetests.xml
>> paymenttests.xml
>> fixedassettests.xml
>>
>> and would be (after this change)
>>
>> tests.xml (generic test)
>> tests_invoice.xml (tests specific to invoices)
>> tests_payment.xml (tests specific to payments)
>> tests_fixedasset.xml (tests specific to fixed assets)
>> etc..
>>
>> Any thoughts?
>>
>> Vikas
>>
> + 1 for a naming pattern. The above proposal is fine for me.
>
> Bilgin

Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

David E. Jones-2

Actually, most XML files in OFBiz these days (with just a few exceptions) follow a patterns like:

*Services.xml
*Forms.xml
*Screens.xml
*Data.xml
... etc

By that pattern the test files should be *Tests.xml, with the rest of the file camel-cased and an upper-case first letter.

-David


On Dec 29, 2009, at 6:44 PM, David E Jones wrote:

>
> Why not camel case them like most other files?
>
> -David
>
>
> On Dec 29, 2009, at 1:05 PM, Bilgin Ibryam wrote:
>
>> Vikas Mayur wrote:
>>> Hi,
>>>
>>> The test definition files name is not consistent throughout the project. Some of the files name is all lowercase and others have camel case pattern.
>>>
>>> I think we can follow the pattern used in service definition files.
>>>
>>> The files under accounting/testdef are
>>>
>>> accountingtests.xml
>>> invoicetests.xml
>>> paymenttests.xml
>>> fixedassettests.xml
>>>
>>> and would be (after this change)
>>>
>>> tests.xml (generic test)
>>> tests_invoice.xml (tests specific to invoices)
>>> tests_payment.xml (tests specific to payments)
>>> tests_fixedasset.xml (tests specific to fixed assets)
>>> etc..
>>>
>>> Any thoughts?
>>>
>>> Vikas
>>>
>> + 1 for a naming pattern. The above proposal is fine for me.
>>
>> Bilgin
>

Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Sumit Pandit-3
+1 on David's comment, *Tests.xml looking better.

--
Thanks and Regards
Sumit Pandit


On Dec 29, 2009, at 5:47 PM, David E Jones wrote:

>
> Actually, most XML files in OFBiz these days (with just a few exceptions) follow a patterns like:
>
> *Services.xml
> *Forms.xml
> *Screens.xml
> *Data.xml
> ... etc
>
> By that pattern the test files should be *Tests.xml, with the rest of the file camel-cased and an upper-case first letter.
>
> -David
>
>
> On Dec 29, 2009, at 6:44 PM, David E Jones wrote:
>
>>
>> Why not camel case them like most other files?
>>
>> -David
>>
>>
>> On Dec 29, 2009, at 1:05 PM, Bilgin Ibryam wrote:
>>
>>> Vikas Mayur wrote:
>>>> Hi,
>>>>
>>>> The test definition files name is not consistent throughout the project. Some of the files name is all lowercase and others have camel case pattern.
>>>>
>>>> I think we can follow the pattern used in service definition files.
>>>>
>>>> The files under accounting/testdef are
>>>>
>>>> accountingtests.xml
>>>> invoicetests.xml
>>>> paymenttests.xml
>>>> fixedassettests.xml
>>>>
>>>> and would be (after this change)
>>>>
>>>> tests.xml (generic test)
>>>> tests_invoice.xml (tests specific to invoices)
>>>> tests_payment.xml (tests specific to payments)
>>>> tests_fixedasset.xml (tests specific to fixed assets)
>>>> etc..
>>>>
>>>> Any thoughts?
>>>>
>>>> Vikas
>>>>
>>> + 1 for a naming pattern. The above proposal is fine for me.
>>>
>>> Bilgin
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Jacques Le Roux
Administrator
In reply to this post by David E. Jones-2
I was for the  tests-*.xml type of file because it was consistent with services defintions files names. But I should say that I
don't like to have dashes and underscores in names at large (should I say that it remains me my 1st and only short experience with
Cobol 25 years ago ). It would be even easier to have camel-cased and an upper-case first letter almost everywhere it makes sense
(of course keeping uppercase for static var and camel-cased and a lower-case first letter for methods, and anyway Sun conventions
for Java languages). Then you don't have to guess about how to write a name.

So +1 for David's proposition.

Jacques

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

>
> Actually, most XML files in OFBiz these days (with just a few exceptions) follow a patterns like:
>
> *Services.xml
> *Forms.xml
> *Screens.xml
> *Data.xml
> ... etc
>
> By that pattern the test files should be *Tests.xml, with the rest of the file camel-cased and an upper-case first letter.
>
> -David
>
>
> On Dec 29, 2009, at 6:44 PM, David E Jones wrote:
>
>>
>> Why not camel case them like most other files?
>>
>> -David
>>
>>
>> On Dec 29, 2009, at 1:05 PM, Bilgin Ibryam wrote:
>>
>>> Vikas Mayur wrote:
>>>> Hi,
>>>>
>>>> The test definition files name is not consistent throughout the project. Some of the files name is all lowercase and others
>>>> have camel case pattern.
>>>>
>>>> I think we can follow the pattern used in service definition files.
>>>>
>>>> The files under accounting/testdef are
>>>>
>>>> accountingtests.xml
>>>> invoicetests.xml
>>>> paymenttests.xml
>>>> fixedassettests.xml
>>>>
>>>> and would be (after this change)
>>>>
>>>> tests.xml (generic test)
>>>> tests_invoice.xml (tests specific to invoices)
>>>> tests_payment.xml (tests specific to payments)
>>>> tests_fixedasset.xml (tests specific to fixed assets)
>>>> etc..
>>>>
>>>> Any thoughts?
>>>>
>>>> Vikas
>>>>
>>> + 1 for a naming pattern. The above proposal is fine for me.
>>>
>>> Bilgin
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Vikas Mayur-3
Yes but the definition and implementation of a test need two separate  
files. Same is true for a service except the entity-auto feature.

There is an example btw.

party/script/org/ofbiz/party/test/PartyTests.xml
party/testdef/PartyTests.xml

Both of files above reside in different folders in the structure and  
thus there purpose is obvious but still it is very useful to identify  
the purpose of the file when you do lookup in the editor

and I think it is far easier to refer a test definition file if we  
follow the pattern applied to services.

Exceptions are always there but I think they have their own advantages  
if it helps in making an easier reference to a file in this case or  
any thing else.

Vikas

On Dec 30, 2009, at 1:54 PM, Jacques Le Roux wrote:

> I was for the  tests-*.xml type of file because it was consistent  
> with services defintions files names. But I should say that I don't  
> like to have dashes and underscores in names at large (should I say  
> that it remains me my 1st and only short experience with Cobol 25  
> years ago ). It would be even easier to have camel-cased and an  
> upper-case first letter almost everywhere it makes sense (of course  
> keeping uppercase for static var and camel-cased and a lower-case  
> first letter for methods, and anyway Sun conventions for Java  
> languages). Then you don't have to guess about how to write a name.
>
> So +1 for David's proposition.
>
> Jacques
>
> From: "David E Jones" <[hidden email]>
>>
>> Actually, most XML files in OFBiz these days (with just a few  
>> exceptions) follow a patterns like:
>>
>> *Services.xml
>> *Forms.xml
>> *Screens.xml
>> *Data.xml
>> ... etc
>>
>> By that pattern the test files should be *Tests.xml, with the rest  
>> of the file camel-cased and an upper-case first letter.
>>
>> -David
>>
>>
>> On Dec 29, 2009, at 6:44 PM, David E Jones wrote:
>>
>>>
>>> Why not camel case them like most other files?
>>>
>>> -David
>>>
>>>
>>> On Dec 29, 2009, at 1:05 PM, Bilgin Ibryam wrote:
>>>
>>>> Vikas Mayur wrote:
>>>>> Hi,
>>>>>
>>>>> The test definition files name is not consistent throughout the  
>>>>> project. Some of the files name is all lowercase and others have  
>>>>> camel case pattern.
>>>>>
>>>>> I think we can follow the pattern used in service definition  
>>>>> files.
>>>>>
>>>>> The files under accounting/testdef are
>>>>>
>>>>> accountingtests.xml
>>>>> invoicetests.xml
>>>>> paymenttests.xml
>>>>> fixedassettests.xml
>>>>>
>>>>> and would be (after this change)
>>>>>
>>>>> tests.xml (generic test)
>>>>> tests_invoice.xml (tests specific to invoices)
>>>>> tests_payment.xml (tests specific to payments)
>>>>> tests_fixedasset.xml (tests specific to fixed assets)
>>>>> etc..
>>>>>
>>>>> Any thoughts?
>>>>>
>>>>> Vikas
>>>>>
>>>> + 1 for a naming pattern. The above proposal is fine for me.
>>>>
>>>> Bilgin
>>>
>
>


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

David E. Jones-2

If a test is written as a simple-method it should be names like other files, ie as *Services.xml or *SimpleMethods.xml (an older form, not used much).

-David


On Dec 30, 2009, at 2:39 AM, Vikas Mayur wrote:

> Yes but the definition and implementation of a test need two separate files. Same is true for a service except the entity-auto feature.
>
> There is an example btw.
>
> party/script/org/ofbiz/party/test/PartyTests.xml
> party/testdef/PartyTests.xml
>
> Both of files above reside in different folders in the structure and thus there purpose is obvious but still it is very useful to identify the purpose of the file when you do lookup in the editor
>
> and I think it is far easier to refer a test definition file if we follow the pattern applied to services.
>
> Exceptions are always there but I think they have their own advantages if it helps in making an easier reference to a file in this case or any thing else.
>
> Vikas
>
> On Dec 30, 2009, at 1:54 PM, Jacques Le Roux wrote:
>
>> I was for the  tests-*.xml type of file because it was consistent with services defintions files names. But I should say that I don't like to have dashes and underscores in names at large (should I say that it remains me my 1st and only short experience with Cobol 25 years ago ). It would be even easier to have camel-cased and an upper-case first letter almost everywhere it makes sense (of course keeping uppercase for static var and camel-cased and a lower-case first letter for methods, and anyway Sun conventions for Java languages). Then you don't have to guess about how to write a name.
>>
>> So +1 for David's proposition.
>>
>> Jacques
>>
>> From: "David E Jones" <[hidden email]>
>>>
>>> Actually, most XML files in OFBiz these days (with just a few exceptions) follow a patterns like:
>>>
>>> *Services.xml
>>> *Forms.xml
>>> *Screens.xml
>>> *Data.xml
>>> ... etc
>>>
>>> By that pattern the test files should be *Tests.xml, with the rest of the file camel-cased and an upper-case first letter.
>>>
>>> -David
>>>
>>>
>>> On Dec 29, 2009, at 6:44 PM, David E Jones wrote:
>>>
>>>>
>>>> Why not camel case them like most other files?
>>>>
>>>> -David
>>>>
>>>>
>>>> On Dec 29, 2009, at 1:05 PM, Bilgin Ibryam wrote:
>>>>
>>>>> Vikas Mayur wrote:
>>>>>> Hi,
>>>>>>
>>>>>> The test definition files name is not consistent throughout the project. Some of the files name is all lowercase and others have camel case pattern.
>>>>>>
>>>>>> I think we can follow the pattern used in service definition files.
>>>>>>
>>>>>> The files under accounting/testdef are
>>>>>>
>>>>>> accountingtests.xml
>>>>>> invoicetests.xml
>>>>>> paymenttests.xml
>>>>>> fixedassettests.xml
>>>>>>
>>>>>> and would be (after this change)
>>>>>>
>>>>>> tests.xml (generic test)
>>>>>> tests_invoice.xml (tests specific to invoices)
>>>>>> tests_payment.xml (tests specific to payments)
>>>>>> tests_fixedasset.xml (tests specific to fixed assets)
>>>>>> etc..
>>>>>>
>>>>>> Any thoughts?
>>>>>>
>>>>>> Vikas
>>>>>>
>>>>> + 1 for a naming pattern. The above proposal is fine for me.
>>>>>
>>>>> Bilgin
>>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Naming pattern of test definition files

Adam Heath-2
David E Jones wrote:
> If a test is written as a simple-method it should be names like other files, ie as *Services.xml or *SimpleMethods.xml (an older form, not used much).

Shouldn't test definitions(classes, simple methods, entity defs, etc)
only be active if tests are being run?  This would reduce the memory
load during normal runs.