Example #1
0
 @Test
 public void testGetHexHeader() throws Throwable {
   FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath");
   byte[] h = new byte[1];
   fSDMsg.setHeader(h);
   String result = fSDMsg.getHexHeader();
   assertEquals("result", "", result);
 }
Example #2
0
 @Test
 public void testGetHexHeaderThrowsStringIndexOutOfBoundsException() throws Throwable {
   FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath", "testFSDMsgBaseSchema");
   byte[] h = new byte[0];
   fSDMsg.setHeader(h);
   try {
     fSDMsg.getHexHeader();
     fail("Expected StringIndexOutOfBoundsException to be thrown");
   } catch (StringIndexOutOfBoundsException ex) {
     assertEquals("ex.getMessage()", "String index out of range: -2", ex.getMessage());
   }
 }