r.mugridge@auckland.ac.nz
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:
A ServerEcho just sends back what it receives.
sat.fit.SatXmlFixture | |
startServer | sat.mockServer.ServerEcho |
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/> |
stopServer |
sat.fit.SatXmlFixture | |
startServer | sat.mockServer.ServerEcho |
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/> |
stopServer |
HTML tags may be used for layout in a cell. They are stripped off before the XML is used.
sat.fit.SatXmlFixture | |
startServer | sat.mockServer.ServerEcho |
send | <Gidday> </Gidday> |
rx | <Gidday/> |
send | <Gidday>
</Gidday> |
rx | <Gidday><one/><two/><three/></Gidday> |
send | <Shutdown/> |
stopServer |
fit.Summary |