Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4a1be1b
Showing
17 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
logs | ||
target | ||
/.idea | ||
/.idea_modules | ||
/.classpath | ||
/.project | ||
/.settings | ||
/RUNNING_PID |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This software is licensed under the Apache 2 license, quoted below. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with | ||
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific | ||
language governing permissions and limitations under the License. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This is your new Play application | ||
================================= | ||
|
||
This file will be packaged with your application, when using `activator dist`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package controllers | ||
|
||
import play.api._ | ||
import play.api.mvc._ | ||
|
||
class Application extends Controller { | ||
|
||
def index = Action { | ||
Ok(views.html.index("Your new application is ready.")) | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@(message: String) | ||
|
||
@main("Welcome to Play") { | ||
|
||
@play20.welcome(message) | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@(title: String)(content: Html) | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en"> | ||
<head> | ||
<title>@title</title> | ||
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/main.css")"> | ||
<link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png")"> | ||
<script src="@routes.Assets.versioned("javascripts/hello.js")" type="text/javascript"></script> | ||
</head> | ||
<body> | ||
@content | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name := """slick3play""" | ||
|
||
version := "1.0-SNAPSHOT" | ||
|
||
lazy val root = (project in file(".")).enablePlugins(PlayScala) | ||
|
||
scalaVersion := "2.11.6" | ||
|
||
libraryDependencies ++= Seq( | ||
jdbc, | ||
cache, | ||
ws, | ||
specs2 % Test | ||
) | ||
|
||
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases" | ||
|
||
// Play provides two styles of routers, one expects its actions to be injected, the | ||
// other, legacy style, accesses its actions statically. | ||
routesGenerator := InjectedRoutesGenerator |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This is the main configuration file for the application. | ||
# ~~~~~ | ||
|
||
# Secret key | ||
# ~~~~~ | ||
# The secret key is used to secure cryptographics functions. | ||
# | ||
# This must be changed for production, but we recommend not changing it in this file. | ||
# | ||
# See http://www.playframework.com/documentation/latest/ApplicationSecret for more details. | ||
play.crypto.secret = "changeme" | ||
|
||
# The application languages | ||
# ~~~~~ | ||
play.i18n.langs = [ "en" ] | ||
|
||
# Router | ||
# ~~~~~ | ||
# Define the Router object to use for this application. | ||
# This router will be looked up first when the application is starting up, | ||
# so make sure this is the entry point. | ||
# Furthermore, it's assumed your route file is named properly. | ||
# So for an application router like `my.application.Router`, | ||
# you may need to define a router file `conf/my.application.routes`. | ||
# Default to Routes in the root package (and conf/routes) | ||
# play.http.router = my.application.Routes | ||
|
||
# Database configuration | ||
# ~~~~~ | ||
# You can declare as many datasources as you want. | ||
# By convention, the default datasource is named `default` | ||
# | ||
# db.default.driver=org.h2.Driver | ||
# db.default.url="jdbc:h2:mem:play" | ||
# db.default.username=sa | ||
# db.default.password="" | ||
|
||
# Evolutions | ||
# ~~~~~ | ||
# You can disable evolutions if needed | ||
# play.evolutions.enabled=false | ||
|
||
# You can disable evolutions for a specific datasource if necessary | ||
# play.evolutions.db.default.enabled=false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<configuration> | ||
|
||
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" /> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%coloredLevel - %logger - %message%n%xException</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!-- | ||
The logger name is typically the Java/Scala package name. | ||
This configures the log level to log at for a package and its children packages. | ||
--> | ||
<logger name="play" level="INFO" /> | ||
<logger name="application" level="DEBUG" /> | ||
|
||
<root level="ERROR"> | ||
<appender-ref ref="STDOUT" /> | ||
</root> | ||
|
||
</configuration> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Routes | ||
# This file defines all application routes (Higher priority routes first) | ||
# ~~~~ | ||
|
||
# Home page | ||
GET / controllers.Application.index | ||
|
||
# Map static resources from the /public folder to the /assets URL path | ||
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#Activator-generated Properties | ||
#Wed Nov 04 23:11:57 WET 2015 | ||
template.uuid=fce2d244-c545-409f-806e-7a0c3681b306 | ||
sbt.version=0.13.8 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// The Play plugin | ||
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.3") | ||
|
||
// web plugins | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0") |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (window.console) { | ||
console.log("Welcome to your Play application's JavaScript!"); | ||
} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import org.specs2.mutable._ | ||
import org.specs2.runner._ | ||
import org.junit.runner._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
|
||
/** | ||
* Add your spec here. | ||
* You can mock out a whole application including requests, plugins etc. | ||
* For more information, consult the wiki. | ||
*/ | ||
@RunWith(classOf[JUnitRunner]) | ||
class ApplicationSpec extends Specification { | ||
|
||
"Application" should { | ||
|
||
"send 404 on a bad request" in new WithApplication{ | ||
route(FakeRequest(GET, "/boum")) must beSome.which (status(_) == NOT_FOUND) | ||
} | ||
|
||
"render the index page" in new WithApplication{ | ||
val home = route(FakeRequest(GET, "/")).get | ||
|
||
status(home) must equalTo(OK) | ||
contentType(home) must beSome.which(_ == "text/html") | ||
contentAsString(home) must contain ("Your new application is ready.") | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import org.specs2.mutable._ | ||
import org.specs2.runner._ | ||
import org.junit.runner._ | ||
|
||
import play.api.test._ | ||
import play.api.test.Helpers._ | ||
|
||
/** | ||
* add your integration spec here. | ||
* An integration test will fire up a whole play application in a real (or headless) browser | ||
*/ | ||
@RunWith(classOf[JUnitRunner]) | ||
class IntegrationSpec extends Specification { | ||
|
||
"Application" should { | ||
|
||
"work from within a browser" in new WithBrowser { | ||
|
||
browser.goTo("http://localhost:" + port) | ||
|
||
browser.pageSource must contain("Your new application is ready.") | ||
} | ||
} | ||
} |