Added a ProtocolSimulator. Here is a description * Simulates protocol sessions. Connects to a protocol server. Test * reads template and sends data or reads data from server and * validates against given template file. * * Template rules are: * - All lines starting with '#' are regarded as comments. * - All template lines start with 'C: ' or 'S: ' * - Each template line is treated as a seprate unit. * - 'C: ' indicates client side communication that is communication * from this test to remote server. * - 'S: ' indicates server response. * - Client side communication is obtained from template file and is * sent as is to the server. * - Expected Server side responses are read from template. Expected * Server side response is matched against actual server response * using perl regular expressions. * * Example POP3 prototol script to test for authentication: * # note \ before '+'. '+' needs to be escaped * S: \+OK.* * C: USER test * S: \+OK.* * C: PASS invalidpwd * S: -ERR.* * C: USER test * S: \+OK.* * C: PASS test * S: \+OK.*
Usage is java org.apache.tools.testing.ProtocolSimulator <host> <port> <template> Please take a look at it. I think it can be used to test protocol interactions effectively. Thought a bit about general template engines, but this seemed to provide max gain, with reasonable effort. Comments.... Harmeet -- To unsubscribe, e-mail: <mailto:james-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:james-dev-help@;jakarta.apache.org>
