mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Tests to make sure COMPILE scoped dependencies are resolved properly.
This commit is contained in:
parent
1b7987b07a
commit
d029e654b0
1 changed files with 38 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
|||
package com.beust.kobalt.maven
|
||||
|
||||
import com.beust.kobalt.TestModule
|
||||
import com.beust.kobalt.api.IClasspathDependency
|
||||
import com.google.inject.Inject
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.testng.annotations.Guice
|
||||
import org.testng.annotations.Test
|
||||
|
||||
@Guice(modules = arrayOf(TestModule::class))
|
||||
class DependencyManagerTest @Inject constructor(val dependencyManager: DependencyManager) {
|
||||
|
||||
@Test(description = "Make sure that COMPILE scope dependencies get resolved properly")
|
||||
fun testScopeDependenciesShouldBeDownloaded() {
|
||||
val testDeps = listOf(dependencyManager.create("org.testng:testng:6.9.11"))
|
||||
|
||||
fun assertContains(dependencies: List<IClasspathDependency>, vararg ids: String) {
|
||||
ids.forEach { id ->
|
||||
assertThat(dependencies.any { it.id.contains(id) }).isTrue()
|
||||
}
|
||||
}
|
||||
|
||||
// Should only resolve to TestNG
|
||||
dependencyManager.transitiveClosure(testDeps, isTest = false).let { dependencies ->
|
||||
assertThat(dependencies.any { it.id.contains(":jcommander:") }).isFalse()
|
||||
assertContains(dependencies, ":testng:")
|
||||
}
|
||||
|
||||
// Should resolve to TestNG and its dependencies
|
||||
dependencyManager.transitiveClosure(testDeps, isTest = true).let { dependencies ->
|
||||
assertContains(dependencies, ":jcommander:")
|
||||
assertContains(dependencies, ":bsh:")
|
||||
assertContains(dependencies, ":ant:")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue