In fact it's worse I think that'll work even if no exception is thrown in
case the future doesn't fail.
On Dec 27, 2013 4:49 PM, "Michael Mimeault" <notifications@github.com>
wrote:

> In
> commons-gearman/src/it/scala/com/wajam/gearman/TestWajamGearmanClient.scala:
>
> > +    f.onComplete {
> > +      case Success(v) => data should equal(v)
> > +      case Failure(e) => fail("Success data should return a success")
> > +    }
> > +    Await.ready(f, 2.seconds)
> > +  }
> > +
> > +  "Non working client" should "throw exception on first queuing/execute and then queue all others without executing them" in {
> > +    val data = Map("success" -> "success")
> > +
> > +    val f1 = notWorkingClient.executeJob(TEST_FUNCTION_NAME, data)
> > +    f1.onComplete {
> > +      case Success(v) => fail("Success data should return a failure")
> > +      case Failure(e) => evaluating {
> > +        throw e
> > +      } should produce[JobSubmissionException]
>
> The oncomplete produce nothing. so I cant wrap it. I know this is not the
> best code, I will try to find something better than that...
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/wajam/scala-commons/pull/29/files#r8573175>
> .
>