Potential bug highlighted by unit test

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

Potential bug highlighted by unit test

Scott Gray-2
Who would have thought!

Anyway one of the tests for packing:
         <simple-method-test location="component://product/script/org/
ofbiz/shipment/test/TestServices.xml" name="testPackingServices"/>
(this should actually be broken up into multiple tests by the way)
Calls the completePack service without an supplying an orderId which  
is optional according to the service def.  The problem is that the  
code will always fail if you don't provide an orderId because the  
checkPackedQty method on PackingSession needs an orderId to check that  
the packed quantity matches the order quantities.

So my question is, should completePack.orderId be marked required or  
is the logic in completePack wrong?  For now I'm going to mark orderId  
as required since the code fails without it anyway and doing so will  
just help it to fail faster but I'd leave to hear any thoughts from  
people familiar with the packing process.

Thanks
Scott

HotWax Media
http://www.hotwaxmedia.com




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

Re: Potential bug highlighted by unit test

Scott Gray-2
Fixed that for me :-)

On 2/05/2009, at 9:27 PM, Scott Gray wrote:

> Who would have thought!
>
> Anyway one of the tests for packing:
>        <simple-method-test location="component://product/script/org/
> ofbiz/shipment/test/TestServices.xml" name="testPackingServices"/>
> (this should actually be broken up into multiple tests by the way)
> Calls the completePack service without an supplying an orderId which  
> is optional according to the service def.  The problem is that the  
> code will always fail if you don't provide an orderId because the  
> checkPackedQty method on PackingSession needs an orderId to check  
> that the packed quantity matches the order quantities.
>
> So my question is, should completePack.orderId be marked required or  
> is the logic in completePack wrong?  For now I'm going to mark  
> orderId as required since the code fails without it anyway and doing  
> so will just help it to fail faster but I'd
love

> to hear any thoughts from people familiar with the packing process.
>
> Thanks
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
>
>


smime.p7s (3K) Download Attachment