play.api.test

FakeApplication

case class FakeApplication (path: File, classloader: ClassLoader, additionalPlugins: Seq[String], withoutPlugins: Seq[String], additionalConfiguration: Map[String, String]) extends Application with Product with Serializable

A Fake application.

path

The application path

classloader

The application classloader

additionalPlugins

Additional plugins class names loaded by this application

withoutPlugins

Plugins class names to disable

additionalConfiguration

Additional configuration

Linear Supertypes
Serializable, Serializable, Product, Equals, Application, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. FakeApplication
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Application
  7. AnyRef
  8. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FakeApplication (path: File, classloader: ClassLoader, additionalPlugins: Seq[String], withoutPlugins: Seq[String], additionalConfiguration: Map[String, String])

    path

    The application path

    classloader

    The application classloader

    additionalPlugins

    Additional plugins class names loaded by this application

    withoutPlugins

    Plugins class names to disable

    additionalConfiguration

    Additional configuration

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. val additionalConfiguration : Map[String, String]

    Additional configuration

  7. val additionalPlugins : Seq[String]

    Additional plugins class names loaded by this application

  8. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  9. def canEqual (arg0: Any): Boolean

    Definition Classes
    FakeApplication → Equals
  10. val classloader : ClassLoader

    The application classloader

    The application classloader

    Definition Classes
    FakeApplicationApplication
  11. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def configuration : Configuration

    The configuration used by this application.

    The configuration used by this application.

    Definition Classes
    FakeApplicationApplication
    See also

    play.api.Configuration

  13. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  14. def equals (arg0: Any): Boolean

    Definition Classes
    FakeApplication → Equals → AnyRef → Any
  15. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  17. def getExistingFile (relativePath: String): Option[File]

    Retrieves a file relative to the application root path.

    Retrieves a file relative to the application root path. This method returns an Option[File], using None if the file was not found.

    For example, to retrieve a configuration file:

    val myConf = application.getExistingFile("conf/myConf.yml")
    
    relativePath

    the relative path of the file to fetch

    returns

    an existing file

    Definition Classes
    Application
  18. def getFile (relativePath: String): File

    Retrieves a file relative to the application root path.

    Retrieves a file relative to the application root path.

    For example, to retrieve a configuration file:

    val myConf = application.getFile("conf/myConf.yml")
    
    relativePath

    relative path of the file to fetch

    returns

    a file instance; it is not guaranteed that the file exists

    Definition Classes
    Application
  19. def getTypesAnnotatedWith [T <: Annotation] (packageName: String, annotation: Class[T]): Set[String]

    Scans the application classloader to retrieve all types annotated with a specific annotation.

    Scans the application classloader to retrieve all types annotated with a specific annotation.

    This method is useful for some plugins, for example the EBean plugin will automatically detect all types annotated with @javax.persistance.Entity, using:

    val entities = application.getTypesAnnotatedWith("models", classOf[javax.persistance.Entity])
    

    Note that it is better to specify a very specific package to avoid expensive searches.

    T

    the annotation type

    packageName

    the root package to scan

    annotation

    the annotation class

    returns

    a set of types names specifying the condition

    Definition Classes
    Application
  20. val global : GlobalSettings

    The global settings object used by this application.

    The global settings object used by this application.

    Definition Classes
    Application
    See also

    play.api.GlobalSettings

  21. def hashCode (): Int

    Definition Classes
    FakeApplication → AnyRef → Any
  22. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  23. val mode : Mode

    Definition Classes
    Application
  24. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  25. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  26. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  27. val path : File

    The application path

    The application path

    Definition Classes
    FakeApplicationApplication
  28. def plugin [T] (pluginClass: Class[T]): Option[T]

    Retrieves a plugin of type T.

    Retrieves a plugin of type T.

    For example, retrieving the DBPlugin instance:

    val dbPlugin = application.plugin(classOf[DBPlugin])
    
    T

    the plugin type

    pluginClass

    the plugin’s class

    returns

    the plugin instance, wrapped in an option, used by this application

    Definition Classes
    Application
  29. def plugin [T] (implicit m: Manifest[T]): Option[T]

    Retrieves a plugin of type T.

    Retrieves a plugin of type T.

    For example, to retrieve the DBPlugin instance:

    val dbPlugin = application.plugin[DBPlugin].map(_.api).getOrElse(sys.error("problem with the plugin"))
    
    T

    the plugin type

    returns

    The plugin instance used by this application.

    Definition Classes
    Application
  30. def pluginClasses : Seq[String]

    Definition Classes
    FakeApplicationApplication
  31. val plugins : Seq[Plugin]

    The plugins list used by this application.

    The plugins list used by this application.

    Plugin classes must extend play.api.Plugin and are automatically discovered by searching for all play.plugins files in the classpath.

    A play.plugins file contains a list of plugin classes to be loaded, and sorted by priority:

    100:play.api.i18n.MessagesPlugin
    200:play.api.db.DBPlugin
    250:play.api.cache.BasicCachePlugin
    300:play.db.ebean.EbeanPlugin
    400:play.db.jpa.JPAPlugin
    500:play.api.db.evolutions.EvolutionsPlugin
    1000:play.api.libs.akka.AkkaPlugin
    10000:play.api.GlobalPlugin
    
    Definition Classes
    Application
    See also

    play.api.Plugin

  32. def productArity : Int

    Definition Classes
    FakeApplication → Product
  33. def productElement (arg0: Int): Any

    Definition Classes
    FakeApplication → Product
  34. def productIterator : Iterator[Any]

    Definition Classes
    Product
  35. def productPrefix : String

    Definition Classes
    FakeApplication → Product
  36. def resource (name: String): Option[URL]

    Scans the application classloader to retrieve a resource.

    Scans the application classloader to retrieve a resource.

    For example, to retrieve a configuration file:

    val maybeConf = application.resource("conf/logger.xml")
    
    name

    the absolute name of the resource (from the classpath root)

    returns

    the resource URL, if found

    Definition Classes
    Application
  37. def resourceAsStream (name: String): Option[InputStream]

    Scans the application classloader to retrieve a resource’s contents as a stream.

    Scans the application classloader to retrieve a resource’s contents as a stream.

    For example, to retrieve a configuration file:

    val maybeConf = application.resourceAsStream("conf/logger.xml")
    
    name

    the absolute name of the resource (from the classpath root)

    returns

    a stream, if found

    Definition Classes
    Application
  38. val routes : Option[Routes]

    The router used by this application (if defined).

    The router used by this application (if defined).

    Definition Classes
    Application
  39. val sources : Option[SourceMapper]

    Definition Classes
    Application
  40. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  41. def toString (): String

    Definition Classes
    FakeApplication → AnyRef → Any
  42. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  43. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  44. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. val withoutPlugins : Seq[String]

    Plugins class names to disable

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Application

Inherited from AnyRef

Inherited from Any