Changeset 10201 in josm for trunk/test


Ignore:
Timestamp:
2016-05-13T04:02:38+02:00 (4 years ago)
Author:
Don-vip
Message:

add more unit tests

Location:
trunk/test/unit/org/openstreetmap/josm/data/oauth
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java

    r9666 r10201  
    55import static org.junit.Assert.assertNotEquals;
    66import static org.junit.Assert.assertNotNull;
    7 import nl.jqno.equalsverifier.EqualsVerifier;
    87
     8import org.junit.BeforeClass;
    99import org.junit.Test;
     10import org.openstreetmap.josm.JOSMFixture;
    1011import org.openstreetmap.josm.Main;
    1112import org.openstreetmap.josm.io.OsmApi;
     13
     14import nl.jqno.equalsverifier.EqualsVerifier;
    1215
    1316/**
     
    1518 */
    1619public class OAuthParametersTest {
     20
     21    /**
     22     * Setup test.
     23     */
     24    @BeforeClass
     25    public static void setUpBeforeClass() {
     26        JOSMFixture.createUnitTestFixture().init();
     27    }
    1728
    1829    /**
     
    3445
    3546    /**
     47     * Unit test of method {@link OAuthParameters#createFromPreferences}.
     48     */
     49    @Test
     50    public void testCreateFromPreferences() {
     51        assertNotNull(OAuthParameters.createFromPreferences(Main.pref));
     52    }
     53
     54    /**
    3655     * Unit test of methods {@link OAuthParameters#equals} and {@link OAuthParameters#hashCode}.
    3756     */
  • trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java

    r9666 r10201  
    44import static org.junit.Assert.assertEquals;
    55import static org.junit.Assert.assertNotNull;
     6
     7import org.junit.Test;
     8
    69import nl.jqno.equalsverifier.EqualsVerifier;
    710import oauth.signpost.OAuthConsumer;
    8 
    9 import org.junit.Test;
    1011
    1112/**
     
    2526        assertEquals(defCon.getToken(), defTok.getKey());
    2627        assertEquals(defCon.getTokenSecret(), defTok.getSecret());
     28        assertEquals(defTok, new OAuthToken(defTok));
    2729    }
    2830
Note: See TracChangeset for help on using the changeset viewer.