Update plugin test framework to junit5

Updates the testing infrastructure to use the latest relesae of junit and
leverages the new extension mechanism to create an easy to use testing
framework.  Also adds additional test coverage for several plugins.
This commit is contained in:
Gary Tierney
2018-08-19 22:28:41 +01:00
parent e255bd195e
commit 248a7d97d9
56 changed files with 1327 additions and 463 deletions
@@ -0,0 +1,17 @@
import org.apollo.game.plugin.skills.mining.Ore
import org.junit.jupiter.api.extension.ExtensionContext
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.ArgumentsProvider
import java.util.stream.Stream
data class MiningTestData(val rockId: Int, val expiredRockId: Int, val ore: Ore)
fun miningTestData(): Collection<MiningTestData> = Ore.values()
.flatMap { ore -> ore.objects.map { MiningTestData(it.key, it.value, ore) } }
.toList()
class MiningTestDataProvider : ArgumentsProvider {
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> {
return miningTestData().map { Arguments { arrayOf(it) } }.stream()
}
}