コード例 #1
0
ファイル: FSDMsgTest.java プロジェクト: nachmadi/jPOS
 @Test
 public void testCopy() throws Throwable {
   FSDMsg msg = new FSDMsg("testFSDMsgBasePath");
   msg.copy("testFSDMsgFieldName", msg);
   assertEquals("msg.fields.size()", 1, msg.fields.size());
   assertNull("msg.fields.get(\"testFSDMsgFieldName\")", msg.fields.get("testFSDMsgFieldName"));
 }
コード例 #2
0
ファイル: FSDMsgTest.java プロジェクト: nachmadi/jPOS
 @Test
 public void testDump1() throws Throwable {
   FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath");
   fSDMsg.copy("testFSDMsgFieldName", new FSDMsg("testFSDMsgBasePath1"));
   fSDMsg.dump(new PrintStream(new ByteArrayOutputStream(), true, "UTF-16"), "testFSDMsgIndent");
   assertEquals("fSDMsg.fields.size()", 1, fSDMsg.fields.size());
 }
コード例 #3
0
ファイル: FSDMsgTest.java プロジェクト: nachmadi/jPOS
 @Test
 public void testCopyThrowsNullPointerException() throws Throwable {
   FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath", "testFSDMsgBaseSchema");
   try {
     fSDMsg.copy("testFSDMsgFieldName", null);
     fail("Expected NullPointerException to be thrown");
   } catch (NullPointerException ex) {
     assertNull("ex.getMessage()", ex.getMessage());
     assertEquals("fSDMsg.fields.size()", 0, fSDMsg.fields.size());
   }
 }
コード例 #4
0
ファイル: FSDMsgTest.java プロジェクト: nachmadi/jPOS
  @Test
  public void testGetThrowsISOException() throws Throwable {
    FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath");

    when(msg.get("testString")).thenReturn("<fsdmsg schem='");

    fSDMsg.copy("testString", msg);

    try {
      fSDMsg.get("testFSDMsgId", "NB", 4, "testFSDMsgDefValue", null);
      fail("Expected ISOException to be thrown");
    } catch (ISOException ex) {
      assertEquals("fSDMsg.fields.size()", 1, fSDMsg.fields.size());
    }
  }
コード例 #5
0
ファイル: FSDMsgTest.java プロジェクト: nachmadi/jPOS
  @Test
  public void testGet5() throws Throwable {
    FSDMsg fSDMsg = new FSDMsg("testFSDMsgBasePath", "testFSDMsgBaseSchema");

    when(msg.get("testString")).thenReturn("testString");

    fSDMsg.copy("testString", msg);

    String result = fSDMsg.get("testFSDMsgId", "N", 100, "testFSDMsgDefValue", null);
    assertEquals(
        "result",
        "0000000000000000000000000000000000000000000000000000000000000000000000000000000000testFSDMsgDefValue",
        result);
    assertEquals("fSDMsg.fields.size()", 1, fSDMsg.fields.size());
  }