Skip to content

Commit

Permalink
Add links to Robolectric releases (robolectric#294)
Browse files Browse the repository at this point in the history
This PR adds a link to the right release whenever there is a reference to a specific version.
  • Loading branch information
MGaetan89 authored Aug 30, 2024
1 parent b5f9717 commit b2bac40
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/androidx_test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AndroidX Test

Robolectric is intended to be fully compatible with Android's official testing libraries since version 4.0.
Robolectric is intended to be fully compatible with Android's official testing libraries since [version 4.0](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.0).
As such, we encourage you to try these new APIs and provide feedback. At some point, the Robolectric equivalents will
be deprecated and removed. Using the AndroidX Test APIs reduces the cognitive load for you as a developer, with just one
set of APIs to learn for the same Android concept, no matter if you are writing an Robolectric test or an instrumentation
Expand Down
8 changes: 4 additions & 4 deletions docs/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ shadows=com.mycompany.ShadowFoo,com.mycompany.ShadowBar
```

> [!NOTE]
> Prior to Robolectric 3.1.3, only a top-level `robolectric.properties` file may be specified.
> Prior to [Robolectric 3.1.3](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.1.3), only a top-level `robolectric.properties` file may be specified.
### Global Configuration

Expand Down Expand Up @@ -111,7 +111,7 @@ Note that `sdk` and `minSdk`/`maxSdk` may not be specified in the same `@Config`
however, `minSdk` and `maxSdk` may be specified together. If any of them is present, they override any SDK specification from a less-specific configuration location.

> [!NOTE]
> Prior to Robolectric 3.2, `minSdk` and `maxSdk` are ignored, and [`NEWEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#NEWEST_SDK), [`OLDEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#OLDEST_SDK), and [`TARGET_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#TARGET_SDK) are not supported.
> Prior to [Robolectric 3.2](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.2), `minSdk` and `maxSdk` are ignored, and [`NEWEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#NEWEST_SDK), [`OLDEST_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#OLDEST_SDK), and [`TARGET_SDK`](javadoc/latest/org/robolectric/annotation/Config.html#TARGET_SDK) are not supported.
> Also, only integers corresponding to API levels may be specified in a properties file.
### Configure `Application` class
Expand Down Expand Up @@ -189,7 +189,7 @@ Some additional options can be configured globally by setting these system prope
| `robolectric.dependency.repo.password` | Password of the repository that you defined in `robolectric.dependency.repo.url`. | `null` |
| `robolectric.logging.enabled` | Set to `true` to enable debug logging. | `false` |

Since Robolectric **4.9.1**, you can now add these parameters :
Since [Robolectric 4.9.1](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9.1), you can now add these parameters :

| Property name | Description | Default value |
|-----|-----|-----|
Expand Down Expand Up @@ -243,7 +243,7 @@ For example, to override the Maven repository URL and ID to download the runtime

## `ConscryptMode`

Starting with Robolectric 4.9, Robolectric can either use Conscrypt and BouncyCastle or just BouncyCastle as the security provider.
Starting with [Robolectric 4.9](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9), Robolectric can either use Conscrypt and BouncyCastle or just BouncyCastle as the security provider.
In order to migrate tests over time, there is a [`ConscryptMode`](javadoc/latest/org/robolectric/annotation/ConscryptMode.html) annotation that controls whether Conscrypt is loaded as the default security provider with BouncyCastle as backup.

- If `ConscryptMode` is `ON`, it will install Conscrypt and BouncyCastle.
Expand Down
2 changes: 1 addition & 1 deletion docs/device-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The Android device configuration can be specified using the [`qualifiers`](javad
}
```

From version 3.6 on, Robolectric parses the `qualifiers` property according to the rules set forth [here](https://developer.android.com/guide/topics/resources/providing-resources.html#QualifierRules) (but with no preceding directory name), and sets up the Android simulation environment with a corresponding configuration. The system's `Configuration`, [`Display`](https://developer.android.com/reference/android/view/Display) and [`DisplayMetrics`](https://developer.android.com/reference/android/hardware/display/DisplayManager) objects will all reflect the specified configuration, the locale will be set, and appropriate resources will be selected.
From [version 3.6](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.6) on, Robolectric parses the `qualifiers` property according to the rules set forth [here](https://developer.android.com/guide/topics/resources/providing-resources.html#QualifierRules) (but with no preceding directory name), and sets up the Android simulation environment with a corresponding configuration. The system's `Configuration`, [`Display`](https://developer.android.com/reference/android/view/Display) and [`DisplayMetrics`](https://developer.android.com/reference/android/hardware/display/DisplayManager) objects will all reflect the specified configuration, the locale will be set, and appropriate resources will be selected.

For unspecified properties, Robolectric picks consistent values based on the properties that have been specified, or uses default values as follows:

Expand Down
4 changes: 2 additions & 2 deletions docs/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ dependencies {
## Best practices

### Limit API surface area of shadows.
Since Robolectric 3.7 `@Implementation` methods including `__constructor__` methods can be made `protected`. This is desirable as test code has no business calling these methods, by making your `@Implementation` methods protected you encourage test writers to call the public Android APIs instead.
Since [Robolectric 3.7](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.7) `@Implementation` methods including `__constructor__` methods can be made `protected`. This is desirable as test code has no business calling these methods, by making your `@Implementation` methods protected you encourage test writers to call the public Android APIs instead.

### Don't use `useinheritImplementationMethods`
This is usually unnecessary and will be removed in Robolectric 3.8
This is usually unnecessary and will be removed in [Robolectric 3.8](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.8)
### Don't override `equals`, `hashCode` and `toString` in shadows.
Avoid this unless you are mimicking behaviour in the class being shadowed. To test equality for comparisons in tests prefer helpers or assertion library extensions. prefer adding a `describe()` method instead of shadowing `toString()`
Expand Down
4 changes: 2 additions & 2 deletions docs/using-add-on-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ In order to reduce the number of external dependencies on the application being
| com.google.android.gms:play-services | org.robolectric:shadows-playservices |
| org.apache.httpcomponents:httpclient | org.robolectric:shadows-httpclient |

The above artifact names are in use since Robolectric 3.5+. Robolectric 3.4.x drops `shadows-` prefix from artifact names. Prior to 3.4, all artifact names are the same as latest, except that `shadows-supportv4` and `shadow-playservices` are `shadows-support-v4` and `shadow-play-services` respectively.
The above artifact names are in use since [Robolectric 3.5](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.5). [Robolectric 3.4](https://github.com/robolectric/robolectric/releases/tag/robolectric-3.4) drops `shadows-` prefix from artifact names. Prior to 3.4, all artifact names are the same as latest, except that `shadows-supportv4` and `shadow-playservices` are `shadows-support-v4` and `shadow-play-services` respectively.

Note that `org.robolectric:shadows-supportv4` was deprecated at Robolectric 4.8, and was removed at Robolectric 4.9.
Note that `org.robolectric:shadows-supportv4` was deprecated at [Robolectric 4.8](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.8), and was removed at [Robolectric 4.9](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.9).

0 comments on commit b2bac40

Please sign in to comment.