scalatest / scalatest

A testing tool for Scala and Java developers
Apache License 2.0
1.15k stars 336 forks source link

Classloading issue in 3.2.0-SNAP10 on JDK10 #1415

Open pshirshov opened 6 years ago

pshirshov commented 6 years ago

To reproduce run any scalacheck test. 3.2.0-SNAP9 works fine.

[error] java.lang.NoClassDefFoundError: org/scalacheck/Test
[error]     at java.base/java.lang.Class.getDeclaringClass0(Native Method)
[error]     at java.base/java.lang.Class.getEnclosingClass(Class.java:1494)
[error]     at scala.reflect.runtime.ReflectionUtils$EnclosedInClass$$anonfun$$lessinit$greater$3.apply(ReflectionUtils.scala:93)
[error]     at scala.reflect.runtime.ReflectionUtils$EnclosedInClass$$anonfun$$lessinit$greater$3.apply(ReflectionUtils.scala:93)
[error]     at scala.reflect.runtime.ReflectionUtils$EnclosedIn.unapply(ReflectionUtils.scala:88)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.sOwner(JavaMirrors.scala:855)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.classToScala1(JavaMirrors.scala:993)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$classToScala$1(JavaMirrors.scala:986)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$toScala$1(JavaMirrors.scala:98)
[error]     at scala.reflect.runtime.TwoWayCaches$TwoWayCache.$anonfun$toScala$1(TwoWayCaches.scala:38)
[error]     at scala.reflect.runtime.TwoWayCaches$TwoWayCache.toScala(TwoWayCaches.scala:34)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.toScala(JavaMirrors.scala:96)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.classToScala(JavaMirrors.scala:986)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.typeToScala(JavaMirrors.scala:1091)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.jfieldAsScala1(JavaMirrors.scala:1137)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$jfieldAsScala$1(JavaMirrors.scala:1132)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.$anonfun$toScala$1(JavaMirrors.scala:98)
[error]     at scala.reflect.runtime.TwoWayCaches$TwoWayCache.$anonfun$toScala$1(TwoWayCaches.scala:38)
[error]     at scala.reflect.runtime.TwoWayCaches$TwoWayCache.toScala(TwoWayCaches.scala:34)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.toScala(JavaMirrors.scala:96)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.scala$reflect$runtime$JavaMirrors$JavaMirror$$jfieldAsScala(JavaMirrors.scala:1132)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.$anonfun$completeRest$5(JavaMirrors.scala:787)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.$anonfun$completeRest$4(JavaMirrors.scala:787)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.$anonfun$completeRest$1(JavaMirrors.scala:797)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.completeRest(JavaMirrors.scala:755)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror$FromJavaClassCompleter.complete(JavaMirrors.scala:751)
[error]     at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1535)
[error]     at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol$$anon$9.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$info(SynchronizedSymbols.scala:191)
[error]     at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.$anonfun$info$1(SynchronizedSymbols.scala:129)
[error]     at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.info(SynchronizedSymbols.scala:125)
[error]     at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol.info$(SynchronizedSymbols.scala:129)
[error]     at scala.reflect.runtime.SynchronizedSymbols$SynchronizedSymbol$$anon$9.info(SynchronizedSymbols.scala:191)
[error]     at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1683)
[error]     at scala.reflect.internal.Symbols$Symbol.hasFlag(Symbols.scala:742)
[error]     at scala.reflect.internal.Symbols$Symbol.hasFlag(Symbols.scala:745)
[error]     at scala.reflect.internal.Symbols$Symbol.isStatic(Symbols.scala:999)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.reflectModule(JavaMirrors.scala:189)
[error]     at scala.reflect.runtime.JavaMirrors$JavaMirror.reflectModule(JavaMirrors.scala:55)
[error]     at org.scalatest.tools.Framework.runner(Framework.scala:1021)
[error]     at sbt.Defaults$.$anonfun$createTestRunners$1(Defaults.scala:939)
[error]     at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error]     at scala.collection.immutable.Map$Map1.foreach(Map.scala:125)
[error]     at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error]     at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error]     at scala.collection.AbstractTraversable.map(Traversable.scala:104)
[error]     at sbt.Defaults$.createTestRunners(Defaults.scala:933)
[error]     at sbt.Defaults$.allTestGroupsTask(Defaults.scala:995)
[error]     at sbt.Defaults$.$anonfun$testTasks$10(Defaults.scala:751)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:278)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error]     at java.base/java.lang.Thread.run(Thread.java:844)
erikvanoosten commented 5 years ago

Same on JDK8.

Class org.scalatest.prop.Configuration imports org.scalacheck.Test.TestCallback. Configuration is used from org.scalatest.tools.Runner:919. This will of course fail when Scalacheck is not on the classpath.

Expected behavior: Scalacheck is not a required dependency.