Skip to content
mariuszs edited this page Nov 8, 2014 · 5 revisions

Prerequisites

catch-exception-1.3.2 requires JDK 1.6 due to a compiler issue of JDK 1.5.

Download

catch-exception-1.3.2 can be downloaded from Maven Central.

The Maven coordinates are

<dependency>
    <groupId>eu.codearte.catch-exception</groupId>
    <artifactId>catch-exception</artifactId>
    <version>1.3.2</version>
    <scope>test</scope> <!-- test scope to use it only in tests -->
</dependency>

If you want to catch throwables, use

<dependency>
    <groupId>eu.codearte.catch-exception</groupId>
    <artifactId>catch-throwable</artifactId>
    <version>1.3.2</version>
    <scope>test</scope> <!-- test scope to use it only in tests -->
</dependency>

Dependencies

Users who do not use Maven or another dependeny management tool have to manually download the libraries catch-exception depends on, namely Mockito and, optionally, Powermock.

Mockito

catch-exception-1.3.2 depends on Mockito.

The maven coordinates of that dependency are

<dependency>
  <groupId>org.mockito</groupId>
  <artifactId>mockito-core</artifactId>
  <version>[1.8.1, 1.10.8]</version>
</dependency>

The library requires at least Mockito 1.8.1. Successfully tested versions are 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.9.0-rc1, 1.9.0, 1.9.5-rc1, 1.9.5, 1.10.0+ up to 1.10.8 only.

The versions 1.5, 1.6, 1.7 and 1.10.9, 1.10.10 are not compatible with catch-exception.

PowerMock

catch-exception-1.3.2 optionally uses [http://code.google.com/p/powermock/ Powermock 1.5.5] in order to catch exceptions thrown by final classes.

The maven coordinates of that dependency are

<dependency>
  <groupId>org.powermock</groupId>
  <artifactId>powermock-module-junit4</artifactId>
  <version>1.5.5</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.powermock</groupId>
  <artifactId>powermock-api-mockito</artifactId>
  <version>1.5.5</version>
  <scope>test</scope>
</dependency>

The library requires at least PowerMock 1.5.5. Successfully tested versions are 1.5.6, 1.5.5, 1.5.4, 1.5.2, 1.5.1, 1.5.

Clone this wiki locally