Skip to content

Commit 0d2fc0b

Browse files
sikeokaaaime
authored andcommitted
Upgrade hamcrest from 1.3 to 3.0
1 parent 111dcc7 commit 0d2fc0b

15 files changed

Lines changed: 51 additions & 140 deletions

File tree

geowebcache/arcgiscache/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,11 @@
2727
</dependency>
2828

2929
<!-- test dependencies -->
30-
<dependency>
31-
<groupId>junit</groupId>
32-
<artifactId>junit</artifactId>
33-
<scope>test</scope>
34-
</dependency>
3530
<dependency>
3631
<groupId>org.easymock</groupId>
3732
<artifactId>easymock</artifactId>
3833
<scope>test</scope>
3934
</dependency>
40-
<dependency>
41-
<groupId>org.hamcrest</groupId>
42-
<artifactId>hamcrest-library</artifactId>
43-
<scope>test</scope>
44-
</dependency>
4535
<dependency>
4636
<groupId>org.springframework</groupId>
4737
<artifactId>spring-test</artifactId>

geowebcache/azureblob/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
<artifactId>log4j-slf4j-impl</artifactId>
3131
</dependency>
3232

33-
<dependency>
34-
<groupId>junit</groupId>
35-
<artifactId>junit</artifactId>
36-
<scope>test</scope>
37-
</dependency>
3833
<dependency>
3934
<groupId>org.mockito</groupId>
4035
<artifactId>mockito-core</artifactId>
@@ -51,11 +46,6 @@
5146
<classifier>tests</classifier>
5247
<scope>test</scope>
5348
</dependency>
54-
<dependency>
55-
<groupId>org.hamcrest</groupId>
56-
<artifactId>hamcrest-library</artifactId>
57-
<scope>test</scope>
58-
</dependency>
5949
<dependency>
6050
<groupId>javax.servlet</groupId>
6151
<artifactId>javax.servlet-api</artifactId>

geowebcache/core/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,6 @@
180180
<artifactId>httpclient</artifactId>
181181
</dependency>
182182
<!-- test dependencies -->
183-
<dependency>
184-
<groupId>junit</groupId>
185-
<artifactId>junit</artifactId>
186-
<scope>test</scope>
187-
</dependency>
188-
<dependency>
189-
<groupId>org.hamcrest</groupId>
190-
<artifactId>hamcrest-library</artifactId>
191-
<scope>test</scope>
192-
</dependency>
193-
<dependency>
194-
<groupId>org.hamcrest</groupId>
195-
<artifactId>hamcrest-integration</artifactId>
196-
<scope>test</scope>
197-
</dependency>
198183
<dependency>
199184
<groupId>org.mockito</groupId>
200185
<artifactId>mockito-core</artifactId>

geowebcache/core/src/test/java/org/geowebcache/filter/parameters/ParametersUtilsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
import static org.hamcrest.MatcherAssert.assertThat;
1818
import static org.hamcrest.Matchers.empty;
19+
import static org.hamcrest.Matchers.emptyString;
1920
import static org.hamcrest.Matchers.equalTo;
20-
import static org.hamcrest.Matchers.isEmptyString;
2121

2222
import java.util.Collections;
2323
import java.util.Map;
@@ -35,7 +35,7 @@ public class ParametersUtilsTest {
3535
@Test
3636
public void testEmptyToKVP() {
3737
String result = ParametersUtils.getKvp(Collections.emptyMap());
38-
assertThat(result, isEmptyString());
38+
assertThat(result, emptyString());
3939
}
4040

4141
@Test

geowebcache/core/src/test/java/org/geowebcache/seed/TruncateBboxRequestTest.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
import java.util.Map;
2929
import java.util.Set;
3030
import org.easymock.EasyMock;
31+
import org.easymock.IArgumentMatcher;
3132
import org.geowebcache.grid.BoundingBox;
3233
import org.geowebcache.grid.GridSubset;
3334
import org.geowebcache.layer.TileLayer;
3435
import org.geowebcache.mime.ImageMime;
3536
import org.geowebcache.storage.StorageBroker;
36-
import org.hamcrest.integration.EasyMock2Adapter;
37+
import org.hamcrest.Matcher;
38+
import org.hamcrest.StringDescription;
3739
import org.junit.Test;
3840

3941
public class TruncateBboxRequestTest {
@@ -47,7 +49,7 @@ protected SeedRequest seedRequest(
4749
int maxZ,
4850
BoundingBox bounds,
4951
Map<String, String> parameters) {
50-
EasyMock2Adapter.adapt(
52+
Matcher<Object> matcher =
5153
allOf(
5254
hasProperty("layerName", equalTo(layerName)),
5355
hasProperty("gridSetId", equalTo(gridSet)),
@@ -58,7 +60,20 @@ protected SeedRequest seedRequest(
5860
hasProperty("filterUpdate", any(Boolean.class)),
5961
hasProperty("threadCount", any(Integer.class)),
6062
hasProperty("bounds", equalTo(bounds)),
61-
hasProperty("type", any(GWCTask.TYPE.class))));
63+
hasProperty("type", any(GWCTask.TYPE.class)));
64+
EasyMock.reportMatcher(
65+
new IArgumentMatcher() {
66+
67+
@Override
68+
public boolean matches(Object argument) {
69+
return matcher.matches(argument);
70+
}
71+
72+
@Override
73+
public void appendTo(StringBuffer buffer) {
74+
matcher.describeTo(new StringDescription(buffer));
75+
}
76+
});
6277
return null;
6378
}
6479

geowebcache/diskquota/bdb/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
</dependency>
2626

2727
<!-- test dependencies -->
28-
<dependency>
29-
<groupId>junit</groupId>
30-
<artifactId>junit</artifactId>
31-
<scope>test</scope>
32-
</dependency>
3328
<dependency>
3429
<groupId>org.easymock</groupId>
3530
<artifactId>easymock</artifactId>
@@ -46,11 +41,6 @@
4641
<classifier>tests</classifier>
4742
<scope>test</scope>
4843
</dependency>
49-
<dependency>
50-
<groupId>org.hamcrest</groupId>
51-
<artifactId>hamcrest-library</artifactId>
52-
<scope>test</scope>
53-
</dependency>
5444
<dependency>
5545
<groupId>javax.servlet</groupId>
5646
<artifactId>javax.servlet-api</artifactId>

geowebcache/diskquota/jdbc/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@
3636
</dependency>
3737

3838
<!-- test dependencies -->
39-
<dependency>
40-
<groupId>junit</groupId>
41-
<artifactId>junit</artifactId>
42-
<scope>test</scope>
43-
</dependency>
4439
<dependency>
4540
<groupId>org.easymock</groupId>
4641
<artifactId>easymock</artifactId>
@@ -58,11 +53,6 @@
5853
<classifier>tests</classifier>
5954
<scope>test</scope>
6055
</dependency>
61-
<dependency>
62-
<groupId>org.hamcrest</groupId>
63-
<artifactId>hamcrest-library</artifactId>
64-
<scope>test</scope>
65-
</dependency>
6656
<dependency>
6757
<groupId>javax.servlet</groupId>
6858
<artifactId>javax.servlet-api</artifactId>

geowebcache/mbtiles/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,11 @@
3333
</dependency>
3434

3535
<!-- test dependencies -->
36-
<dependency>
37-
<groupId>junit</groupId>
38-
<artifactId>junit</artifactId>
39-
<scope>test</scope>
40-
</dependency>
4136
<dependency>
4237
<groupId>org.easymock</groupId>
4338
<artifactId>easymock</artifactId>
4439
<scope>test</scope>
4540
</dependency>
46-
<dependency>
47-
<groupId>org.hamcrest</groupId>
48-
<artifactId>hamcrest-library</artifactId>
49-
<scope>test</scope>
50-
</dependency>
5141
<dependency>
5242
<groupId>org.springframework</groupId>
5343
<artifactId>spring-test</artifactId>

geowebcache/pom.xml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<commons-text.version>1.12.0</commons-text.version>
6565
<commons-fileupload.version>1.5</commons-fileupload.version>
6666
<guava.version>33.2.1-jre</guava.version>
67+
<hamcrest.version>3.0</hamcrest.version>
6768
<jsr305.version>3.0.1</jsr305.version>
6869
<log4j.version>2.17.2</log4j.version>
6970
<h2.version>1.1.119</h2.version>
@@ -273,17 +274,29 @@
273274
<artifactId>junit</artifactId>
274275
<version>4.13.2</version>
275276
<scope>test</scope>
277+
<exclusions>
278+
<exclusion>
279+
<artifactId>hamcrest-core</artifactId>
280+
<groupId>org.hamcrest</groupId>
281+
</exclusion>
282+
</exclusions>
276283
</dependency>
277284
<dependency>
278285
<groupId>org.hamcrest</groupId>
279-
<artifactId>hamcrest-library</artifactId>
280-
<version>1.3</version>
286+
<artifactId>hamcrest</artifactId>
287+
<version>${hamcrest.version}</version>
281288
<scope>test</scope>
282289
</dependency>
283290
<dependency>
284291
<groupId>org.hamcrest</groupId>
285-
<artifactId>hamcrest-integration</artifactId>
286-
<version>1.3</version>
292+
<artifactId>hamcrest-core</artifactId>
293+
<version>${hamcrest.version}</version>
294+
<scope>test</scope>
295+
</dependency>
296+
<dependency>
297+
<groupId>org.hamcrest</groupId>
298+
<artifactId>hamcrest-library</artifactId>
299+
<version>${hamcrest.version}</version>
287300
<scope>test</scope>
288301
</dependency>
289302

@@ -470,6 +483,20 @@
470483
</dependencies>
471484
</dependencyManagement>
472485

486+
<!-- common test dependencies -->
487+
<dependencies>
488+
<dependency>
489+
<groupId>junit</groupId>
490+
<artifactId>junit</artifactId>
491+
<scope>test</scope>
492+
</dependency>
493+
<dependency>
494+
<groupId>org.hamcrest</groupId>
495+
<artifactId>hamcrest</artifactId>
496+
<scope>test</scope>
497+
</dependency>
498+
</dependencies>
499+
473500
<repositories>
474501
<repository>
475502
<releases>

geowebcache/rest/pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
</dependency>
3636

3737
<!-- test dependencies -->
38-
<dependency>
39-
<groupId>junit</groupId>
40-
<artifactId>junit</artifactId>
41-
<scope>test</scope>
42-
</dependency>
4338
<dependency>
4439
<groupId>org.geowebcache</groupId>
4540
<artifactId>gwc-core</artifactId>
@@ -57,11 +52,6 @@
5752
<artifactId>easymock</artifactId>
5853
<scope>test</scope>
5954
</dependency>
60-
<dependency>
61-
<groupId>org.hamcrest</groupId>
62-
<artifactId>hamcrest-library</artifactId>
63-
<scope>test</scope>
64-
</dependency>
6555
<dependency>
6656
<groupId>org.mockito</groupId>
6757
<artifactId>mockito-core</artifactId>

0 commit comments

Comments
 (0)