Comments (10)
Can you test out the milestone build:
https://groups.google.com/d/msg/play-framework/KLpcJGzqbbI/k9DENVgDBAAJ
"org.scalatestplus.play" %% "scalatestplus-play" % "2.0.0-M1" % Test
from scalatestplus-play.
Scalatest 3.0.0 is not compatible with Scalatestplus-play 1.5.x. The version that it's built against is "org.scalatest" %% "scalatest" % "2.2.6"
. The master snapshot "3.0.0-SNAPSHOT" is built against scalatest 3.0.0.
from scalatestplus-play.
Using scalatest version 3.0.0-M-15 seems to be the cause of the probem. Once I reverted to 2.2.6, the issue was resolved.
from scalatestplus-play.
Hi, is there a fix or workaround currently available for this issue ?
from scalatestplus-play.
Could you please submit a reproducible scenario here?
from scalatestplus-play.
I'm using scalatestplus-play 1.5.1 with play 2.5.x and scalatest/scalactic 3.0.0
I'm running the documentation example:
class SampleSpec extends PlaySpec with OneAppPerSuite {
// Override app if you need a Application with other than
// default parameters.
implicit override lazy val app = new GuiceApplicationBuilder().configure(Map("ehcacheplugin" -> "disabled")).build()
"The OneAppPerSuite trait" must {
"provide an Application" in {
app.configuration.getString("ehcacheplugin") mustBe Some("disabled")
}
"start the Application" in {
Play.maybeApplication mustBe Some(app)
}
}
}
For me, the ClassCastException is raised in a test class which uses should
matchers ("something" should {...
) instead of must. When using must
the following exception is thrown :
[info] models.dao.SampleSpec *** ABORTED ***
[info] java.lang.AbstractMethodError: models.dao.SampleSpec.convertToStringMustWrapper(Ljava/lang/String;Lorg/scalactic/source/Position;Lorg/scalactic/Prettifier;)Lorg/scalatest/MustMatchers$StringMustWrapper;
[info] at models.dao.SampleSpec.<init>(SampleSpec.scala:29)
[info] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[info] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[info] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[info] at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
[info] at java.lang.Class.newInstance(Class.java:442)
[info] at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:435)
[info] at sbt.ForkMain$Run$2.call(ForkMain.java:296)
[info] at sbt.ForkMain$Run$2.call(ForkMain.java:286)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
I guess scalatestplus-play 1.5.x doesn't support scalatest/scalactic 3.0.0. When switching to scalatest/scalactic 2.2.6 the test runs fine. So I don't know if there's an issue here. Just waiting for a scalatestplus-play version compatible with scalatest 3.0.0
from scalatestplus-play.
I have the same issue. I wanted to use ScalaTest 3.0.0
because of its async spec classes that would make a lot of my tests more idiomatic.
Class
class QuerySpec extends WordSpec with OneServerPerSuite with MustMatchers
Relevant SBT
libraryDependencies ++= Seq(
"org.scalatest" % "scalatest_2.11" % "3.0.0" % Test,
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test
)
Console Output
[info] org.pack.age.test.database.QuerySpec *** ABORTED ***
[info] java.lang.ClassCastException: scala.util.Success cannot be cast to java.lang.Boolean
[info] at scala.runtime.BoxesRunTime.unboxToBoolean(BoxesRunTime.java:85)
[info] at org.scalatestplus.play.OneServerPerSuite$$anonfun$run$1.apply(OneServerPerSuite.scala:182)
[info] at org.scalatest.CompositeStatus.whenCompleted(Status.scala:886)
[info] at org.scalatestplus.play.OneServerPerSuite$class.run(OneServerPerSuite.scala:182)
[info] at org.birdfeed.chirp.test.database.QuerySpec.run(QuerySpec.scala:14)
[info] at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:314)
[info] at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:472)
[info] at sbt.ForkMain$Run$2.call(ForkMain.java:296)
[info] at sbt.ForkMain$Run$2.call(ForkMain.java:286)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
from scalatestplus-play.
@wsargent Thanks for the prompt reply! I'm going to give this a shot and report back after I've ported over a few tests with some feedback.
from scalatestplus-play.
@wsargent it works perfectly and I have not to the best of my ability been able to break it (yet). I will try though.
Thank you!
from scalatestplus-play.
Closing since now we have a version compatible with Scalatest 3.0.x.
from scalatestplus-play.
Related Issues (20)
- Can't Use BeforeAndAfterAll Because Play is Stopped HOT 2
- Use GuiceOneAppPerSuite with async tests HOT 5
- Add link to http://www.scalatest.org/plus/play in description HOT 1
- Update documentation for unit testing controllers
- Success of before and after injection varies according to GuiceOneServerPerTest or GuiceOneServerPerSuite HOT 1
- 4.0.1 JAR on Maven Central has malformed META-INF/MANIFEST.M HOT 6
- Element.find to wrap WebElement.findElement
- [build] Travis uses sauce Labs limited to 5 concurrent jobs HOT 4
- Release for Scala 2.13.0-RC2 HOT 1
- Migrate formatter to scalafmt HOT 2
- Migrate formatter to scalafmt HOT 1
- deprecated WebBrowser is used HOT 2
- Doesn't seem like the JVM arguments make their way into the Application. HOT 1
- Revamp Travis build
- MiMa validation for the `2.13` artifact HOT 1
- ScalaTest 3.1.0 Support HOT 7
- Release for ScalaTest 3.1.x HOT 3
- Version 5.1.0 seem to miss MockitoSugar HOT 3
- MockitoSugar is no longer part of ScalaTest HOT 8
- Question about Sonatype permissions / groupId HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalatestplus-play.