@Test public void testToXML3() throws Throwable { FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath"); Element result = fSDMsg.toXML(); assertEquals("result.getName()", "message", result.getName()); assertEquals("fSDMsg.fields.size()", 0, fSDMsg.fields.size()); }
@Test public void testToXML() throws Throwable { FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath", "testFSDMsgBaseSchema"); byte[] h = new byte[2]; fSDMsg.setHeader(h); Element result = fSDMsg.toXML(); assertEquals("result.getName()", "message", result.getName()); assertEquals("fSDMsg.fields.size()", 0, fSDMsg.fields.size()); }
@Test public void testToXMLThrowsStringIndexOutOfBoundsException() throws Throwable { FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath"); byte[] h = new byte[0]; fSDMsg.setHeader(h); try { fSDMsg.toXML(); fail("Expected StringIndexOutOfBoundsException to be thrown"); } catch (StringIndexOutOfBoundsException ex) { assertEquals("ex.getMessage()", "String index out of range: -2", ex.getMessage()); assertEquals("fSDMsg.fields.size()", 0, fSDMsg.fields.size()); } }