[OFBiz] Dev - Check entity in TestMaker script

David E. Jones jonesde at ofbiz.org
Tue Jul 12 12:15:08 EDT 2005


That sounds great. I imagine there are various people interested in  
this now, and I am certainly one of them... It would be really great  
to get some infrastructure in place to user the Jython test scripts  
with OFBiz, and hopefully once that is done we'll start getting a  
good library of automated functional tests going...

-David


On Jul 12, 2005, at 7:04 AM, Li, Yan wrote:

> Hello David,
>
> We've make it.
>
> My partner and I spent this whole afternoon working on a Jython
> XMLComparator to compare two entity's XML files. Now the whole test  
> worked
> well, and can accept any XML entity writing style we can think of.  
> It's
> handy. :)
>
> Too late today, I'll post our results tomorrow or a few days later.
>
> Best regards,
> ___________________________
> Li, Yan
> elliot.li at gmail.com
>
>
>> -----Original Message-----
>> From: dev-bounces at lists.ofbiz.org
>> [mailto:dev-bounces at lists.ofbiz.org] On Behalf Of David E. Jones
>> Sent: Tuesday, July 12, 2005 12:03 PM
>> To: OFBiz Project Development Discussion
>> Subject: Re: [OFBiz] Dev - Check entity in TestMaker script
>>
>>
>> Wow... What a pain... This is why we want to create a more
>> general test running that can use combination of testing
>> techniques. In this case using a simple-method to check the
>> data would be a LOT easier...
>>
>> Best of luck with this approach anyway,
>> -David
>>
>>
>> On Jul 11, 2005, at 6:19 PM, Li, Yan wrote:
>>
>>
>>> Hello,
>>>
>>> I'm using Testmaker to do Functional Test on OFBiz's web
>>>
>> applications.
>>
>>> I've work out a way to check the entity after a series of business
>>> actions.
>>>
>>> My test script was like this:
>>> ==========================
>>> def runTest( self ):
>>>     ''' Run the test '''
>>>     self.log( 1, "test: runTest" )
>>>
>>>     # login
>>>     self.get(
>>> '''http://211.64.149.155:8080/ordermgr/control/login?
>>> USERNAME=admin&PASSWORD
>>> =ofbiz''')
>>>
>>>     # create a new order
>>>     self.get(
>>> '''http://211.64.149.155:8080/ordermgr/control/createOrder?
>>> customerName=Yan'
>>> '')
>>>
>>>     # check whether the record is correctly created in the Order
>>> entity.
>>>     # export the Order entity to an XML file.
>>>     self.get(
>>> '''http://211.64.149.155:8080/webtools/control/login?
>>> USERNAME=admin&PASSWORD
>>> =ofbiz''')
>>>     self.get(
>>> '''http://211.64.149.155:8080/webtools/control/xmldsdump?
>>> entityName=Order&fi
>>> lename=c:%5ctemp%5cnew.xml''')
>>>
>>>     # logout
>>>     self.get(
>>> '''http://211.64.149.155:8080/contractman/control/logout''')
>>> ==========================
>>>
>>> I used webtools/xmldsdump to dump the entity I required to
>>>
>> an XML file
>>
>>> for later check. Now I have c:\temp\new.xml.
>>>
>>> Now I'm writing some code to compare it with a template,
>>>
>> its interface
>>
>>> should be like this:
>>> ==========================
>>>     assertEntityEqual( '''ExpectedOrder.xml''', '''c:\temp
>>>
>> \new.xml'''
>>
>>> ) ==========================
>>>
>>> And the file "ExpectedOrder.xml" would be something like this:
>>> ==========================
>>> <?xml version="1.0" encoding="UTF-8"?> <entity-engine-xml>
>>>     <Order customerName="Yan" orderStatusId="NOT_SUBMIT" />
>>> </entity-engine-xml> ==========================
>>>
>>> Oh, I've disabled the SSL to simplify my test.
>>>
>>> Any suggestions are welcome!
>>>
>>> Best regards,
>>> ___________________________
>>> Li, Yan
>>> elliot.li at gmail.com
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: dev-bounces at lists.ofbiz.org
>>>> [mailto:dev-bounces at lists.ofbiz.org] On Behalf Of Li, Yan
>>>> Sent: 2005年7月8日 14:29
>>>> To: dev at lists.ofbiz.org
>>>> Subject: [OFBiz] Dev - Check entity in TestMaker script
>>>>
>>>> Hello,
>>>>
>>>> As I mentioned in my previous mails, I'm currently work on the
>>>> automatic test of web applications, trying to find a relatively
>>>> better way to cover our future web applications with auto-test.
>>>>
>>>> Guided by Brett and David, I've examined JXUnit and
>>>>
>> TestMaker during
>>
>>>> these days. The idea of using a general purpose script language
>>>> (Jython) as the testing script attracts me, for I don't
>>>>
>> have to learn
>>
>>>> another XML-like script language to make my test.
>>>>
>>>> What I'm considering now is trying to write some script as
>>>>
>> Functional
>>
>>>> test for a fast-prototype application we've built around OFBiz
>>>> someday before.
>>>> Now the first problem is I've to find a way to check the
>>>>
>> correction
>>
>>>> of data in DBMS. In the sample scripts of TestMaker, JDBC
>>>>
>> was used to
>>
>>>> access the database, and do manipulation and check. I don't like
>>>> that, for I'm an Entity-Engine-infected man and hate to write a
>>>> single SQL. :)
>>>>
>>>> David once said in a mail that "We would also create extensions to
>>>> the simple-methods to make many types of tests easier to
>>>>
>> write, like
>>
>>>> the ability to load an Entity Engine XML import/export
>>>>
>> file, or use
>>
>>>> such a file as an "assertion"
>>>> meaning that the data in the file must exist and match the
>>>> information in the database." I think it would be great if
>>>>
>> we can use
>>
>>>> a "data file" (whether XML or not) as an "assertion", but that
>>>> undoubtedly required a lot of work. To start simple,
>>>>
>> Brett's approach
>>
>>>> (in JXUnit extension, he use bsh to do
>>>> verify) seems simple and effective. And now I'm looking
>>>>
>> for a way to
>>
>>>> do same job in TestMaker.
>>>>
>>>> Am I on the correct road?
>>>>
>>>> BTW: While examing the JXUnit included with OFBiz, I can't
>>>>
>> find the
>>
>>>> file "verifyRights.bsh", which was used in
>>>> "framework/tests/examples/permissionTest/test.jxu". Where is it?
>>>>
>>>> Best regards,
>>>> ___________________________
>>>> Li, Yan
>>>> elliot.li at gmail.com
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev at lists.ofbiz.org
>>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at lists.ofbiz.org
>>> http://lists.ofbiz.org/mailman/listinfo/dev
>>>
>>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/dev
>>
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/dev
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2363 bytes
Desc: not available
Url : http://lists.ofbiz.org/pipermail/dev/attachments/20050712/c9e22e8d/smime-0001.bin


More information about the Dev mailing list