unfiltered/unfiltered — Issue #106: unfiltered-scalatest can't execute two or more requests
Author: takezoe
Created: 2012-01-07 21:31:51+00:00
State: open

unfiltered-scalatest can't execute two or more requests in one testcase.

The first request is success, but the second request is blocked forever. I expect this is caused ```server.destroy()``` in at ```withFixture``` in Served.scala:
https://github.com/unfiltered/unfiltered/blob/a46729467690089f71bc3fb0c5ab774afa79ae8b/scalatest/src/main/scala/jetty/Served.scala#L12-19

I think if server is destroyed in ```withFixture```, it should be initialized at the beginning of ```withFixture``` as following.

```scala
override protected def withFixture(test: NoArgTest) {
import unfiltered.jetty._
val server = setup(Http(port)) // Initialize the server
server.start();
try {
test() // Invoke the test function
} finally {
server.stop();
server.destroy();
}
}
```