source: josm/trunk/test/unit/org/openstreetmap/josm/data/osm/StorageTest.java@ 13079

Last change on this file since 13079 was 13079, checked in by Don-vip, 6 years ago

see #15560 - EqualsVerifier does not work with newer Java versions -> disable tests automatically in this case
Workaround to https://github.com/jqno/equalsverifier/issues/177 / https://github.com/raphw/byte-buddy/issues/370
Inspired by https://issues.apache.org/jira/browse/SOLR-11606

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm;
3
4import org.junit.Rule;
5import org.junit.Test;
6import org.openstreetmap.josm.TestUtils;
7import org.openstreetmap.josm.testutils.JOSMTestRules;
8
9import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
10import nl.jqno.equalsverifier.EqualsVerifier;
11import nl.jqno.equalsverifier.Warning;
12
13/**
14 * Unit tests for class {@link Storage}.
15 */
16public class StorageTest {
17
18 /**
19 * Setup test.
20 */
21 @Rule
22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
23 public JOSMTestRules test = new JOSMTestRules();
24
25 /**
26 * Unit test of methods {@link Storage#equals} and {@link Storage#hashCode}.
27 */
28 @Test
29 public void testEqualsContract() {
30 TestUtils.assumeWorkingEqualsVerifier();
31 EqualsVerifier.forClass(Storage.class).usingGetClass()
32 .suppress(Warning.NONFINAL_FIELDS)
33 .withIgnoredFields("arrayCopyNecessary", "hash", "mask", "modCount", "safeIterator", "size")
34 .withPrefabValues(Hash.class, Storage.<Integer>defaultHash(), Storage.<Boolean>defaultHash())
35 .verify();
36 }
37}
Note: See TracBrowser for help on using the repository browser.