diff --git a/ivy/src/test/scala/EvictionWarningSpec.scala b/ivy/src/test/scala/EvictionWarningSpec.scala index cb55cbe36..80c65b211 100644 --- a/ivy/src/test/scala/EvictionWarningSpec.scala +++ b/ivy/src/test/scala/EvictionWarningSpec.scala @@ -31,8 +31,7 @@ class EvictionWarningSpec extends BaseIvySpecification { Including two (suspect) transitively binary incompatible Java libraries to direct dependencies should - be not detected as eviction $javaLibTransitiveWarn1 - be detected if it's enabled $javaLibTransitiveWarn2 + be detected as eviction $javaLibTransitiveWarn2 print out message about the eviction if it's enabled $javaLibTransitiveWarn3 Including two (suspect) binary incompatible Scala libraries to @@ -47,8 +46,7 @@ class EvictionWarningSpec extends BaseIvySpecification { Including two (suspect) transitively binary incompatible Scala libraries to direct dependencies should - be not detected as eviction $scalaLibTransitiveWarn1 - be detected if it's enabled $scalaLibTransitiveWarn2 + be detected as eviction $scalaLibTransitiveWarn2 print out message about the eviction if it's enabled $scalaLibTransitiveWarn3 """ @@ -87,7 +85,7 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaVersionWarn3 = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report, log).lines must_== + EvictionWarning(m, defaultOptions.withShowCallers(false), report, log).lines must_== List("Scala version was updated by one of library dependencies:", "\t* org.scala-lang:scala-library:2.10.2 -> 2.10.3", "To force scalaVersion, add the following:", @@ -98,7 +96,7 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaVersionWarn4 = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withShowCallers(true), report, log).lines must_== + EvictionWarning(m, defaultOptions, report, log).lines must_== List("Scala version was updated by one of library dependencies:", "\t* org.scala-lang:scala-library:2.10.2 -> 2.10.3 (caller: com.typesafe.akka:akka-actor_2.10:2.3.0, com.example:foo:0.1.0)", "To force scalaVersion, add the following:", @@ -114,7 +112,8 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaVersionWarn6 = { val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), report, log).scalaEvictions must have size (0) + EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), + report, log).scalaEvictions must have size (0) } def javaLibDirectDeps = Seq(commonsIo14, commonsIo24) @@ -128,7 +127,10 @@ class EvictionWarningSpec extends BaseIvySpecification { def javaLibWarn2 = { val m = module(defaultModuleId, javaLibDirectDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnDirectEvictions(false), report, log).reportedEvictions must have size (0) + EvictionWarning(m, defaultOptions + .withWarnDirectEvictions(false) + .withWarnTransitiveEvictions(false), + report, log).reportedEvictions must have size (0) } def javaLibWarn3 = { @@ -137,8 +139,7 @@ class EvictionWarningSpec extends BaseIvySpecification { EvictionWarning(m, defaultOptions, report, log).lines must_== List("There may be incompatibilities among your library dependencies.", "Here are some of the libraries that were evicted:", - "\t* commons-io:commons-io:1.4 -> 2.4", - "Run 'evicted' to see detailed eviction warnings") + "\t* commons-io:commons-io:1.4 -> 2.4 (caller: com.example:foo:0.1.0)") } def javaLibWarn4 = { @@ -166,22 +167,16 @@ class EvictionWarningSpec extends BaseIvySpecification { def javaLibTransitiveDeps = Seq(unfilteredUploads080, bnfparser10) - def javaLibTransitiveWarn1 = { - val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3")) - val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (0) - } - def javaLibTransitiveWarn2 = { val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true), report, log).reportedEvictions must have size (1) + EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (1) } def javaLibTransitiveWarn3 = { val m = module(defaultModuleId, javaLibTransitiveDeps, Some("2.10.3")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true).withShowCallers(true), report, log).lines must_== + EvictionWarning(m, defaultOptions, report, log).lines must_== List("There may be incompatibilities among your library dependencies.", "Here are some of the libraries that were evicted:", "\t* commons-io:commons-io:1.4 -> 2.4 (caller: ca.gobits.bnf:bnfparser:1.0, net.databinder:unfiltered-uploads_2.10:0.8.0)") @@ -201,8 +196,7 @@ class EvictionWarningSpec extends BaseIvySpecification { EvictionWarning(m, defaultOptions, report, log).lines must_== List("There may be incompatibilities among your library dependencies.", "Here are some of the libraries that were evicted:", - "\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4", - "Run 'evicted' to see detailed eviction warnings") + "\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4 (caller: com.example:foo:0.1.0)") } def scalaLibNoWarn1 = { @@ -221,22 +215,16 @@ class EvictionWarningSpec extends BaseIvySpecification { def scalaLibTransitiveDeps = Seq(scala2104, bananaSesame04, akkaRemote234) - def scalaLibTransitiveWarn1 = { - val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4")) - val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (0) - } - def scalaLibTransitiveWarn2 = { val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true), report, log).reportedEvictions must have size (1) + EvictionWarning(m, defaultOptions, report, log).reportedEvictions must have size (1) } def scalaLibTransitiveWarn3 = { val m = module(defaultModuleId, scalaLibTransitiveDeps, Some("2.10.4")) val report = ivyUpdate(m) - EvictionWarning(m, defaultOptions.withWarnTransitiveEvictions(true).withShowCallers(true), report, log).lines must_== + EvictionWarning(m, defaultOptions, report, log).lines must_== List("There may be incompatibilities among your library dependencies.", "Here are some of the libraries that were evicted:", "\t* com.typesafe.akka:akka-actor_2.10:2.1.4 -> 2.3.4 (caller: com.typesafe.akka:akka-remote_2.10:2.3.4, org.w3:banana-sesame_2.10:0.4, org.w3:banana-rdf_2.10:0.4)")