object-differ

Compares Java object trees for serialization round-trip tests

Лицензия

Лицензия

MIT
Группа

Группа

com.conveyal
Идентификатор

Идентификатор

object-differ
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

object-differ
Compares Java object trees for serialization round-trip tests
Ссылка на сайт

Ссылка на сайт

https://github.com/conveyal/object-differ
Система контроля версий

Система контроля версий

https://github.com/conveyal/object-differ

Скачать object-differ

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.conveyal/object-differ/ -->
<dependency>
    <groupId>com.conveyal</groupId>
    <artifactId>object-differ</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.conveyal/object-differ/
implementation 'com.conveyal:object-differ:1.1.0'
// https://jarcasting.com/artifacts/com.conveyal/object-differ/
implementation ("com.conveyal:object-differ:1.1.0")
'com.conveyal:object-differ:jar:1.1.0'
<dependency org="com.conveyal" name="object-differ" rev="1.1.0">
  <artifact name="object-differ" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.conveyal', module='object-differ', version='1.1.0')
)
libraryDependencies += "com.conveyal" % "object-differ" % "1.1.0"
[com.conveyal/object-differ "1.1.0"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
net.sf.trove4j : trove4j jar 3.0.3
com.google.guava : guava jar 24.0-jre
org.slf4j : slf4j-api jar 1.7.25
ch.qos.logback : logback-classic jar 1.2.3

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

kryo-tools

These are shared classes enabling Kryo serialization in a couple of projects: OTP and R5.

In package com.conveyal.kryo we define some custom serializers which are reused in both projects. This introduces transitive dependencies on Trove, Guava, and Kryo itself.

The package com.conveyal.object_differ contains library classes that check whether two Java object graphs are identical, for use in serialization round-trip tests. This diffing functionality is actually independent of Kryo and should remain so, but we only use it in serialization tests so it's bundled here with Kryo serializers in a single module.

This performs a semantic equality check between two object graphs in Java. This is intended for use in testing that a round trip through serialization and deserialization reproduces an identical transportation network representation, and that the processs of building that transportation network is reproducible. A system that can do a generalized semantic comparison of any tree of objects is quite complex. Here we try to implement only the minimum feature set needed for our use case in serialization tests.

This code used to be embedded in the R5 project but is now a separate Maven / Git project so that it can be reused in multiple projects, including R5 and OpenTripPlanner.

The object differ started out as a copy of the one supplied by @csolem via the Entur OTP branch at https://github.com/entur/OpenTripPlanner/tree/protostuff_poc but has been mostly rewritten at this point.

To use it in a Maven project include the following dependency:

        <dependency>
            <groupId>com.conveyal</groupId>
            <artifactId>kryo-tools</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>

This project was renamed from object-differ when serializers were added, so artifacts with versions 1.0 and 1.1 exist with that name.

TODO: configuration and usage information, testing on complex objects within OTP.

Using object-differ with Java 11+ Modules

The object differ works by reflection, which is by default not allowed under the Java module system. Applications depending on the kryo-tools object differ will not work without some adjustments. Rather than simply opening large amounts of classes to reflection all the time, a more targeted solution is to add exceptions only when running your tests (since object-differ is only really intended for testing and not needed during normal program execution). See this article:

https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html#white-box-modular-testing-with-extra-java-command-line-options

com.conveyal

Conveyal

Urban transport analysis

Версии библиотеки

Версия
1.1.0
1.0.0