https://github.com/exasol/autogenerated-resource-verifier-java
Java library that allows you to define autogenerated resources in Java.
https://github.com/exasol/autogenerated-resource-verifier-java
autogenerated-resources exasol-integration java validator verifier
Last synced: over 1 year ago
JSON representation
Java library that allows you to define autogenerated resources in Java.
- Host: GitHub
- URL: https://github.com/exasol/autogenerated-resource-verifier-java
- Owner: exasol
- License: mit
- Created: 2021-02-11T10:37:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-31T09:26:46.000Z (almost 4 years ago)
- Last Synced: 2025-01-13T21:09:30.603Z (over 1 year ago)
- Topics: autogenerated-resources, exasol-integration, java, validator, verifier
- Language: Java
- Homepage:
- Size: 38.1 KB
- Stars: 1
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Autogenerated Resource Verifier for Java
[](https://github.com/exasol/autogenerated-resource-verifier-java/actions/workflows/ci-build.yml)
[](https://search.maven.org/artifact/com.exasol/autogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
[](https://sonarcloud.io/dashboard?id=com.exasol%3Aautogenerated-resource-verifier-java)
This Java library allows you to automatically create resources in Java.
## Usage
Define the content of your document in your test source code:
```java
public class MyReportGenerator {
public static void main(final String[] args) {
new AutogeneratedResourceVerifier().verifyResource(Path.of(args[0]), new MyReport());
}
private static class MyReport implements AutogeneratedResource {
@Override
public String generateContent() {
StringBuilder report;
//build your report here
return report.toString();
}
@Override
public Path getPathOfGeneratedFile() {
return Path.of("doc", "generated", "myReport.md");
}
}
}
```
### Run From Maven:
You can add the execution of your generator to the maven build using the `maven-execution-plugin`. To do so add the following lines to your `pom.xml`:
```xml
org.codehaus.mojo
exec-maven-plugin
3.0.0
validate-capabilities-report
java
package
com.example.MyReportGenerator
test
projectDir
${project.basedir}
```
Now you can run the validation using `mvn package`.
The verifier can also fix the generated resource. To do so, run:
```shell
mvn package -DfixAutogeneratedResources=true
```
## Additional Information
* [Changelog](doc/changes/changelog.md)
* [Dependencies](dependencies.md)