Skip to content

Instantly share code, notes, and snippets.

@ambantis
Created October 7, 2013 22:08
Show Gist options
  • Save ambantis/6875777 to your computer and use it in GitHub Desktop.
Save ambantis/6875777 to your computer and use it in GitHub Desktop.
A ScalaTest test suite for integration testing in Play! 2.2.0
import java.io.File
import play.api.{Mode, Play, DefaultApplication}
import org.scalatest.{SequentialNestedSuiteExecution, BeforeAndAfterAll, Suites}
import app.models.DbUserSpec
class IntegrationSuites extends Suites(new PlayConfigSpec, new DbUserSpec) with BeforeAndAfterAll
with SequentialNestedSuiteExecution with DbSetup {
implicit val app: DefaultApplication =
new DefaultApplication(new File("."), this.getClass.getClassLoader, None, Mode.Test)
override def beforeAll() {
Play.start(app)
play.api.Logger.shutdown()
depopulateTables()
populateTables()
}
override def afterAll() {
depopulateTables()
Play.stop()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment