It's just a quick sanity test for a very simple class which came from
StackOverflow.  All it does is expose some of the protected methods from
XOM's Serializer as public.

And the test method happened to be using the automatically generated
name.  I've renamed it to sanityTest.

To test StreamSerializer properly, you have to generate an entire XML
document.  I don't want to create half a dozen XML documents which each
test one tiny little thing.  If I did that the test would end up far
longer than the simple class it is testing.


On 2013-08-01 13:12, David Mason wrote:
> In zanata-war/src/test/java/org/zanata/xml/StreamSerializerTest.java:
> 
>> +import java.io.ByteArrayOutputStream;
>> +import java.io.IOException;
>> +import java.io.OutputStream;
>> +import java.io.PrintStream;
>> +
>> +import nu.xom.Element;
>> +
>> +import org.hamcrest.text.StringContainsInOrder;
>> +import org.testng.annotations.Test;
>> +import org.zanata.xml.StreamSerializer;
>> +
>> +public class StreamSerializerTest
>> +{
>> +
>> +   @Test
>> +   public void streamSerializer() throws IOException
> 
> Context already tells us the class under test. This is testing that it
> can do some simple things like adding a root element and sub elements
> (which can really be tested independently) so the name should reflect
> what is being checked. Much more useful to see that |canWriteSubElement|
> failed but |canWriteRootElement| passed, than just to see that
> |streamSerializer| failed.
> 
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/zanata/zanata-server/pull/78/files#r5521588>.
> 


-- 
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat