Skip to content
Snippets Groups Projects
Verified Commit 26028259 authored by Mikolai Gütschow's avatar Mikolai Gütschow Committed by Sebastian
Browse files

move unit tests from TestNG to JUnit4

parent 06b271bf
No related branches found
No related tags found
1 merge request!256Automated screenshots via testing API
......@@ -118,7 +118,6 @@ dependencies {
val daggerVersion = "2.24"
kapt("com.google.dagger:dagger-compiler:$daggerVersion")
testImplementation(kotlin("test-testng"))
testImplementation(project(path = ":bramble-core", configuration = "testOutput"))
testImplementation("commons-io:commons-io:2.11.0")
kaptTest("com.google.dagger:dagger-compiler:$daggerVersion")
......@@ -137,9 +136,7 @@ configurations.all {
}
tasks.test {
// todo: both cannot be used at once, we probably have to split tests into UI (Compose, JUnit) and Kotlin code (testNG)
useJUnit()
// useTestNG()
}
tasks.withType<KotlinCompile> {
......
......@@ -18,9 +18,9 @@
package org.briarproject.briar.desktop.attachment.media
import org.junit.Test
import java.net.URL
import javax.imageio.ImageIO
import kotlin.test.Test
@Suppress("HardCodedStringLiteral")
class ImageCompressorTest {
......
......@@ -27,9 +27,9 @@ import org.briarproject.bramble.api.identity.Author
import org.briarproject.bramble.api.identity.AuthorId
import org.briarproject.briar.api.client.MessageTracker
import org.briarproject.briar.api.identity.AuthorInfo
import org.junit.Assert.assertEquals
import org.junit.Test
import kotlin.random.Random
import kotlin.test.Test
import kotlin.test.assertEquals
@Suppress("HardCodedStringLiteral")
class ContactItemTest {
......
......@@ -18,9 +18,9 @@
package org.briarproject.briar.desktop.utils
import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals
import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Test
@Suppress("HardCodedStringLiteral")
class ListUtilsTest {
......@@ -33,22 +33,22 @@ class ListUtilsTest {
// add to end
var idx = list.addAfterLast(7) { it < 7 }
assertEquals(list.lastIndex, idx)
assertContentEquals(listOf(1, 3, 5, 7), list, "failed to insert at end")
assertArrayEquals("failed to insert at end", arrayOf(1, 3, 5, 7), list.toTypedArray())
// add to start
idx = list.addAfterLast(0) { it < 0 }
assertEquals(0, idx)
assertContentEquals(listOf(0, 1, 3, 5, 7), list, "failed to insert at start")
assertArrayEquals("failed to insert at start", arrayOf(0, 1, 3, 5, 7), list.toTypedArray())
// add in-between
idx = list.addAfterLast(4) { it < 4 }
assertEquals(3, idx)
assertContentEquals(listOf(0, 1, 3, 4, 5, 7), list, "failed to insert in-between")
assertArrayEquals("failed to insert in-between", arrayOf(0, 1, 3, 4, 5, 7), list.toTypedArray())
// add to empty list
list.clear()
idx = list.addAfterLast(4) { it < 4 }
assertEquals(0, idx)
assertContentEquals(listOf(4), list, "failed to insert in empty list")
assertArrayEquals("failed to insert in empty list", arrayOf(4), list.toTypedArray())
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment