MCPcopy Create free account
hub / github.com/BaseXdb/basex / writeHex

Method writeHex

basex-api/src/test/java/org/basex/http/FnHttpTest.java:515–527  ·  view source on GitHub ↗

Tests writing of body content when @method is binary and output is xs:hexBinary. @throws IOException I/O Exception

()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 9

writeMethod · 0.95
buildMethod · 0.95
assertEqualsMethod · 0.80
toStringMethod · 0.65
addMethod · 0.65
tokenMethod · 0.65
putMethod · 0.45
finishMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected