Changeset 9220 in josm for trunk/test/unit
- Timestamp:
- 2015-12-30T03:21:52+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/oauth
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
r9201 r9220 5 5 import static org.junit.Assert.assertNotEquals; 6 6 import static org.junit.Assert.assertNotNull; 7 import nl.jqno.equalsverifier.EqualsVerifier; 7 8 8 9 import org.junit.Test; 10 import org.openstreetmap.josm.Main; 9 11 import org.openstreetmap.josm.io.OsmApi; 10 12 … … 25 27 assertNotNull(dev); 26 28 assertNotEquals(def, dev); 29 Main.logLevel = 5; // enable trace for line coverage 27 30 assertEquals(def, OAuthParameters.createDefault("wrong_url")); 28 31 } 29 32 30 33 /** 31 * Unit test of method {@link OAuthParameters#equals}.34 * Unit test of methods {@link OAuthParameters#equals} and {@link OAuthParameters#hashCode}. 32 35 */ 33 36 @Test 34 public void testEquals() { 35 OAuthParameters dev = OAuthParameters.createDefault("http://master.apis.dev.openstreetmap.org/api"); 36 OAuthParameters dev2 = new OAuthParameters(dev); 37 assertEquals(dev, dev2); 37 public void equalsContract() { 38 EqualsVerifier.forClass(OAuthParameters.class).usingGetClass().verify(); 38 39 } 39 40 } -
trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java
r9201 r9220 4 4 import static org.junit.Assert.assertEquals; 5 5 import static org.junit.Assert.assertNotNull; 6 import nl.jqno.equalsverifier.EqualsVerifier; 6 7 import oauth.signpost.OAuthConsumer; 7 8 … … 27 28 28 29 /** 29 * Unit test of method {@link OAuthToken#equals}.30 * Unit test of methods {@link OAuthToken#equals} and {@link OAuthToken#hashCode}. 30 31 */ 31 32 @Test 32 public void testEquals() { 33 OAuthToken tok = new OAuthToken( 34 OAuthParameters.DEFAULT_JOSM_CONSUMER_KEY, 35 OAuthParameters.DEFAULT_JOSM_CONSUMER_SECRET); 36 OAuthToken tok2 = new OAuthToken(tok); 37 assertEquals(tok, tok2); 33 public void equalsContract() { 34 EqualsVerifier.forClass(OAuthToken.class).usingGetClass().verify(); 38 35 } 39 36 }
Note:
See TracChangeset
for help on using the changeset viewer.