Skip to content

Commit e4d0d88

Browse files
committed
Issue #171 - Replacing junit.framework Package in Some Kotlin Test Files
`junit.framework` is deprecated. Replacing it with `org.junit` in 4 Kotlin Test files.
1 parent a6fa824 commit e4d0d88

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

app/src/test/kotlin/fr/free/nrw/commons/bookmarks/locations/BookMarkLocationDaoTest.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ import android.database.sqlite.SQLiteDatabase
88
import android.net.Uri
99
import android.os.RemoteException
1010
import com.nhaarman.mockito_kotlin.*
11-
import fr.free.nrw.commons.BuildConfig
1211
import fr.free.nrw.commons.TestCommonsApplication
1312
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsContentProvider.BASE_URI
1413
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao.Table.*
1514
import fr.free.nrw.commons.location.LatLng
1615
import fr.free.nrw.commons.nearby.Label
1716
import fr.free.nrw.commons.nearby.Place
1817
import fr.free.nrw.commons.nearby.Sitelinks
19-
import junit.framework.Assert.*
18+
import org.junit.Assert.*
2019
import org.junit.Before
2120
import org.junit.Test
2221
import org.junit.runner.RunWith
@@ -88,8 +87,8 @@ class BookMarkLocationDaoTest {
8887
assertEquals("placeName", it.name)
8988
assertEquals(Label.FOREST, it.label)
9089
assertEquals("placeDescription", it.longDescription)
91-
assertEquals(40.0, it.location.latitude)
92-
assertEquals(51.4, it.location.longitude)
90+
assertEquals(40.0, it.location.latitude, 0.00000001)
91+
assertEquals(51.4, it.location.longitude, 0.00000001)
9392
assertEquals("placeCategory", it.category)
9493
assertEquals(builder.build().wikipediaLink, it.siteLinks.wikipediaLink)
9594
assertEquals(builder.build().wikidataLink, it.siteLinks.wikidataLink)
@@ -151,8 +150,8 @@ class BookMarkLocationDaoTest {
151150
assertEquals(examplePlaceBookmark.longDescription, cv.getAsString(COLUMN_DESCRIPTION))
152151
assertEquals(examplePlaceBookmark.label.text, cv.getAsString(COLUMN_LABEL_TEXT))
153152
assertEquals(examplePlaceBookmark.category, cv.getAsString(COLUMN_CATEGORY))
154-
assertEquals(examplePlaceBookmark.location.latitude, cv.getAsDouble(COLUMN_LAT))
155-
assertEquals(examplePlaceBookmark.location.longitude, cv.getAsDouble(COLUMN_LONG))
153+
assertEquals(examplePlaceBookmark.location.latitude, cv.getAsDouble(COLUMN_LAT), 0.00000001)
154+
assertEquals(examplePlaceBookmark.location.longitude, cv.getAsDouble(COLUMN_LONG), 0.00000001)
156155
assertEquals(examplePlaceBookmark.siteLinks.wikipediaLink.toString(), cv.getAsString(COLUMN_WIKIPEDIA_LINK))
157156
assertEquals(examplePlaceBookmark.siteLinks.wikidataLink.toString(), cv.getAsString(COLUMN_WIKIDATA_LINK))
158157
assertEquals(examplePlaceBookmark.siteLinks.commonsLink.toString(), cv.getAsString(COLUMN_COMMONS_LINK))

app/src/test/kotlin/fr/free/nrw/commons/review/ReviewHelperTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import fr.free.nrw.commons.Media
44
import fr.free.nrw.commons.media.MediaClient
55
import io.reactivex.Observable
66
import io.reactivex.Single
7-
import junit.framework.Assert.assertNotNull
8-
import junit.framework.Assert.assertNull
7+
import org.junit.Assert.assertNotNull
8+
import org.junit.Assert.assertNull
99
import org.junit.Assert.assertTrue
1010
import org.junit.Before
1111
import org.junit.Test

app/src/test/kotlin/fr/free/nrw/commons/upload/FileMetadataUtilsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package fr.free.nrw.commons.upload
22

33
import androidx.exifinterface.media.ExifInterface.*
4-
import junit.framework.Assert.assertTrue
4+
import org.junit.Assert.assertTrue
55
import org.junit.Test
66
import java.util.*
77

0 commit comments

Comments
 (0)