Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Testing

The setup of the XUnit Tests application is very like that of the Documentation application. It looks for this file, which our application has to expose:

Example 2-5. [moduleroot]/etc/system/Tests.xml

<?xml version="1.0" encoding="UTF-8"?>
<tests>
  <test>
    <id>test:urn:org:netkernelbook:chapter2:extjs_server</id>
    <name>ExtJS Server</name>
    <desc>netkernelbook chapter2 extjs server unittest</desc>
    <uri>res:/resources/unittest/testlist.xml</uri>
  </test>
</tests>

This gets your application into the XUnit Tests application. It also tells us that the tests are described in the [moduleroot]/resources/unittest directory.

Example 2-6. [moduleroot]/resources/unittest/testlist.xml

<?xml version="1.0" encoding="UTF-8"?>
<testlist>
  <test name="Invoke ExtJS-3.0.0">
    <request>
      <identifier>res:/ExtJS-3.0.0/docs/index.html</identifier>
    </request>
    <assertDefinition name="validExtJS300">
      <identifier>active:xpatheval</identifier>
      <argument name="operand" >arg:test:result</argument>
      <argument name="operator">
        res:/resources/unittest/xpath/validExtJS300.xpath
      </argument>
    </assertDefinition>
    <assert>
      <validExtJS300/>
    </assert>
  </test>

  <test name="Invoke ExtJS-3.1.0">
    <request>
      <identifier>res:/ExtJS-3.1.0/docs/index.html</identifier>
    </request>
    <assertDefinition name="validExtJS310">
      <identifier>active:xpatheval</identifier>
      ....

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial