Powerunit - Java Testing framework for JDK 1.8 - Extension to provide matchers based on annotations. - Factory Support

This is a test framework for the JDK 1.8 - Extension to provide matchers based on annotation. - Factory Support

Лицензия

Лицензия

Группа

Группа

ch.powerunit.extensions
Идентификатор

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

powerunit-extensions-matchers-factory
Последняя версия

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

0.1.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

Powerunit - Java Testing framework for JDK 1.8 - Extension to provide matchers based on annotations. - Factory Support
This is a test framework for the JDK 1.8 - Extension to provide matchers based on annotation. - Factory Support
Ссылка на сайт

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

http://www.powerunit.ch/powerunit-extensions-matchers
Система контроля версий

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

https://github.com/powerunit/powerunit-extensions-matchers/

Скачать powerunit-extensions-matchers-factory

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

<!-- https://jarcasting.com/artifacts/ch.powerunit.extensions/powerunit-extensions-matchers-factory/ -->
<dependency>
    <groupId>ch.powerunit.extensions</groupId>
    <artifactId>powerunit-extensions-matchers-factory</artifactId>
    <version>0.1.6</version>
</dependency>
// https://jarcasting.com/artifacts/ch.powerunit.extensions/powerunit-extensions-matchers-factory/
implementation 'ch.powerunit.extensions:powerunit-extensions-matchers-factory:0.1.6'
// https://jarcasting.com/artifacts/ch.powerunit.extensions/powerunit-extensions-matchers-factory/
implementation ("ch.powerunit.extensions:powerunit-extensions-matchers-factory:0.1.6")
'ch.powerunit.extensions:powerunit-extensions-matchers-factory:jar:0.1.6'
<dependency org="ch.powerunit.extensions" name="powerunit-extensions-matchers-factory" rev="0.1.6">
  <artifact name="powerunit-extensions-matchers-factory" type="jar" />
</dependency>
@Grapes(
@Grab(group='ch.powerunit.extensions', module='powerunit-extensions-matchers-factory', version='0.1.6')
)
libraryDependencies += "ch.powerunit.extensions" % "powerunit-extensions-matchers-factory" % "0.1.6"
[ch.powerunit.extensions/powerunit-extensions-matchers-factory "0.1.6"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.hamcrest : hamcrest-all jar 1.3
javax.xml.bind : jaxb-api jar 2.3.0
com.sun.xml.bind : jaxb-impl jar 2.3.0
com.sun.xml.bind : jaxb-core jar 2.3.0

provided (1)

Идентификатор библиотеки Тип Версия
javax.annotation : javax.annotation-api Необязательный jar 1.3.1

test (5)

Идентификатор библиотеки Тип Версия
ch.powerunit : powerunit jar 0.5.0
com.google.code.bean-matchers : bean-matchers Необязательный jar 0.11
org.exparity : hamcrest-date Необязательный jar 2.0.4
com.nitorcreations : matchers Необязательный jar 1.3
com.spotify : hamcrest-jackson Необязательный jar 1.1.1

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

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

powerunit-extensions-matchers

  • Travis ci : Build Status
  • Vulnerabilities : Known Vulnerabilities DepShield Badge
  • Coverage : Coverage Status - codecov
  • Quality : Codacy Badge - CodeFactor - BCH compliance - codebeat badge
  • Maven : Maven Central
  • Git : mergify-status

This is an extension to powerunit (a unit test framework for java 8) that doesn't require this framework, but provides generation of hamcrest matchers. Please check the site for more information

Usage

Basic usage is to add this libraray as a dependency and use the annotation :

@ProvideMatchers
public class PojoShort {
  ...
}

Matchers classes must be created by the annotation processor (in this example, named PojoShortMatchers).

Compatibility

Powerunit-extensions-matchers version With Version Status
0.1.6 hamcrest 1.3 ✔️
0.1.6 hamcrest 2.1+ Not tested by itself, but as some extension use this version, should be OK
0.1.6 JDK 1.8 ✔️
0.1.6 JDK 9 Compilation with source and target = 1.8 tested. The @Generated annotation may not be available OOTB and the META-INF information are not generated
0.1.6 JDK 10 Compilation with source and target = 1.8 tested. The @Generated annotation may not be available OOTB and the META-INF information are not generated
0.2.0 hamcrest 1.3 ✔️ The @Factory annotation is not produced or parsed anymore.
0.2.0 hamcrest 2.1+ ✔️
0.2.0 JDK 1.8 ✔️
0.2.0 JDK 9 Compilation with source and target = 1.8 tested. Execution of generated matcher tested. The @Generated annotation may not be available OOTB.
0.2.0 JDK 10 Compilation with source and target = 1.8 tested. Execution of generated matcher tested. The @Generated annotation may not be available OOTB.
0.3.0 hamcrest 1.3 ✔️
0.3.0 hamcrest 2.1+ ✔️
0.3.0 JDK 1.8 ✔️
0.3.0 JDK 9 Compilation with source and target = 1.9 tested. Execution of generated matcher tested. The @Generated annotation may not be available OOTB.
0.3.0 JDK 10 Compilation with source and target = 1.9 tested. Execution of generated matcher tested. The @Generated annotation may not be available OOTB.
0.3.0 powerunit-extensions-matchers 0.2.0 ✔️ Matchers generated with version 0.2.0 can be used from matcher of the version 0.3.0. The ignored fields and cycle detection is not propagated to the 0.2.0 matchers.

Migration

Migration to version 0.2.X

The version 0.2.0 introduces some major changes in the annotation processor. The idea is mainly that this annotation processor must support several version of the hamcrest library.

When migrating to this version, some actions may be needed :

  • The library doesn't provide anymore a transitive dependency to the hamcrest library. You may need to add this library as a dependency of your project. Dependency may be : org.hamcrest:hamcrest:2.2 ; org.hamcrest:hamcrest:2.1 ; org.hamcrest:hamcrest-all:1.3.
  • The artifacts powerunit-extensions-matchers-factory and powerunit-extensions-matchers-providematchers are not available any more. Only the master artifact powerunit-extensions-matchers is available and only this one can be used.
  • The generated classes doesn't use anymore the @Factory annotation. This annotation only exists in hamcrest 1.3. If you use the annotation processor based on the configuration property ch.powerunit.extensions.matchers.factoryprocessor.FactoryAnnotationsProcessor.targets you will have to change your configuration (see below). This feature was based on this annotation and only compatible with hamcrest 1.3
  • By default, the annotation processor only generate the Matchers. If a master DSL interface is required (like the ones produced by the old configuration ch.powerunit.extensions.matchers.factoryprocessor.FactoryAnnotationsProcessor.targets you may use the configuration property ch.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotationsProcessor.factory. This property takes as value the fully qualified name of an interface to be generated, which will expose all the entry DSL methods generated by this annotation processor. This interface only contains these entry DSL methods ; no additional methods may be added (as it was possible before with @Factory annotation).
  • The detection of link between classes and related Matcher has been enhanced. It is possible that for some case when before a field or a parent was not linked, now there are correctly linked. It may change the way the matcher operate (using another matcher to compare and not a is Matcher).
  • The META-INF xml file is not generated anymore. This should not be an issue, except if you use it. Metadatas information are added directly to the generated matchers.
ch.powerunit.extensions

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

Версия
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4