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

Method writeText

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

Tests writing text nodes (children of http:send-request bodies). @throws IOException I/O Exception

()

Source from the content-addressed store, hash-verified

496 * @throws IOException I/O Exception
497 */
498 @Test public final void writeText() throws IOException {
499 Request request = new Request();
500 request.payloadAtts.put(SerializerOptions.MEDIA_TYPE.name(), "application/octet-stream");
501 request.payload.add(new FTxt("&"));
502 assertEquals("&", write(request));
503
504 request = new Request();
505 request.payloadAtts.put(SerializerOptions.MEDIA_TYPE.name(),
506 "application/x-www-form-urlencoded");
507 request.payload.add(new FTxt("&"));
508 assertEquals("&", write(request));
509 }
510
511 /**
512 * Tests writing of body content when @method is binary and output is xs:hexBinary.

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
assertEqualsMethod · 0.80
nameMethod · 0.65
addMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected