mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Renaming.
This commit is contained in:
parent
36d2953c8c
commit
f037474f36
7 changed files with 35 additions and 32 deletions
|
@ -6,8 +6,7 @@ import com.beust.kobalt.internal.ILogger
|
|||
import com.beust.kobalt.internal.KobaltSettings
|
||||
import com.beust.kobalt.internal.KobaltSettingsXml
|
||||
import com.beust.kobalt.maven.LocalRepo
|
||||
import com.beust.kobalt.maven.aether.Aether
|
||||
import com.beust.kobalt.maven.aether.KobaltAether
|
||||
import com.beust.kobalt.maven.aether.KobaltMavenResolver
|
||||
import com.google.common.eventbus.EventBus
|
||||
import com.google.inject.Provider
|
||||
import com.google.inject.Scopes
|
||||
|
@ -25,12 +24,12 @@ class TestModule : MainModule(Args(), TEST_KOBALT_SETTINGS) {
|
|||
override fun configureTest() {
|
||||
val localRepo = TestLocalRepo()
|
||||
bind(LocalRepo::class.java).toInstance(localRepo)
|
||||
val localAether = Aether(LOCAL_CACHE, TEST_KOBALT_SETTINGS, EventBus())
|
||||
val testAether = KobaltAether(KobaltSettings(KobaltSettingsXml()), localAether)
|
||||
bind(KobaltAether::class.java).to(testAether)
|
||||
// val localAether = Aether(LOCAL_CACHE, TEST_KOBALT_SETTINGS, EventBus())
|
||||
val testResolver = KobaltMavenResolver(KobaltSettings(KobaltSettingsXml()), TestLocalRepo(), EventBus())
|
||||
bind(KobaltMavenResolver::class.java).to(testResolver)
|
||||
bind(KobaltContext::class.java).toProvider(Provider<KobaltContext> {
|
||||
KobaltContext(args).apply {
|
||||
aether = testAether
|
||||
resolver = testResolver
|
||||
logger = object: ILogger {
|
||||
override fun log(tag: CharSequence, level: Int, message: CharSequence, newLine: Boolean) {
|
||||
println("TestLog: [$tag $level] " + message)
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.beust.kobalt.maven
|
|||
|
||||
import com.beust.kobalt.HostConfig
|
||||
import com.beust.kobalt.KobaltTest
|
||||
import com.beust.kobalt.maven.aether.KobaltAether
|
||||
import com.beust.kobalt.maven.aether.KobaltMavenResolver
|
||||
import com.beust.kobalt.misc.KobaltExecutors
|
||||
import com.beust.kobalt.misc.warn
|
||||
import org.testng.Assert
|
||||
|
@ -16,9 +16,8 @@ import kotlin.properties.Delegates
|
|||
@Test
|
||||
class DownloadTest @Inject constructor(
|
||||
val localRepo: LocalRepo,
|
||||
val pomFactory: Pom.IFactory,
|
||||
val dependencyManager: DependencyManager,
|
||||
val aether: KobaltAether,
|
||||
val resolver: KobaltMavenResolver,
|
||||
val executors: KobaltExecutors) : KobaltTest() {
|
||||
private var executor: ExecutorService by Delegates.notNull()
|
||||
|
||||
|
@ -153,8 +152,8 @@ class DownloadTest @Inject constructor(
|
|||
// since snapshots are not allowed to be returned when looking up a versionless id)
|
||||
val host = HostConfig("http://repository.jetbrains.com/all/")
|
||||
val id = "com.squareup.moshi:moshi:1.1.0"
|
||||
val dr = aether.resolve(id)
|
||||
Assert.assertEquals(dr.dependency.version, "1.1.0")
|
||||
val dr = resolver.resolve(id)
|
||||
Assert.assertEquals(dr.dependency.artifact.version, "1.1.0")
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue