net.markenwerk:utils-json-handler-replay

Replaying handler for JSON processing libraries for Java

License

License

Categories

Categories

Net JSON Data
GroupId

GroupId

net.markenwerk
ArtifactId

ArtifactId

utils-json-handler-replay
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

net.markenwerk:utils-json-handler-replay
Replaying handler for JSON processing libraries for Java
Project URL

Project URL

https://github.com/markenwerk/java-utils-json-handler-replay
Project Organization

Project Organization

Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH
Source Code Management

Source Code Management

https://github.com/markenwerk/java-utils-json-handler-replay

Download utils-json-handler-replay

How to add to project

<!-- https://jarcasting.com/artifacts/net.markenwerk/utils-json-handler-replay/ -->
<dependency>
    <groupId>net.markenwerk</groupId>
    <artifactId>utils-json-handler-replay</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/net.markenwerk/utils-json-handler-replay/
implementation 'net.markenwerk:utils-json-handler-replay:1.0.1'
// https://jarcasting.com/artifacts/net.markenwerk/utils-json-handler-replay/
implementation ("net.markenwerk:utils-json-handler-replay:1.0.1")
'net.markenwerk:utils-json-handler-replay:jar:1.0.1'
<dependency org="net.markenwerk" name="utils-json-handler-replay" rev="1.0.1">
  <artifact name="utils-json-handler-replay" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.markenwerk', module='utils-json-handler-replay', version='1.0.1')
)
libraryDependencies += "net.markenwerk" % "utils-json-handler-replay" % "1.0.1"
[net.markenwerk/utils-json-handler-replay "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
net.markenwerk : utils-json-handler jar 2.0.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Replaying handler for JSON libraries

Build Status Coverage Status Dependency Status Maven Central Issues MIT License

Overview

This library provides a replaying JSON handlers for other JSON processing libraries.

Consult the documentation and the usage description for further information:

Maven

This library is hosted in the Maven Central Repository. You can use it with the following coordinates:

<dependency>
	<groupId>net.markenwerk</groupId>
	<artifactId>utils-json-handler-replay</artifactId>
	<version>1.0.1</version>
</dependency>

Usage

Replaying handler

A RecordingJsonHandler is a JsonHandler that creates a JsonReplay of the described JSON document. A JsonReplay represents a sequence of JsonEvents and is able to replay these events to another JsonHandler.

// a JsonDocument
JsonDocument document = ...

// a JsonHandler
JsonHandler handler = ...

// returns a JsonReplay  
JsonReplay replay = document.handle(new RecordingJsonHandler());

// replay the JsonDocument to the JsonHandler
replay.replay(handler); 

A RecordingJsonHandler is useful when testing a component that takes a JsonHandler, because the generated JsonReplay can be used to easily check, if the correct callback methods have been called.

// a JsonReplay
JsonReply replay = ...

// check the replay against an expected sequence of JsonEvents
replay.assertEquals(
	new DocumentBeginJsonEvent(),
	new NullJsonEvent(),
	new DocumentEndJsonEvent(),
);
net.markenwerk

Markenwerk

Versions

Version
1.0.1
1.0.0