Created
October 7, 2013 22:08
-
-
Save ambantis/6875777 to your computer and use it in GitHub Desktop.
A ScalaTest test suite for integration testing in Play! 2.2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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