public void testPrimitiveEnforcedInteger() throws Exception {
System.setProperty( "jettison.mapped.typeconverter.enforce_32bit_integer", "true" );
assertTrue( DefaultConverter.ENFORCE_32BIT_INTEGER );
StringWriter strWriter = new StringWriter();
MappedNamespaceConvention con = new MappedNamespaceConvention();
AbstractXMLStreamWriter w = new MappedXMLStreamWriter(con, strWriter);
w.writeStartDocument();
w.writeStartElement("root");
w.writeStartElement("subchild1");
w.writeCharacters(Integer.MAX_VALUE + "");
w.writeEndElement();
w.writeStartElement("subchild1");
w.writeCharacters(Integer.MIN_VALUE + "");
w.writeEndElement();
w.writeStartElement("subchild1");
w.writeCharacters(Long.MAX_VALUE + "");
w.writeEndElement();
w.writeStartElement("subchild1");
w.writeCharacters(Long.MIN_VALUE + "");
w.writeEndElement();
w.writeEndElement();
w.writeEndDocument();
w.close();
strWriter.close();
String expected = "{\"root\":{\"subchild1\":[" + Integer.MAX_VALUE + "," + Integer.MIN_VALUE + ",\"" + Long.MAX_VALUE + "\",\"" + Long.MIN_VALUE + "\"]}}";
String actual = strWriter.toString();
assertEquals(expected, actual);
}