public void testEncodeNumberMatchedReturned() throws Exception {
// prepare empty result
net.opengis.wfs20.FeatureCollectionType fc = Wfs20Factory.eINSTANCE.createFeatureCollectionType();
fc.setNumberReturned(new BigInteger("0"));
Encoder e = encoder();
Document d = e.encodeAsDOM( fc, WFS.FeatureCollection );
NamedNodeMap attributes = d.getDocumentElement().getAttributes();
assertEquals("unknown", attributes.getNamedItem("numberMatched" ).getTextContent());
assertEquals("0", attributes.getNamedItem("numberReturned" ).getTextContent());
// try with -1
e = encoder();
fc.setNumberMatched(-1);
d = e.encodeAsDOM( fc, WFS.FeatureCollection );
attributes = d.getDocumentElement().getAttributes();
assertEquals("unknown", attributes.getNamedItem("numberMatched" ).getTextContent());
assertEquals("0", attributes.getNamedItem("numberReturned" ).getTextContent());
// now with a valid value
e = encoder();
fc.setNumberMatched(10);
d = e.encodeAsDOM( fc, WFS.FeatureCollection );
attributes = d.getDocumentElement().getAttributes();
assertEquals("10", attributes.getNamedItem("numberMatched" ).getTextContent());
assertEquals("0", attributes.getNamedItem("numberReturned" ).getTextContent());
}