ocubator

Tool for testing Java annotation processors

License

License

GroupId

GroupId

com.dpforge
ArtifactId

ArtifactId

ocubator
Last Version

Last Version

1.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

ocubator
Tool for testing Java annotation processors
Project URL

Project URL

https://github.com/int02h/ocubator
Source Code Management

Source Code Management

https://github.com/int02h/ocubator

Download ocubator

How to add to project

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

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

ocubator

Latest release Build Status Coverage Status

Ocubator is very polite tool for testing Java annotation processors. Just say please and it will do everything you want.

This library is inspired by Google's compile-testing but allows you not only check the source code of generated classes but also create instances of them. It looks more logical to test class behaviour like in the familiar unit testing instead of verifying that annotation processor has generated expected source code. That's the idea.

Here's the example of the single source code compilation with one annotation processor:

CompilationResult result = OcubatorCompiler.compile()
        .sourceCode(
                "import com.dpforge.ocubator.TestAnnotation;",
                "@TestAnnotation",
                "class Foo {}")
        .withProcessor(new TestProcessor())
        .please();
assertTrue(result.isSuccess());

Note that you don't need to provide qualified class name or any file name at all. Ocubator will automatically extracts it from provided the source code.

Download

Get the latest version of the Ocubator library with Maven

<dependency>
  <groupId>com.dpforge</groupId>
  <artifactId>ocubator</artifactId>
  <version>1.3.1</version>
</dependency>

or Gradle

compile 'com.dpforge:ocubator:1.3.1'

License

Copyright (c) 2019 Daniil Popov

Licensed under the MIT License.

Versions

Version
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0