Git Product home page Git Product logo

reactive-web-applications's Introduction

reactive-web-applications's People

Contributors

manuelbernhardt avatar vkuptcov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reactive-web-applications's Issues

chapter 5 - Testing futures

For the testing futures with specs2, if one is using play2.4 and also specs3.5, in order to be able to use the await method when testing futures, one should import the specs2 execution environment and add that to each block implicitly:

import org.specs2.matcher.Matchers
import org.specs2.mutable.Specification
import org.specs2.time.NoTimeConversions
import scala.concurrent.duration._

import org.specs2.concurrent.ExecutionEnv

class AuthenticationServiceSpec extends Specification with Matchers with NoTimeConversions {

  "The AuthenticationService" should {

    val service: AuthenticationService = new DummyAuthenticationService

    "correctly authenticate Bob Marley" in { implicit ee: ExecutionEnv =>
      service.authenticateUser("[email protected]", "secret") must beEqualTo (AuthenticationSuccessful).await(1, 200.millis)
    }

    "not authenticate Ziggy Marley" in { implicit ee: ExecutionEnv =>
      service.authenticateUser("[email protected]", "secret") must beEqualTo (AuthenticationUnsuccessful).await(1, 500.millis)
    }

    "fail if it takes too long" in { implicit ee: ExecutionEnv =>
      service.authenticateUser("[email protected]", "secret") must throwA[RuntimeException].await(1, 700.millis)
    }
  }
}

Ch10 pt 10.1.2 Add selenium-firefox-driver to build.sbt

To get the test to run, I needed to add the following dependency into build.sbt

"org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.53.0"

without this line, or with an outdated firefox-driver-specification e.g 2.46.0, selenium complains that:
Was unable to create a Selenium FirefoxDriver on this platform. (OneBrowserPerSuite.scala:333)

(It seems that Selenium drivers are quite picky about which browser-versions they are compatible with. So for example on Ubuntu, with Firefox 45.0.1, using the latest selenium-driver-version (as recommended - currently 2.53.0 as of 14.04.2016) is the solution here. With browsers like Firefox having a quick release cycle, and users generally accepting the updates, then the 2.53.0 will at some point cause brokenness, and so on).

So anyway the libraryDependencies I used in build.sbt to get the test to work are now defined as:

libraryDependencies ++= Seq(
  "org.webjars" %% "webjars-play" % "2.4.0-1",
  "org.webjars" % "jquery" % "2.1.4",
  "org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.53.0",
  "org.scalatest" %% "scalatest" % "2.2.1" % "test",
  "org.scalatestplus" %% "play" % "1.4.0-M4" % "test"
)

Can put this as a PR (if you prefer).

Anyway and slightly off-topic, really an excellent book, this "Reactive Web Applications", been learning a lot going through the MEAP-version chapters - thanks Manuel!

I can't compile CH04.

Hi, I just started learning how to use Play and found this book. I hope you are still maintaining the codes.
It is not compiled while nothing has been changed. Could you tell me how to fix this?

Screenshot 2023-04-11 at 11 50 23 PM

Wrong Type in listings/CH08.md

Hi!

Listing 8.2 in listing/CH08 is different from CH08/build.sbt

scalajsProjects := Seq(client),

causes a type error. Probably should be

scalaJSProjects := Seq(client),

support play 2.4

do u plan to change all the codes into 2.4 before final release?

CH02 compile error

Here is the error:

Information:3/6/17, 4:00 PM - Compilation completed with 1 error and 0 warnings in 2s 183ms
/Users/kaiyin/scalaProjects/reactive-web-applications/CH02/app/controllers/Application.scala
Error:(11, 19) object index is not a member of package views.html
    Ok(views.html.index("Tweets"))

Also, when importing sbt project into intellij, I got the following warinings:

4:02 PM	SBT project import
				[warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
				[warn]  * org.apache.httpcomponents:httpclient:(4.0.1, 4.3.4)
				[warn]  * com.google.guava:guava:(18.0, 16.0.1)
				[warn]  * org.apache.httpcomponents:httpcore:(4.0.1, 4.3.2)
				[warn]  * commons-logging:commons-logging:(1.1.1, 1.1.3)
				[warn]  * org.scala-lang.modules:scala-parser-combinators_2.11:(1.0.1, 1.0.2, 1.0.3)
				[warn]  * org.scala-lang.modules:scala-xml_2.11:(1.0.1, 1.0.2, 1.0.3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.