From: Oleg A. <oan...@ea...> - 2008-03-06 00:19:37
|
Author: oandreyev Date: 2008-03-05 16:19:42 -0800 (Wed, 05 Mar 2008) New Revision: 7962 Modified: versions/1.0/trunk/hot-deploy/opentaps-tests/src/org/opentaps/tests/OpentapsTestCase.java Log: 0229-8. Add to testCreatesSales[Purchase]Order some code to check if aspect aroundCreateOrder fill OrderHeader fields billFromPartyId and billToPartyId. Modified: versions/1.0/trunk/hot-deploy/opentaps-tests/src/org/opentaps/tests/OpentapsTestCase.java =================================================================== --- versions/1.0/trunk/hot-deploy/opentaps-tests/src/org/opentaps/tests/OpentapsTestCase.java 2008-03-05 23:47:03 UTC (rev 7961) +++ versions/1.0/trunk/hot-deploy/opentaps-tests/src/org/opentaps/tests/OpentapsTestCase.java 2008-03-06 00:19:42 UTC (rev 7962) @@ -555,9 +555,15 @@ try { String orderId = sof.storeOrder(); Debug.logInfo("Created order [" + orderId + "]", module); + + GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + assertTrue("Order [" + orderId + "] has no billFromPartyId or billToPartyId values.", UtilValidate.isEmpty(orderHeader.getString("billToPartyId")) || UtilValidate.isEmpty(orderHeader.getString("billFromPartyId"))); + sof.approveOrder(); - } catch (GenericServiceException e) { - assertTrue("GenericServiceException:" + e.toString(), false); + } catch (GenericServiceException gse) { + assertTrue("GenericServiceException:" + gse.toString(), false); + } catch (GenericEntityException gee) { + assertTrue("GenericEntityException:" + gee.toString(), false); } finally { point.collect(); } @@ -670,8 +676,14 @@ try { String orderId = pof.storeOrder(); Debug.logInfo("Created order [" + orderId + "]", module); - } catch (GenericServiceException e) { - assertTrue("GenericServiceException:" + e.toString(), false); + + GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + assertTrue("Order [" + orderId + "] has no billFromPartyId or billToPartyId values.", UtilValidate.isEmpty(orderHeader.getString("billToPartyId")) || UtilValidate.isEmpty(orderHeader.getString("billFromPartyId"))); + + } catch (GenericServiceException gse) { + assertTrue("GenericServiceException:" + gse.toString(), false); + } catch (GenericEntityException gee) { + assertTrue("GenericEntityException:" + gee.toString(), false); } finally { point.collect(); } |