SAT: Socket Acceptance Test: XML

Rick Mugridge, University of Auckland, October 2002

Sat is a framework for testing socket-based servers, as defined elsewhere (TestSAT.html). We focus here on the processing of messages that are encoded in XML.

A SatXmlFixture is the same as a SatFixture, except that the messages sent and received are in XML. This means that:

XML Tests


A ServerEcho just sends back what it receives.
comment Shorthand tag works fine:
send <Hello></Hello>
rx <Hello/>
comment Spaces in tag don't matter:
send <Hello    a="1"  />
rx <Hello a="1"/>
comment Attributes the same:
send <Hello a="1" b="2"></Hello>
rx <Hello a="1" b="2"/>
send <Hello b="2"   a="1" ></Hello>
rx <Hello a="1" b="2"/>
comment Attributes differ:
send <Hello a="1"  />
rxDiffers <Hello a="2"/>
send <Hello b="2"   a="1" />
rxDiffers <Hello a="1" b="2" c="3"/>
send <Hello b="2"   a="1" />
rxDiffers <Hello a="1" b="3"/>
send <Shutdown/>

Elements and Text
send <Hello>abc</Hello>
rx <Hello>abc</Hello>
send <Hello    a="1"  >abc</Hello>
rx <Hello a="1" >abc</Hello>
comment Spaces don't matter around tags:
send <Hello>    <Hi/>      <Hiss/> </Hello>
rx <Hello><Hi/><Hiss/></Hello>
send <Hello>    <Hi/><A>x</A><Hi/> </Hello>
rx <Hello><Hi/><A>x</A><Hi/></Hello>
comment Spaces do matter around text:
send <Hello><Hi/><A>x</A><Hi/></Hello>
rxDiffers <Hello><Hi/><A>   x  </A><Hi/></Hello>
comment Order matters:
send <Hello>    <Hi/>      <Hiss/> </Hello>
rxDiffers <Hello><Hiss/><Hi/></Hello>
comment All elements need to be there:
send <Hello><Hi/><Hiss/></Hello>
rxDiffers <Hello><Hiss/></Hello>
send <Shutdown/>

Using HTML tags for layout

HTML tags may be used for layout in a cell. They are stripped off before the XML is used.
send <Gidday>


rx <Gidday/>
send <Gidday>
  • <one/>
  • <two/>
  • <three/>


rx <Gidday><one/><two/><three/></Gidday>
send <Shutdown/>


counts 41 right, 0 wrong, 0 ignored, 0 exceptions
input file c:\Documents and Settings\csad\My Documents\Rick\work\sat\satFit\TestSatXml.html
input update Wed Dec 04 07:12:30 NZDT 2002
output file c:\Documents and Settings\csad\My Documents\Rick\work\sat\satFit\reports\TestSatXml.html
run date Thu Feb 13 09:10:05 NZDT 2003