Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (C) 2009-2015 Typesafe Inc. <>
 package play.test;
 import org.junit.After;
Provides an application for JUnit tests. Make your test class extend this class and an application will be started before each test is invoked. You can setup the application to use by overriding the provideApplication method. Within a test, the running application is available through the app field.
public class WithApplication {
    protected Application app;

Override this method to setup the application to use. By default this will call the old provideFakeApplication method.

The application to use
    protected Application provideApplication() {
        return provideFakeApplication();

Old method - use the new provideApplication method instead. Override this method to setup the fake application to use.

The fake application to use
    protected FakeApplication provideFakeApplication() {
        return Helpers.fakeApplication();
    public void startPlay() {
         = provideApplication();
    public void stopPlay() {
        if ( != null) {
             = null;
New to GrepCode? Check out our FAQ X