<commit_before># Welcome to the AssertJ assertions generator project !

## Overview 

The Assertion Generator is able to create assertions specific to your own classes, it comes with :
* a CLI tool (this project)
* a [**maven plugin**](https://github.com/joel-costigliola/assertj-assertions-generator-maven-plugin) 
* an [**eclipse plugin**](https://github.com/joel-costigliola/assertj-eclipse-plugin) (planned later).

Let's say that you have a `Player` class with `name` and `team` properties, the generator is able to create a `PlayerAssert` assertions class with `hasName` and `hasTeam` assertions, to write code like :

```java
assertThat(mvp).hasName("<NAME>").hasTeam("Miami Heat");
```
Since 1.2.0 version, the generator also creates an `Assertions` class with `assertThat` methods giving access to each generated `*Assert` classes.  
In the case where `PlayerAssert` and `GameAssert` have been generated, the generator will also create the `Assertions` class below:

```java
public class Assertions {

  /**
   * Creates a new instance of <code>{@link GameAssert}</code>.
   *
   * @param actual the actual value.
   * @return the created assertion object.
   */
  public static GameAssert assertThat(Game actual) {
    return new GameAssert(actual);
  }

  /**
   * Creates a new instance of <code>{@link PlayerAssert}</code>.
   *
   * @param actual the actual value.
   * @return the created assertion object.
   */
  public static PlayerAssert assertThat(Player actual) {
    return new PlayerAssert(actual);
  }

  /**
   * Creates a new </code>{@link Assertions}</code>.
   */
  protected Assertions() {
    // empty
  }
}
```

## Latest news

**2013-08-12 : 1.2.0 release**
* To ease using generated assertions, generate an entry point class `Assertions` providing `assertThat` methods giving access to each generated `*Assert` classes.
* Don't generate `hasDeclaringClass` assertion for `Enum`. 
* In generated method assertions, rename `errorMessage` local variable to `assertjErrorMessage` to avoid collision when object under test has an `errorMessage` property (<NAME>)

**2013-09-15 : 1.1.0 release**
* Generated assertions use null safe equals for non primtive types
* Add exceptions to assertion method signature if underlying getter of class to assert throws some (<NAME>)
* Generate assertions for nested/inner classes (<NAME>)
* Fix error message displaying unrelevant property value when getter of class to assert doesn't return the same value on successive calls (<NAME>)

Big thanks to **<NAME>** that has done most of the work of this release !

**2013-03-26 : 1.0.0 release : the first release after Fest fork, generated assertions are cleaner.**

## Generate assertions from Maven

You should use the provided [**maven plugin**](https://github.com/joel-costigliola/assertj-assertions-generator-maven-plugin).

## Use with Eclipse

Work (not so much) in progress ...

We are developing an Eclipse plugin that allows you to generate assertions for a specific class (one at time only).
Please check **[AssertJ eclipse plugin documentation](http://joel-costigliola.github.com/assertj-eclipse-plugin/)**.

## Quickstart for NON Maven users

### 1 - Get AssertJ assertions generator 

Get the AssertJ Assertions Generator 1.0.0 archive for **unix** or **windows** and extract it.

The archive structure is :

```
assertion-generator/
  |-- lib/
  |-- templates/
  |-- generate-assertions script (.bat or .sh)
```

### 2 - Generates assertions

- Put in `lib/` directory the jars containing the classes you want to generate assertions for .  

- Launch the scripts with either the **classes** or the **packages** containing the classes you want to generate assertions for.

Generate assertions for `TolkienCharacter` class :
```
generate-assertions.sh org.assertj.examples.data.TolkienCharacter 
```

Generate assertions for all classes in `org.assertj.examples.data` :
```
generate-assertions.sh org.assertj.examples.data 
```

- your assertions classes have been generated, go find them in the current directory

**Tip :**   
You can change what is generated by modifying the templates used for assertions creation (have a look at templates directory)
<commit_msg>fix release date<commit_after># Welcome to the AssertJ assertions generator project !

## Overview 

The Assertion Generator is able to create assertions specific to your own classes, it comes with :
* a CLI tool (this project)
* a [**maven plugin**](https://github.com/joel-costigliola/assertj-assertions-generator-maven-plugin) 
* an [**eclipse plugin**](https://github.com/joel-costigliola/assertj-eclipse-plugin) (planned later).

Let's say that you have a `Player` class with `name` and `team` properties, the generator is able to create a `PlayerAssert` assertions class with `hasName` and `hasTeam` assertions, to write code like :

```java
assertThat(mvp).hasName("<NAME>").hasTeam("Miami Heat");
```
Since 1.2.0 version, the generator also creates an `Assertions` class with `assertThat` methods giving access to each generated `*Assert` classes.  
In the case where `PlayerAssert` and `GameAssert` have been generated, the generator will also create the `Assertions` class below:

```java
public class Assertions {

  /**
   * Creates a new instance of <code>{@link GameAssert}</code>.
   *
   * @param actual the actual value.
   * @return the created assertion object.
   */
  public static GameAssert assertThat(Game actual) {
    return new GameAssert(actual);
  }

  /**
   * Creates a new instance of <code>{@link PlayerAssert}</code>.
   *
   * @param actual the actual value.
   * @return the created assertion object.
   */
  public static PlayerAssert assertThat(Player actual) {
    return new PlayerAssert(actual);
  }

  /**
   * Creates a new </code>{@link Assertions}</code>.
   */
  protected Assertions() {
    // empty
  }
}
```

## Latest news

**2013-12-08 : 1.2.0 release**
* To ease using generated assertions, generate an entry point class `Assertions` providing `assertThat` methods giving access to each generated `*Assert` classes.
* Don't generate `hasDeclaringClass` assertion for `Enum`. 
* In generated method assertions, rename `errorMessage` local variable to `assertjErrorMessage` to avoid collision when object under test has an `errorMessage` property (<NAME>)

**2013-09-15 : 1.1.0 release**
* Generated assertions use null safe equals for non primtive types
* Add exceptions to assertion method signature if underlying getter of class to assert throws some (<NAME>)
* Generate assertions for nested/inner classes (<NAME>)
* Fix error message displaying unrelevant property value when getter of class to assert doesn't return the same value on successive calls (<NAME>)

Big thanks to **<NAME>** that has done most of the work of this release !

**2013-03-26 : 1.0.0 release : the first release after Fest fork, generated assertions are cleaner.**

## Generate assertions from Maven

You should use the provided [**maven plugin**](https://github.com/joel-costigliola/assertj-assertions-generator-maven-plugin).

## Use with Eclipse

Work (not so much) in progress ...

We are developing an Eclipse plugin that allows you to generate assertions for a specific class (one at time only).
Please check **[AssertJ eclipse plugin documentation](http://joel-costigliola.github.com/assertj-eclipse-plugin/)**.

## Quickstart for NON Maven users

### 1 - Get AssertJ assertions generator 

Get the AssertJ Assertions Generator 1.0.0 archive for **unix** or **windows** and extract it.

The archive structure is :

```
assertion-generator/
  |-- lib/
  |-- templates/
  |-- generate-assertions script (.bat or .sh)
```

### 2 - Generates assertions

- Put in `lib/` directory the jars containing the classes you want to generate assertions for .  

- Launch the scripts with either the **classes** or the **packages** containing the classes you want to generate assertions for.

Generate assertions for `TolkienCharacter` class :
```
generate-assertions.sh org.assertj.examples.data.TolkienCharacter 
```

Generate assertions for all classes in `org.assertj.examples.data` :
```
generate-assertions.sh org.assertj.examples.data 
```

- your assertions classes have been generated, go find them in the current directory

**Tip :**   
You can change what is generated by modifying the templates used for assertions creation (have a look at templates directory)

{'fraction_non_alphanumeric': 0.1039704304280434, 'fraction_numerical': 0.009777035888875641, 'mean_word_length': 4.30550284629981, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3762394', 'n_tokens_mistral': 2403, 'n_tokens_neox': 2224, 'n_words': 964}