- upgrade to gradle 5.3.1 - upgrade to junit 5 - update test for compatibility to junit 5
This commit is contained in:
parent
079723937d
commit
bb45e3ed9e
@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version Config.Versions.kotlin
|
kotlin("jvm") version Config.Versions.kotlin
|
||||||
|
jacoco
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "norangebit"
|
group = "norangebit"
|
||||||
@ -21,8 +22,10 @@ dependencies {
|
|||||||
testImplementation(Config.Libs.junit)
|
testImplementation(Config.Libs.junit)
|
||||||
testImplementation(Config.Libs.kluent)
|
testImplementation(Config.Libs.kluent)
|
||||||
testImplementation(Config.Libs.mockk)
|
testImplementation(Config.Libs.mockk)
|
||||||
|
testImplementation (Config.Libs.jetbrainJunit)
|
||||||
// testImplementation(Config.Libs.spekDsl)
|
// testImplementation(Config.Libs.spekDsl)
|
||||||
|
|
||||||
|
testRuntimeOnly(Config.Libs.junitEngine)
|
||||||
// testRuntimeOnly(Config.Libs.kotlinReflect)
|
// testRuntimeOnly(Config.Libs.kotlinReflect)
|
||||||
// testRuntimeOnly(Config.Libs.spekRunner)
|
// testRuntimeOnly(Config.Libs.spekRunner)
|
||||||
}
|
}
|
||||||
@ -31,4 +34,8 @@ tasks.withType<KotlinCompile> {
|
|||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("ktlint", Ktlint::class)
|
tasks.getByName<Test>("test") {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("ktlint", Ktlint::class)
|
||||||
|
@ -28,10 +28,10 @@ object Config {
|
|||||||
val arrow = "0.8.2"
|
val arrow = "0.8.2"
|
||||||
val kluent = "1.48"
|
val kluent = "1.48"
|
||||||
val koin = "1.0.2"
|
val koin = "1.0.2"
|
||||||
val junit = "5.1.0"
|
val junit = "5.4.2"
|
||||||
val spek = "2.0.1"
|
val spek = "2.0.1"
|
||||||
val kotlin = "1.3.21"
|
val kotlin = "1.3.30"
|
||||||
val mockk = "1.9.2"
|
val mockk = "1.9.3"
|
||||||
val gson = "2.8.5"
|
val gson = "2.8.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,11 +39,13 @@ object Config {
|
|||||||
val arrowCore = "io.arrow-kt:arrow-core:${Versions.arrow}"
|
val arrowCore = "io.arrow-kt:arrow-core:${Versions.arrow}"
|
||||||
val koin = "org.koin:koin-core:${Versions.koin}"
|
val koin = "org.koin:koin-core:${Versions.koin}"
|
||||||
val junit = "org.junit.jupiter:junit-jupiter-api:${Versions.junit}"
|
val junit = "org.junit.jupiter:junit-jupiter-api:${Versions.junit}"
|
||||||
|
val junitEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junit}"
|
||||||
val kluent = "org.amshove.kluent:kluent:${Versions.kluent}"
|
val kluent = "org.amshove.kluent:kluent:${Versions.kluent}"
|
||||||
val spekDsl = "org.spekframework.spek2:spek-dsl-jvm:${Versions.spek}"
|
val spekDsl = "org.spekframework.spek2:spek-dsl-jvm:${Versions.spek}"
|
||||||
val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}"
|
val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}"
|
||||||
val spekRunner = "org.spekframework.spek2:spek-runner-junit5:${Versions.spek}"
|
val spekRunner = "org.spekframework.spek2:spek-runner-junit5:${Versions.spek}"
|
||||||
val mockk = "io.mockk:mockk:${Versions.mockk}"
|
val mockk = "io.mockk:mockk:${Versions.mockk}"
|
||||||
val gson = "com.google.code.gson:gson:${Versions.gson}"
|
val gson = "com.google.code.gson:gson:${Versions.gson}"
|
||||||
|
val jetbrainJunit = "org.jetbrains.kotlin:kotlin-test-junit:${Versions.kotlin}"
|
||||||
}
|
}
|
||||||
}
|
}
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -26,14 +26,14 @@
|
|||||||
package it.norangeb.algorithms.datastructures.bag
|
package it.norangeb.algorithms.datastructures.bag
|
||||||
|
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class LinkedListBagTest {
|
class LinkedListBagTest {
|
||||||
private var bag = LinkedListBag<Int>()
|
private lateinit var bag :LinkedListBag<Int>
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun makeBag() {
|
fun init() {
|
||||||
bag = LinkedListBag()
|
bag = LinkedListBag()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
package it.norangeb.algorithms.datastructures.bag
|
package it.norangeb.algorithms.datastructures.bag
|
||||||
|
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class ResizingArrayBagTest {
|
class ResizingArrayBagTest {
|
||||||
private var bag = ResizingArrayBag<Int>()
|
private lateinit var bag :ResizingArrayBag<Int>
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun makeBag() {
|
fun makeBag() {
|
||||||
bag = ResizingArrayBag()
|
bag = ResizingArrayBag()
|
||||||
}
|
}
|
||||||
|
@ -30,13 +30,13 @@ import arrow.core.Some
|
|||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.amshove.kluent.`should be`
|
import org.amshove.kluent.`should be`
|
||||||
import org.amshove.kluent.should
|
import org.amshove.kluent.should
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class MapTest {
|
class MapTest {
|
||||||
lateinit var map: Dictionary<String, Int>
|
lateinit var map: Dictionary<String, Int>
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun init() {
|
fun init() {
|
||||||
map = Map()
|
map = Map()
|
||||||
}
|
}
|
||||||
|
@ -29,13 +29,13 @@ import arrow.core.None
|
|||||||
import arrow.core.Some
|
import arrow.core.Some
|
||||||
import arrow.core.getOrElse
|
import arrow.core.getOrElse
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class LinkedListQueueTest {
|
class LinkedListQueueTest {
|
||||||
private var queue = LinkedListQueue<Int>()
|
private lateinit var queue : LinkedListQueue<Int>
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun makeQueue() {
|
fun makeQueue() {
|
||||||
queue = LinkedListQueue()
|
queue = LinkedListQueue()
|
||||||
}
|
}
|
||||||
|
@ -29,13 +29,13 @@ import arrow.core.None
|
|||||||
import arrow.core.Some
|
import arrow.core.Some
|
||||||
import arrow.core.getOrElse
|
import arrow.core.getOrElse
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class ResizingArrayQueueTest {
|
class ResizingArrayQueueTest {
|
||||||
private var queue = ResizingArrayQueue<Int>()
|
private lateinit var queue : ResizingArrayQueue<Int>
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun makeQueue() {
|
fun makeQueue() {
|
||||||
queue = ResizingArrayQueue()
|
queue = ResizingArrayQueue()
|
||||||
}
|
}
|
||||||
|
@ -28,14 +28,14 @@ package it.norangeb.algorithms.datastructures.stack
|
|||||||
import arrow.core.None
|
import arrow.core.None
|
||||||
import arrow.core.getOrElse
|
import arrow.core.getOrElse
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class LinkedListStackTest {
|
class LinkedListStackTest {
|
||||||
private var stack = LinkedListStack<Int>()
|
private lateinit var stack : LinkedListStack<Int>
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun makeStack() {
|
fun init() {
|
||||||
stack = LinkedListStack()
|
stack = LinkedListStack()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
package it.norangeb.algorithms.datastructures.unionfind
|
package it.norangeb.algorithms.datastructures.unionfind
|
||||||
|
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class QuickFindTest {
|
class QuickFindTest {
|
||||||
private var unionFind = QuickFind(10)
|
private lateinit var unionFind : QuickFind
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun init() {
|
fun init() {
|
||||||
unionFind = QuickFind(10)
|
unionFind = QuickFind(10)
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
package it.norangeb.algorithms.datastructures.unionfind
|
package it.norangeb.algorithms.datastructures.unionfind
|
||||||
|
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class QuickUnionCompressionPathTest {
|
class QuickUnionCompressionPathTest {
|
||||||
private var unionFind = QuickUnion(10)
|
private lateinit var unionFind : QuickUnion
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun init() {
|
fun init() {
|
||||||
unionFind = QuickUnion(10)
|
unionFind = QuickUnion(10)
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
package it.norangeb.algorithms.datastructures.unionfind
|
package it.norangeb.algorithms.datastructures.unionfind
|
||||||
|
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class QuickUnionTest {
|
class QuickUnionTest {
|
||||||
private var unionFind = QuickUnion(10)
|
private lateinit var unionFind : QuickUnion
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun init() {
|
fun init() {
|
||||||
unionFind = QuickUnion(10)
|
unionFind = QuickUnion(10)
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
package it.norangeb.algorithms.datastructures.unionfind
|
package it.norangeb.algorithms.datastructures.unionfind
|
||||||
|
|
||||||
import org.amshove.kluent.`should be equal to`
|
import org.amshove.kluent.`should be equal to`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.BeforeEach
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class QuickUnionWithSizeTest {
|
class QuickUnionWithSizeTest {
|
||||||
private var unionFind = QuickUnionWithSize(10)
|
private lateinit var unionFind : QuickUnionWithSize
|
||||||
|
|
||||||
@Before
|
@BeforeEach
|
||||||
fun init() {
|
fun init() {
|
||||||
unionFind = QuickUnionWithSize(10)
|
unionFind = QuickUnionWithSize(10)
|
||||||
}
|
}
|
||||||
|
@ -26,22 +26,16 @@
|
|||||||
package it.norangeb.algorithms.exercises
|
package it.norangeb.algorithms.exercises
|
||||||
|
|
||||||
import org.amshove.kluent.`should equal`
|
import org.amshove.kluent.`should equal`
|
||||||
import org.junit.Before
|
import org.junit.jupiter.api.Test
|
||||||
import org.junit.Test
|
|
||||||
|
|
||||||
class OrderedListSorterTest {
|
class OrderedListSorterTest {
|
||||||
|
|
||||||
lateinit var lists: List<List<Int>>
|
val lists = listOf(
|
||||||
|
|
||||||
@Before
|
|
||||||
fun init() {
|
|
||||||
lists = listOf(
|
|
||||||
listOf(1, 5, 9, 10, 12, 14, 15, 15, 20, 25, 29, 31, 35, 37, 43, 48),
|
listOf(1, 5, 9, 10, 12, 14, 15, 15, 20, 25, 29, 31, 35, 37, 43, 48),
|
||||||
listOf(2, 7, 12, 21, 23, 33, 35, 43, 45),
|
listOf(2, 7, 12, 21, 23, 33, 35, 43, 45),
|
||||||
listOf(3, 7, 9, 12, 14, 16, 27, 28, 37, 39, 45, 45, 46, 50),
|
listOf(3, 7, 9, 12, 14, 16, 27, 28, 37, 39, 45, 45, 46, 50),
|
||||||
listOf(1, 8, 9, 11, 13, 21, 25, 33, 34, 41, 47, 48)
|
listOf(1, 8, 9, 11, 13, 21, 25, 33, 34, 41, 47, 48)
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testSortUnsignedInt() {
|
fun testSortUnsignedInt() {
|
||||||
|
Loading…
Reference in New Issue
Block a user