mirror of https://github.com/sbt/sbt.git
Improve error message further.
This commit is contained in:
parent
2c3f40eb02
commit
87306524a8
|
|
@ -15,12 +15,17 @@ object ConcurrentCache extends Properties("ClassLoaderCache concurrent access")
|
|||
else None
|
||||
}
|
||||
|
||||
private def showCp(cp: ClassLoader): String = cp match {
|
||||
case u: java.net.URLClassLoader => u.getURLs.mkString("UrlClassLoader(", ", ", ")")
|
||||
case _ => cp.toString
|
||||
}
|
||||
|
||||
property("Same class loader for same classpaths concurrently processed") = forAll { (names: List[String], concurrent: Int) =>
|
||||
withcp(names.distinct) { files =>
|
||||
val cache = new ClassLoaderCache(null)
|
||||
val loaders = (1 to concurrent).par.map(_ => cache(files)).toList
|
||||
loaders match {
|
||||
case DifferentClassloader(left, right) => false :| s"$left != $right"
|
||||
case DifferentClassloader(left, right) => false :| s"${showCp(left)} != ${showCp(right)}"
|
||||
case _ => true :| ""
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue