1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00
This commit is contained in:
evanchooly 2015-12-16 22:51:57 -05:00
parent 9d4aa26109
commit 252c0fce36
2 changed files with 14 additions and 13 deletions

View file

@ -27,7 +27,7 @@ public class DownloadTest @Inject constructor(
}
private fun deleteDir(): Boolean {
val dir = File(localRepo.toFullPath("$groupId"))
val dir = File(localRepo.toFullPath(groupId))
val result = dir.deleteRecursively()
return result
}
@ -45,7 +45,7 @@ public class DownloadTest @Inject constructor(
Assert.assertTrue(file.exists())
}
} else {
warn("Couldn't delete directory, not running test \"shouldDownloadNoVersion\"")
warn("Couldn't delete directory, not running test \"shouldDownloadWithVersion\"")
}
}
@ -65,7 +65,7 @@ public class DownloadTest @Inject constructor(
val future = dep.jarFile
val file = future.get()
Assert.assertFalse(future is CompletedFuture)
Assert.assertEquals(file.name, jarFile)
Assert.assertNotNull(file)
Assert.assertTrue(file.exists())
} else {
warn("Couldn't delete directory, not running test \"shouldDownloadNoVersion\"")
@ -75,10 +75,9 @@ public class DownloadTest @Inject constructor(
@Test
public fun shouldDownloadRangedVersion() {
File(localRepo.toFullPath("javax/servlet/servlet-api")).deleteRecursively()
testRange("[2.5,)", "3.0-alpha-1")
}
val range = "[2.5,)"
val expected = "3.0-alpha-1"
private fun testRange(range: String, expected: String) {
val dep = depFactory.create("javax.servlet:servlet-api:${range}", executor)
val future = dep.jarFile
val file = future.get()
@ -103,8 +102,8 @@ public class DownloadTest @Inject constructor(
val dep = depFactory.create(idNoVersion, executor, localFirst = false)
val future = dep.jarFile
val file = future.get()
Assert.assertEquals(file.name, jarFile)
Assert.assertTrue(file.exists())
Assert.assertNotNull(file)
Assert.assertTrue(file.exists(), "Should find ${file}")
}
}