Tests writing of body content when @method is binary and output is xs:hexBinary. @throws IOException I/O Exception
()
| 513 | * @throws IOException I/O Exception |
| 514 | */ |
| 515 | @Test public final void writeHex() throws IOException { |
| 516 | // Case 1: content is xs:hexBinary |
| 517 | Request request = new Request(); |
| 518 | request.payloadAtts.put("method", SerialMethod.BASEX.toString()); |
| 519 | request.payload.add(new Hex(token("test"))); |
| 520 | assertEquals("test", write(request)); |
| 521 | |
| 522 | // Case 2: content is a node |
| 523 | request = new Request(); |
| 524 | request.payloadAtts.put("method", SerialMethod.BASEX.toString()); |
| 525 | request.payload.add(FElem.build(new QNm("a")).text("test").finish()); |
| 526 | assertEquals("<a>test</a>", write(request)); |
| 527 | } |
| 528 | |
| 529 | /** |
| 530 | * Tests writing of request content when @src is set. |