Leanpub Header

Skip to main content

Nasdanika SDK Runtime - Harness

Tests That Leave a Trace

Nasdanika SDK Runtime - Harness

Integration tests whose requests and the server's work are one OpenTelemetry trace, in one JVM, with no collector or backend, recorded as a model you can query.

Interested in this book? Show your support by saying what you'd like to pay for it!

$
PDF
EPUB
About

About

About the Book

An integration test of a web application sends requests and checks responses. When it passes, it leaves nothing behind but a green mark. When it fails, it leaves an assertion message on one side and the server's logs somewhere else, and someone has to put the two together.

The thread that ties them together already exists. OpenTelemetry carries a trace from client to server in a request header, so the server's work becomes a child of the client's request. Production systems use it across dozens of services; tests rarely do, because of the setup: a collector, a backend, agents on both sides, and a way to find one test's trace among everything else.

In one JVM it is free

A test that starts the server it tests, in the same JVM, needs none of that. This book describes the harness module of the Nasdanika SDK Runtime, with one method at its heart: Harness.inServer starts a server whose every handler is instrumented, runs your code in a span, gives it a client whose requests carry the trace, and stops the server when your code is done. Every request of the test and everything the server did for it are in the test's trace, and nothing else is.

  • A server for the length of a test, on the JDK's own HTTP server, serving handlers or files.
  • One trace, with the request, the server span it caused, the server's log records and any exception in one tree.
  • Recording, with the runtime's telemetry model: the trace saved as a model in YAML, JSON or XMI that you can query and compare.

The last part shows what is built on it: browser walk-throughs with screenshots in the same trace, which are available in the Zephyr Book Walk-throughs with Playwright, and documents, slide decks, sequence diagrams and narrated videos generated from recorded traces, which are planned.

Who it is for

  • Java developers who test web applications and services and want a failed test to say what the server did, not only what the client got.
  • Developers who build demos and walk-throughs and want them reproducible.
  • Architects who want end-to-end traceability from a test to the code that served it. The first part needs no code.

How it keeps you honest

Every listing is included from the module's sources or tests and runs when the book is built. Status labels mark what is PLANNED.

This is a short Nasdanika Zephyr Book, an in-depth manual for one small module of the Nasdanika SDK Runtime, and it stands on its own. The code needs Java 25; recording traces as models adds the runtime's telemetry model exporters. The text is licensed under CC BY 4.0 and the code under EPL-2.0.

Share this book

Author

About the Author

Pavel Vlasov

Over 30 years of experience in Information Technology with 25 of them in the Financial Services industry, which includes 20 years in banking.

Model-Based Systems Engineering, Java, Architecture As Code

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub