CharStream for unit testing serialization - OpenEdge Development - Products Enhancements - Progress Community

 OpenEdge Development

CharStream for unit testing serialization

When writing unit tests of code rendering to a stream it would be very useful to have a character stream that would capture the output in-memory as a string rather than writing to a file, reading the file and having to delete the file.

In other words, an analogue for a ByteArrayOutputStream (Java) where output to a stream occurs.

This would allow unit testing of such procedures taking a stream as a parameter to be redirected to a character stream and relieve developers of the need to worry about running out of disk or file handles when running large numbers of unit tests.

  • In our system in IFDS, we have lots of code which writes to streams and this solution would be great for our unit testing.