On Sat, 9 Aug 2003, Mark Leicester wrote:

> Hi Stephan,
>
> I notice that there is no serializer test case, so I have written one using
> a byte[] to store the output of the serializer for subsequent comparison
> with another source.
>
> Do you have plans for serializer test cases, and if so does this code fit
> the bill? I thought I should post it to you and the list for comment before
> I submit it as a patch.
>
> I have not integrated it into the CompositeTestCase class.
>
> It is called in the usual way, e.g.:
>
>   public void testMIDISerializer() throws Exception
>   {
>     String type = "midi";
>     String input = "resource://org/apache/cocoon/generation/Prelude.xmi";
>     Parameters parameters = new Parameters();
>     String control = "resource://org/apache/cocoon/generation/Prelude.mid";
>
>     assertIdentical(loadByteArray(control),
>       serialize(type, parameters, load(input)));
>   }

Code is always welcome. I havn't written a Serializer testcase until now,
because I find it difficult to test binary data. In my POV you must
generate the expected output with a different tool than the component you
want to test. In the case of binary data, it is not that easy.

But anyway, I applied that patch.

Thank you, Stephan.

Reply via email to