-
Notifications
You must be signed in to change notification settings - Fork 44
Import assertj-generator-maven-plugin
#298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dajoropo
wants to merge
9
commits into
assertj:main
Choose a base branch
from
dajoropo:#113_move_assertj-generator-maven-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b02aea5
Moved project assertj-assertions-generator-maven-plugin as an individ…
dajoropo 8901a12
Included Markdown files from previous repo
dajoropo 117bc3e
Link to the maven module instead of link to the old project
dajoropo 9da22d3
Typo
dajoropo 5d6932a
Typo
dajoropo 2a95f41
Typo
dajoropo bfe3b6a
Wrong 'throws' was already in the JavaDoc of the code, but never thrown
dajoropo e339d9e
Copied theme folder into the new Maven module
dajoropo 2aac4d0
Fix javadoc errors (no self closing is allowed)
dajoropo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Contributor Covenant Code of Conduct | ||
|
|
||
| ## Our Pledge | ||
|
|
||
| In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
|
||
| ## Our Standards | ||
|
|
||
| Examples of behavior that contributes to creating a positive environment include: | ||
|
|
||
| * Using welcoming and inclusive language | ||
| * Being respectful of differing viewpoints and experiences | ||
| * Gracefully accepting constructive criticism | ||
| * Focusing on what is best for the community | ||
| * Showing empathy towards other community members | ||
|
|
||
| Examples of unacceptable behavior by participants include: | ||
|
|
||
| * The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
| * Trolling, insulting/derogatory comments, and personal or political attacks | ||
| * Public or private harassment | ||
| * Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
| * Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
|
||
| ## Our Responsibilities | ||
|
|
||
| Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
|
||
| Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
|
||
| ## Scope | ||
|
|
||
| This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
|
||
| ## Enforcement | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
|
||
| Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
|
||
| ## Attribution | ||
|
|
||
| This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
|
||
| [homepage]: http://contributor-covenant.org | ||
| [version]: http://contributor-covenant.org/version/1/4/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| Maven plugin to generate AssertJ assertions | ||
| == | ||
|
|
||
| [](https://maven-badges.herokuapp.com/maven-central/org.assertj/assertj-assertions-generator-maven-plugin) | ||
|
|
||
| ## Overview | ||
|
|
||
| This plugin can generate [AssertJ assertions](https://github.com/joel-costigliola/assertj-core) for your own classes via maven (it is based on [assertj-assertions-generator](https://github.com/joel-costigliola/assertj-assertions-generator)). | ||
|
|
||
| Let's say that you have a `Player` class with `name` and `team` attributes, the plugin is able to create a `PlayerAssert` assertions class with `hasName` and `hasTeam` assertions, to write code like : | ||
|
|
||
| ```java | ||
| assertThat(mvp).hasName("Lebron James").hasTeam("Miami Heat"); | ||
| ``` | ||
|
|
||
| The plugin can be launched with command `mvn generate-test-sources` (or simply `mvn test`) or with any IDE that supports maven. | ||
| By default, it generates the assertions source files in `target/generated-test-sources/assertions` as per maven convention (but this can be changed - see below). | ||
|
|
||
|
|
||
| **Example of plugin execution:** | ||
|
|
||
| ``` | ||
| ==================================== | ||
| AssertJ assertions generation report | ||
| ==================================== | ||
|
|
||
| --- Generator input parameters --- | ||
|
|
||
| Generating AssertJ assertions for classes in following packages and subpackages: | ||
| - org.assertj.examples.data | ||
|
|
||
| --- Generator results --- | ||
|
|
||
| Directory where custom assertions files have been generated : | ||
| - /home/joe/assertj/assertj-examples/target/generated-test-sources/assertj-assertions | ||
|
|
||
| Custom assertions files generated : | ||
| - TeamAssert.java | ||
| - BasketBallPlayerAssert.java | ||
| - EmployeeAssert.java | ||
| - NameAssert.java | ||
| - MagicalAssert.java | ||
| - PersonAssert.java | ||
| - RaceAssert.java | ||
| - GameServiceAssert.java | ||
| - MansionAssert.java | ||
| - TitleAssert.java | ||
| - AlignmentAssert.java | ||
| - TolkienCharacterAssert.java | ||
| - RingAssert.java | ||
| - MovieAssert.java | ||
| - TeamManagerAssert.java | ||
|
|
||
| Assertions entry point class has been generated in file: | ||
| - /home/joe/assertj/assertj-examples/target/generated-test-sources/assertj-assertions/org/assertj/examples/data/Assertions.java | ||
| ``` | ||
|
|
||
| ## Documentation | ||
|
|
||
| Please have a look at the complete documentation in [**assertj.org assertions generator section**](http://joel-costigliola.github.io/assertj/assertj-assertions-generator-maven-plugin.html), including a [**quickstart guide**](http://joel-costigliola.github.io/assertj/assertj-assertions-generator-maven-plugin.html#quickstart). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-generator-build</artifactId> | ||
| <version>3.0.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>assertj-generator-maven-plugin</artifactId> | ||
|
|
||
| <name>Maven plugin for AssertJ assertions generator</name> | ||
|
|
||
| <properties> | ||
| <!-- #113 Temporally disable jacoco for this module as coverage checks are not been met --> | ||
| <jacoco.skip>true</jacoco.skip> | ||
| </properties> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <configuration> | ||
| <source>1.7</source> | ||
| <target>1.7</target> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-plugin-plugin</artifactId> | ||
| <version>3.2</version> | ||
| <configuration> | ||
| <goalPrefix>assertj</goalPrefix> | ||
| <!-- see http://jira.codehaus.org/browse/MNG-5346 --> | ||
| <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <id>mojo-descriptor</id> | ||
| <goals> | ||
| <goal>descriptor</goal> | ||
| </goals> | ||
| </execution> | ||
| <execution> | ||
| <id>help-goal</id> | ||
| <goals> | ||
| <goal>helpmojo</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <!-- generate jacoco report --> | ||
| <plugin> | ||
| <groupId>org.jacoco</groupId> | ||
| <artifactId>jacoco-maven-plugin</artifactId> | ||
| <configuration> | ||
| <excludes> | ||
| <exclude>org/assertj/maven/HelpMojo.class</exclude> | ||
| <exclude>org/assertj/maven/NoLog.class</exclude> | ||
| </excludes> | ||
| </configuration> | ||
| </plugin> | ||
| <!-- to get jacoco report we need to set argLine in surefire, without this snippet the jacoco argLine is lost --> | ||
| <plugin> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <configuration> | ||
| <argLine>${argLine}</argLine> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| <pluginManagement> | ||
| <plugins> | ||
| <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build | ||
| itself. --> | ||
| <plugin> | ||
| <groupId>org.eclipse.m2e</groupId> | ||
| <artifactId>lifecycle-mapping</artifactId> | ||
| <version>1.0.0</version> | ||
| <configuration> | ||
| <lifecycleMappingMetadata> | ||
| <pluginExecutions> | ||
| <pluginExecution> | ||
| <pluginExecutionFilter> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-plugin-plugin</artifactId> | ||
| <versionRange>[3.2,)</versionRange> | ||
| <goals> | ||
| <goal>descriptor</goal> | ||
| <goal>helpmojo</goal> | ||
| </goals> | ||
| </pluginExecutionFilter> | ||
| <action> | ||
| <ignore /> | ||
| </action> | ||
| </pluginExecution> | ||
| </pluginExecutions> | ||
| </lifecycleMappingMetadata> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </pluginManagement> | ||
| </build> | ||
|
|
||
| <dependencies> | ||
|
|
||
| <!-- assertj dependencies --> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-assertions-generator</artifactId> | ||
| <version>2.2.0</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.assertj</groupId> | ||
| <artifactId>assertj-core</artifactId> | ||
| <version>[2.0.0, 2.99.0]</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>commons-collections</groupId> | ||
| <artifactId>commons-collections</artifactId> | ||
| <version>3.2.2</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>commons-io</groupId> | ||
| <artifactId>commons-io</artifactId> | ||
| <version>2.7</version> | ||
| </dependency> | ||
|
|
||
| <!-- maven plugin dependencies --> | ||
| <dependency> | ||
| <groupId>org.apache.maven</groupId> | ||
| <artifactId>maven-plugin-api</artifactId> | ||
| <version>2.2.1</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.maven</groupId> | ||
| <artifactId>maven-project</artifactId> | ||
| <version>2.2.1</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.maven.plugin-tools</groupId> | ||
| <artifactId>maven-plugin-annotations</artifactId> | ||
| <version>3.2</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <!-- test dependencies --> | ||
| <dependency> | ||
| <groupId>org.mockito</groupId> | ||
| <artifactId>mockito-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| </project> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.