Browse Source

Cleanup play2 folders

Hamilton Turner 11 years ago
parent
commit
bf7fca4ab4
51 changed files with 0 additions and 1109 deletions
  1. 0 60
      frameworks/Java/play2-java/benchmark_config
  2. 0 33
      frameworks/Java/play2-java/play2-scala-anorm/.gitignore
  3. 0 20
      frameworks/Java/play2-java/play2-scala-anorm/README.md
  4. 0 106
      frameworks/Java/play2-java/play2-scala-anorm/app/controllers/Application.scala
  5. 0 25
      frameworks/Java/play2-java/play2-scala-anorm/app/models/Fortune.scala
  6. 0 55
      frameworks/Java/play2-java/play2-scala-anorm/app/models/World.scala
  7. 0 20
      frameworks/Java/play2-java/play2-scala-anorm/app/utils/PredicatedAction.scala
  8. 0 18
      frameworks/Java/play2-java/play2-scala-anorm/app/views/fortune.scala.html
  9. 0 12
      frameworks/Java/play2-java/play2-scala-anorm/app/views/main.scala.html
  10. 0 9
      frameworks/Java/play2-java/play2-scala-anorm/build.sbt
  11. 0 66
      frameworks/Java/play2-java/play2-scala-anorm/conf/application.conf
  12. 0 12
      frameworks/Java/play2-java/play2-scala-anorm/conf/routes
  13. 0 1
      frameworks/Java/play2-java/play2-scala-anorm/project/build.properties
  14. 0 8
      frameworks/Java/play2-java/play2-scala-anorm/project/plugins.sbt
  15. 0 11
      frameworks/Java/play2-java/play2-scala-anorm/source_code
  16. 0 33
      frameworks/Java/play2-java/play2-scala/.gitignore
  17. 0 18
      frameworks/Java/play2-java/play2-scala/README.md
  18. 0 12
      frameworks/Java/play2-java/play2-scala/app/controllers/Application.scala
  19. 0 5
      frameworks/Java/play2-java/play2-scala/build.sbt
  20. 0 31
      frameworks/Java/play2-java/play2-scala/conf/application.conf
  21. 0 9
      frameworks/Java/play2-java/play2-scala/conf/routes
  22. 0 1
      frameworks/Java/play2-java/play2-scala/project/build.properties
  23. 0 8
      frameworks/Java/play2-java/play2-scala/project/plugins.sbt
  24. 0 11
      frameworks/Java/play2-java/play2-scala/source_code
  25. 0 6
      frameworks/Java/play2-java/setup_scala.py
  26. 0 6
      frameworks/Java/play2-java/setup_scala_anorm.py
  27. 0 37
      frameworks/Scala/play2-scala/benchmark_config
  28. 0 30
      frameworks/Scala/play2-scala/play2-java-ebean/.gitignore
  29. 0 20
      frameworks/Scala/play2-scala/play2-java-ebean/README.md
  30. 0 97
      frameworks/Scala/play2-scala/play2-java-ebean/app/controllers/Application.java
  31. 0 20
      frameworks/Scala/play2-scala/play2-java-ebean/app/models/World.java
  32. 0 8
      frameworks/Scala/play2-scala/play2-java-ebean/app/utils/Predicate.java
  33. 0 26
      frameworks/Scala/play2-scala/play2-java-ebean/app/utils/Predicated.java
  34. 0 23
      frameworks/Scala/play2-scala/play2-java-ebean/app/utils/PredicatedAction.java
  35. 0 13
      frameworks/Scala/play2-scala/play2-java-ebean/build.sbt
  36. 0 74
      frameworks/Scala/play2-scala/play2-java-ebean/conf/application.conf
  37. 0 10
      frameworks/Scala/play2-scala/play2-java-ebean/conf/routes
  38. 0 1
      frameworks/Scala/play2-scala/play2-java-ebean/project/build.properties
  39. 0 8
      frameworks/Scala/play2-scala/play2-java-ebean/project/plugins.sbt
  40. 0 9
      frameworks/Scala/play2-scala/play2-java-ebean/source_code
  41. 0 30
      frameworks/Scala/play2-scala/play2-java/.gitignore
  42. 0 18
      frameworks/Scala/play2-scala/play2-java/README.md
  43. 0 19
      frameworks/Scala/play2-scala/play2-java/app/controllers/Application.java
  44. 0 5
      frameworks/Scala/play2-scala/play2-java/build.sbt
  45. 0 26
      frameworks/Scala/play2-scala/play2-java/conf/application.conf
  46. 0 9
      frameworks/Scala/play2-scala/play2-java/conf/routes
  47. 0 1
      frameworks/Scala/play2-scala/play2-java/project/build.properties
  48. 0 8
      frameworks/Scala/play2-scala/play2-java/project/plugins.sbt
  49. 0 9
      frameworks/Scala/play2-scala/play2-java/source_code
  50. 0 6
      frameworks/Scala/play2-scala/setup_java.py
  51. 0 6
      frameworks/Scala/play2-scala/setup_java_ebean.py

+ 0 - 60
frameworks/Java/play2-java/benchmark_config

@@ -20,24 +20,6 @@
         "port": "9000", 
         "port": "9000", 
         "json_url": "/json"
         "json_url": "/json"
       }, 
       }, 
-      "scala": {
-        "display_name": "play2-scala", 
-        "setup_file": "setup_scala", 
-        "framework": "play2", 
-        "language": "Scala", 
-        "orm": "Raw", 
-        "os": "Linux", 
-        "database": "None", 
-        "approach": "Realistic", 
-        "classification": "Fullstack", 
-        "platform": "Netty", 
-        "webserver": "None", 
-        "database_os": "Linux", 
-        "notes": "", 
-        "versus": "netty", 
-        "port": "9000", 
-        "json_url": "/json"
-      }, 
       "java-ebean": {
       "java-ebean": {
         "display_name": "play2-java-ebean", 
         "display_name": "play2-java-ebean", 
         "setup_file": "setup_java_ebean", 
         "setup_file": "setup_java_ebean", 
@@ -56,48 +38,6 @@
         "port": "9000", 
         "port": "9000", 
         "db_url": "/db", 
         "db_url": "/db", 
         "query_url": "/queries?queries="
         "query_url": "/queries?queries="
-      }, 
-      "scala-anorm-linux": {
-        "display_name": "play2-scala-anorm-linux", 
-        "setup_file": "setup_scala_anorm", 
-        "framework": "play2", 
-        "language": "Scala", 
-        "orm": "Anorm", 
-        "os": "Linux", 
-        "database": "MySQL", 
-        "approach": "Realistic", 
-        "classification": "Fullstack", 
-        "platform": "Netty", 
-        "webserver": "None", 
-        "database_os": "Linux", 
-        "notes": "", 
-        "versus": "netty", 
-        "port": "9000", 
-        "db_url": "/db", 
-        "query_url": "/queries?queries=", 
-        "fortune_url": "/fortunes", 
-        "update_url": "/update?queries="
-      }, 
-      "scala-anorm-windows": {
-        "display_name": "play2-scala-anorm-windows", 
-        "setup_file": "setup_scala_anorm", 
-        "framework": "play2", 
-        "language": "Scala", 
-        "orm": "Anorm", 
-        "os": "Windows", 
-        "database": "MySQL", 
-        "approach": "Realistic", 
-        "classification": "Fullstack", 
-        "platform": "Netty", 
-        "webserver": "None", 
-        "database_os": "Linux", 
-        "notes": "", 
-        "versus": "netty", 
-        "port": "9000", 
-        "db_url": "/db", 
-        "query_url": "/queries?queries=", 
-        "fortune_url": "/fortunes", 
-        "update_url": "/update?queries="
       }
       }
     }
     }
   ]
   ]

+ 0 - 33
frameworks/Java/play2-java/play2-scala-anorm/.gitignore

@@ -1,33 +0,0 @@
-logs
-project/project
-project/target
-public
-target
-test
-tmp
-.history
-dist
-conf/evolutions
-
-# Ignore all dotfiles...
-.*
-# except for .gitignore
-!.gitignore
-
-# Ignore Play! working directory #
-db
-eclipse
-lib
-log
-logs
-modules
-precompiled
-project/project
-project/target
-target
-tmp
-test-result
-server.pid
-*.iml
-*.eml
-

+ 0 - 20
frameworks/Java/play2-java/play2-scala-anorm/README.md

@@ -1,20 +0,0 @@
-#Play Benchmarking Test
-
-This is the Play portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
-
-### Data-Store/Database Mapping Test
-
-* [Database test controller](app/controllers/Application.scala)
-* [Database test model](app/models/World.scala)
-
-## Infrastructure Software Versions
-The tests were run with:
-
-* [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
-* [Play 2](http://http://www.playframework.com/)
-
-## Test URLs
-
-### Data-Store/Database Mapping Test
-
-http://localhost/db?queries=5

+ 0 - 106
frameworks/Java/play2-java/play2-scala-anorm/app/controllers/Application.scala

@@ -1,106 +0,0 @@
-package controllers
-
-import play.api.Play.current
-import play.api.db.DB
-import play.api.mvc._
-import play.api.libs.json.Json
-import java.util.concurrent._
-import scala.concurrent._
-import models.{World, Fortune}
-import utils._
-import scala.concurrent.Future
-
-import play.api.libs.concurrent.Execution.Implicits._
-import play.core.NamedThreadFactory
-
-object Application extends Controller {
-
-  private val TestDatabaseRows = 10000
-
-  private val partitionCount = current.configuration.getInt("db.default.partitionCount").getOrElse(2)
-  private val maxConnections =
-    partitionCount * current.configuration.getInt("db.default.maxConnectionsPerPartition").getOrElse(5)
-  private val minConnections =
-    partitionCount * current.configuration.getInt("db.default.minConnectionsPerPartition").getOrElse(5)
-
-  private val tpe = new ThreadPoolExecutor(minConnections, maxConnections,
-    0L, TimeUnit.MILLISECONDS,
-    new LinkedBlockingQueue[Runnable](),
-    new NamedThreadFactory("dbEc"))
-  private val dbEc = ExecutionContext.fromExecutorService(tpe)
-
-  // If the thread-pool used by the database grows too large then our server
-  // is probably struggling, and we should start dropping requests. Set
-  // the max size of our queue something above the number of concurrent
-  // connections that we need to handle.
-  def isDbQueueTooBig: Boolean = tpe.getQueue.size() <= 1024
-
-  def db = PredicatedAction(isDbQueueTooBig, ServiceUnavailable) {
-    Action.async {
-      getRandomWorlds(1).map { worlds =>
-        Ok(Json.toJson(worlds.head))
-      }
-    }
-  }
-
-  def queries(countString: String) = PredicatedAction(isDbQueueTooBig, ServiceUnavailable) {
-    Action.async {
-      val n = parseCount(countString)
-      getRandomWorlds(n).map { worlds =>
-        Ok(Json.toJson(worlds))
-      }
-    }
-  }
-
-  private def parseCount(s: String): Int = {
-    try {
-      val parsed = java.lang.Integer.parseInt(s, 10)
-      parsed match {
-        case i if i < 1 => 1
-        case i if i > 500 => 500
-        case i => i
-      }
-    } catch {
-      case _: NumberFormatException => 1
-    }
-  }
-
-  private def getRandomWorlds(n: Int): Future[Seq[World]] = Future {
-    val random = ThreadLocalRandom.current()
-    DB.withConnection { implicit connection =>
-      for (_ <- 1 to n) yield {
-        val randomId: Long = random.nextInt(TestDatabaseRows) + 1
-        World.findById(randomId)
-      }
-    }
-  }(dbEc)
-
-  def fortunes() = PredicatedAction(isDbQueueTooBig, ServiceUnavailable) {
-    Action.async {
-      Future {
-        val fortunes = Fortune.getAll()
-        val extendedFortunes = Fortune(0.toLong, "Additional fortune added at request time.") +: fortunes
-        Ok(views.html.fortune(extendedFortunes))
-      }
-    }
-  }
-
-  def update(countString: String) = PredicatedAction(isDbQueueTooBig, ServiceUnavailable) {
-    Action.async {
-      val n = parseCount(countString)
-      Future {
-        val random = ThreadLocalRandom.current()
-        val worlds = DB.withConnection { implicit connection =>
-          for(_ <- 1 to n) yield {
-            val randomId: Long = random.nextInt(TestDatabaseRows) + 1
-            val world = World.findById(random.nextInt(TestDatabaseRows) + 1)
-            val updatedWorld = world.copy(randomNumber = random.nextInt(10000) + 1)
-            World.updateRandom(updatedWorld)
-            updatedWorld
-          }
-        }
-        Ok(Json.toJson(worlds)).withHeaders("Server" -> "Netty")
-      }(dbEc)
-    }
-  }
-}

+ 0 - 25
frameworks/Java/play2-java/play2-scala-anorm/app/models/Fortune.scala

@@ -1,25 +0,0 @@
-package models
-
-import play.api.db._
-import play.api.Play.current
-import anorm._
-import anorm.SqlParser._
-import scala.language.postfixOps
-
-case class Fortune(id: Long, message: String)
-
-object Fortune {
-
-  val simpleRowParser = {
-    get[Long]("fortune.id") ~
-    get[String]("fortune.message") map {
-      case id~message => Fortune(id, message)
-    }
-  }
-
-  def getAll(): List[Fortune] = {
-    DB.withConnection { implicit connection =>
-      SQL("SELECT * FROM Fortune").as(Fortune.simpleRowParser *)
-    }
-  }
-}

+ 0 - 55
frameworks/Java/play2-java/play2-scala-anorm/app/models/World.scala

@@ -1,55 +0,0 @@
-package models
-
-import anorm._
-import anorm.SqlParser._
-import java.sql.Connection
-import play.api.db._
-import play.api.libs.functional.syntax._
-import play.api.libs.json._
-import play.api.Play.current
-
-case class World(id: Pk[Long], randomNumber: Long)
-
-object World {
-    /**
-    * Convert a World to Json object
-    */
-  implicit val toJson = new Writes[World] {
-    def writes(w: World): JsValue = {
-      Json.obj(
-        "id" -> w.id.get,
-        "randomNumber" -> w.randomNumber
-      )
-    }
-  }
-
-  /**
-   * Parse a World from a ResultSet
-   */
-  val simpleRowParser = {
-    get[Pk[Long]]("world.id") ~
-    get[Long]("world.randomNumber") map {
-      case id~randomNumber => World(id, randomNumber)
-    }
-  }
-
-  /**
-   * Retrieve a World by id.
-   */
-  def findById(id: Long)(implicit connection: Connection): World = {
-    DB.withConnection { implicit connection =>
-      SQL("SELECT * FROM World WHERE id = {id}").on(
-          "id" -> id
-      ).as(World.simpleRowParser.single)
-    }
-  }
-
-  def updateRandom(world: World)(implicit connection: Connection) {
-    DB.withConnection { implicit connection =>
-      SQL("UPDATE World SET randomNumber = {randomNumber} WHERE id = {id}").on(
-        "id" -> world.id.get,
-        "randomNumber" -> world.randomNumber
-      ).executeUpdate()
-    }
-  }
-}

+ 0 - 20
frameworks/Java/play2-java/play2-scala-anorm/app/utils/PredicatedAction.scala

@@ -1,20 +0,0 @@
-package utils
-
-import play.api.mvc._
-import scala.concurrent.{Promise, Future}
-
-/**
- * A predicated action is one where a condition must be satisfied in order to proceed with the request. If the
- * condition is not satisfied then a supplied status result is yielded.
- */
-class PredicatedActionBuilder {
-  def apply[A](p: => Boolean, failed: => SimpleResult)(action: Action[A]): Action[A] = new Action[A] {
-    def apply(request: Request[A]): Future[SimpleResult] = {
-      if (p) action(request) else Promise.successful(failed).future
-    }
-
-    lazy val parser = action.parser
-  }
-}
-
-object PredicatedAction extends PredicatedActionBuilder

+ 0 - 18
frameworks/Java/play2-java/play2-scala-anorm/app/views/fortune.scala.html

@@ -1,18 +0,0 @@
-@(fortunes: List[Fortune])
-
-@main("Fortunes") {
-    <table>
-        <tr>
-            <th>id</th>
-            <th>message</th>
-        </tr>
-
-        @fortunes.sortBy(_.message).map { case Fortune(id, message) =>
-            <tr>
-                <td>@id</td>
-                <td>@message</td>
-            </tr>
-        }
-
-    </table>
-}

+ 0 - 12
frameworks/Java/play2-java/play2-scala-anorm/app/views/main.scala.html

@@ -1,12 +0,0 @@
-@(title: String)(content: Html)
-
-<!DOCTYPE html>
-
-<html>
-<head>
-    <title>@title</title>
-</head>
-<body>
-    @content
-</body>
-</html>

+ 0 - 9
frameworks/Java/play2-java/play2-scala-anorm/build.sbt

@@ -1,9 +0,0 @@
-name := "play2-scala-anorm"
-
-version := "1.0-SNAPSHOT"
-
-libraryDependencies ++= Seq(jdbc, anorm, "mysql" % "mysql-connector-java" % "5.1.22")
-
-dependencyOverrides += "com.jolbox" % "bonecp" % "0.7.1.RELEASE"
-
-playScalaSettings

+ 0 - 66
frameworks/Java/play2-java/play2-scala-anorm/conf/application.conf

@@ -1,66 +0,0 @@
-# This is the main configuration file for the application.
-# ~~~~~
-
-# Secret key
-# ~~~~~
-# The secret key is used to secure cryptographics functions.
-# If you deploy your application to several instances be sure to use the same key!
-application.secret="RItx1I:80?W@]8GAtPDuF8Ydd3mXM85p/<7og]Q;uBOdijQAauRDgu73B6`wQP59"
-
-# The application languages
-# ~~~~~
-application.langs="en"
-
-# Global object class
-# ~~~~~
-# Define the Global object class for this application.
-# Default to Global in the root package.
-# global=Global
-
-# 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.user=sa
-# db.default.password=
-#
-# You can expose this datasource via JNDI if needed (Useful for JPA)
-# db.default.jndiName=DefaultDS
-db.default.driver= com.mysql.jdbc.Driver
-db.default.url="jdbc:mysql://!!DATABASE_HOST!!:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
-db.default.user=benchmarkdbuser
-db.default.password=benchmarkdbpass
-db.default.jndiName=DefaultDS
-
-db.default.partitionCount=4
-
-# The number of connections to create per partition. Setting this to 
-# 5 with 3 partitions means you will have 15 unique connections to the 
-# database. Note that BoneCP will not create all these connections in 
-# one go but rather start off with minConnectionsPerPartition and 
-# gradually increase connections as required.
-db.default.maxConnectionsPerPartition=64
-
-# The number of initial connections, per partition.
-db.default.minConnectionsPerPartition=64
-
-# Evolutions
-# ~~~~~
-# You can disable evolutions if needed
-# evolutionplugin=disabled
-
-# Logger
-# ~~~~~
-# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
-
-# Root logger:
-logger.root=ERROR
-
-# Logger used by the framework:
-logger.play=ERROR
-
-# Logger provided to your application:
-logger.application=ERROR

+ 0 - 12
frameworks/Java/play2-java/play2-scala-anorm/conf/routes

@@ -1,12 +0,0 @@
-# Routes
-# This file defines all application routes (Higher priority routes first)
-# ~~~~
-
-# Home page
-GET     /db                             controllers.Application.db
-GET     /queries                        controllers.Application.queries(queries ?= "1")
-GET     /fortunes                       controllers.Application.fortunes
-GET     /update                         controllers.Application.update(queries ?= "1")
-
-# Map static resources from the /public folder to the /assets URL path
-GET     /assets/*file                   controllers.Assets.at(path="/public", file)

+ 0 - 1
frameworks/Java/play2-java/play2-scala-anorm/project/build.properties

@@ -1 +0,0 @@
-sbt.version=0.13.0

+ 0 - 8
frameworks/Java/play2-java/play2-scala-anorm/project/plugins.sbt

@@ -1,8 +0,0 @@
-// Comment to get more information during initialization
-logLevel := Level.Warn
-
-// The Typesafe repository 
-resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
-
-// Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

+ 0 - 11
frameworks/Java/play2-java/play2-scala-anorm/source_code

@@ -1,11 +0,0 @@
-./play-scala/app/
-./play-scala/app/controllers
-./play-scala/app/controllers/Application.scala
-./play-scala/app/views
-./play-scala/app/views/main.scala.html
-./play-scala/app/views/fortune.scala.html
-./play-scala/app/utils
-./play-scala/app/utils/PredicatedAction.scala
-./play-scala/app/models
-./play-scala/app/models/Fortune.scala
-./play-scala/app/models/World.scala

+ 0 - 33
frameworks/Java/play2-java/play2-scala/.gitignore

@@ -1,33 +0,0 @@
-logs
-project/project
-project/target
-public
-target
-test
-tmp
-.history
-dist
-conf/evolutions
-
-# Ignore all dotfiles...
-.*
-# except for .gitignore
-!.gitignore
-
-# Ignore Play! working directory #
-db
-eclipse
-lib
-log
-logs
-modules
-precompiled
-project/project
-project/target
-target
-tmp
-test-result
-server.pid
-*.iml
-*.eml
-

+ 0 - 18
frameworks/Java/play2-java/play2-scala/README.md

@@ -1,18 +0,0 @@
-#Play Benchmarking Test
-
-This is the Play portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
-
-### JSON Encoding Test
-
-* [JSON test source](app/controllers/Application.scala)
-
-## Infrastructure Software Versions
-The tests were run with:
-
-* [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
-* [Play 2](http://http://www.playframework.com/)
-
-## Test URLs
-### JSON Encoding Test
-
-http://localhost/json

+ 0 - 12
frameworks/Java/play2-java/play2-scala/app/controllers/Application.scala

@@ -1,12 +0,0 @@
-package controllers
-
-import play.api.mvc._
-import play.api.libs.json.Json
-
-object Application extends Controller {
-
-  def json() = Action {
-    Ok(Json.obj("message" -> "Hello, World!"))
-  }
-
-}

+ 0 - 5
frameworks/Java/play2-java/play2-scala/build.sbt

@@ -1,5 +0,0 @@
-name := "play2-scala"
-
-version := "1.0-SNAPSHOT"
-
-lazy val root = (project in file(".")).enablePlugins(PlayScala)

+ 0 - 31
frameworks/Java/play2-java/play2-scala/conf/application.conf

@@ -1,31 +0,0 @@
-# This is the main configuration file for the application.
-# ~~~~~
-
-# Secret key
-# ~~~~~
-# The secret key is used to secure cryptographics functions.
-# If you deploy your application to several instances be sure to use the same key!
-application.secret="RItx1I:80?W@]8GAtPDuF8Ydd3mXM85p/<7og]Q;uBOdijQAauRDgu73B6`wQP59"
-
-# The application languages
-# ~~~~~
-application.langs="en"
-
-# Global object class
-# ~~~~~
-# Define the Global object class for this application.
-# Default to Global in the root package.
-# global=Global
-
-# Logger
-# ~~~~~
-# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
-
-# Root logger:
-logger.root=ERROR
-
-# Logger used by the framework:
-logger.play=ERROR
-
-# Logger provided to your application:
-logger.application=ERROR

+ 0 - 9
frameworks/Java/play2-java/play2-scala/conf/routes

@@ -1,9 +0,0 @@
-# Routes
-# This file defines all application routes (Higher priority routes first)
-# ~~~~
-
-# Home page
-GET     /json                           controllers.Application.json
-
-# Map static resources from the /public folder to the /assets URL path
-GET     /assets/*file                   controllers.Assets.at(path="/public", file)

+ 0 - 1
frameworks/Java/play2-java/play2-scala/project/build.properties

@@ -1 +0,0 @@
-sbt.version=0.13.5

+ 0 - 8
frameworks/Java/play2-java/play2-scala/project/plugins.sbt

@@ -1,8 +0,0 @@
-// Comment to get more information during initialization
-logLevel := Level.Warn
-
-// The Typesafe repository 
-resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
-
-// Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")

+ 0 - 11
frameworks/Java/play2-java/play2-scala/source_code

@@ -1,11 +0,0 @@
-./play-scala/app/
-./play-scala/app/controllers
-./play-scala/app/controllers/Application.scala
-./play-scala/app/views
-./play-scala/app/views/main.scala.html
-./play-scala/app/views/fortune.scala.html
-./play-scala/app/utils
-./play-scala/app/utils/PredicatedAction.scala
-./play-scala/app/models
-./play-scala/app/models/Fortune.scala
-./play-scala/app/models/World.scala

+ 0 - 6
frameworks/Java/play2-java/setup_scala.py

@@ -1,6 +0,0 @@
-
-# This file was generated by generate_config.py.
-# Do not edit this file directly.
-from .setup_common import make_setup_for_dir
-
-make_setup_for_dir(globals(), 'play2-scala')

+ 0 - 6
frameworks/Java/play2-java/setup_scala_anorm.py

@@ -1,6 +0,0 @@
-
-# This file was generated by generate_config.py.
-# Do not edit this file directly.
-from .setup_common import make_setup_for_dir
-
-make_setup_for_dir(globals(), 'play2-scala-anorm')

+ 0 - 37
frameworks/Scala/play2-scala/benchmark_config

@@ -2,24 +2,6 @@
   "framework": "play2", 
   "framework": "play2", 
   "tests": [
   "tests": [
     {
     {
-      "java": {
-        "display_name": "play2-java", 
-        "setup_file": "setup_java", 
-        "framework": "play2", 
-        "language": "Java", 
-        "orm": "Raw", 
-        "os": "Linux", 
-        "database": "None", 
-        "approach": "Realistic", 
-        "classification": "Fullstack", 
-        "platform": "Netty", 
-        "webserver": "None", 
-        "database_os": "Linux", 
-        "notes": "", 
-        "versus": "netty", 
-        "port": "9000", 
-        "json_url": "/json"
-      }, 
       "scala": {
       "scala": {
         "display_name": "play2-scala", 
         "display_name": "play2-scala", 
         "setup_file": "setup_scala", 
         "setup_file": "setup_scala", 
@@ -38,25 +20,6 @@
         "port": "9000", 
         "port": "9000", 
         "json_url": "/json"
         "json_url": "/json"
       }, 
       }, 
-      "java-ebean": {
-        "display_name": "play2-java-ebean", 
-        "setup_file": "setup_java_ebean", 
-        "framework": "play2", 
-        "language": "Java", 
-        "orm": "Ebean", 
-        "os": "Linux", 
-        "database": "MySQL", 
-        "approach": "Realistic", 
-        "classification": "Fullstack", 
-        "platform": "Netty", 
-        "webserver": "None", 
-        "database_os": "Linux", 
-        "notes": "", 
-        "versus": "netty", 
-        "port": "9000", 
-        "db_url": "/db", 
-        "query_url": "/queries?queries="
-      }, 
       "scala-anorm-linux": {
       "scala-anorm-linux": {
         "display_name": "play2-scala-anorm-linux", 
         "display_name": "play2-scala-anorm-linux", 
         "setup_file": "setup_scala_anorm", 
         "setup_file": "setup_scala_anorm", 

+ 0 - 30
frameworks/Scala/play2-scala/play2-java-ebean/.gitignore

@@ -1,30 +0,0 @@
-logs
-project/project
-project/target
-target
-tmp
-.history
-dist
-
-# Ignore all dotfiles...
-.*
-# except for .gitignore
-!.gitignore
-
-# Ignore Play! working directory #
-db
-eclipse
-lib
-log
-logs
-modules
-precompiled
-project/project
-project/target
-target
-tmp
-test-result
-server.pid
-*.iml
-*.eml
-

+ 0 - 20
frameworks/Scala/play2-scala/play2-java-ebean/README.md

@@ -1,20 +0,0 @@
-#Play Benchmarking Test
-
-This is the Play portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
-
-### Data-Store/Database Mapping Test
-
-* [Database test controller](app/controllers/Application.java)
-* [Database test model](app/models/World.java)
-
-## Infrastructure Software Versions
-The tests were run with:
-
-* [Java OpenJDK 1.7](http://openjdk.java.net/)
-* [Play 2.2.0](http://http://www.playframework.com/)
-
-## Test URLs
-
-### Data-Store/Database Mapping Test
-
-http://localhost/db?queries=5

+ 0 - 97
frameworks/Scala/play2-scala/play2-java-ebean/app/controllers/Application.java

@@ -1,97 +0,0 @@
-package controllers;
-
-import akka.dispatch.ExecutionContexts;
-import models.World;
-import play.Play;
-import play.core.NamedThreadFactory;
-import play.libs.F;
-import play.libs.Json;
-
-import play.mvc.Controller;
-import play.mvc.Result;
-import scala.concurrent.ExecutionContext;
-import utils.Predicate;
-import utils.Predicated;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-import java.util.concurrent.*;
-
-public class Application extends Controller {
-
-    private static final int MAX_QUERIES_PER_REQUEST = 20;
-    private static final int TEST_DATABASE_ROWS = 10000;
-
-    private static final int partitionCount = Play.application().configuration().getInt("db.default.partitionCount");
-    private static final int maxConnections =
-            partitionCount * Play.application().configuration().getInt("db.default.maxConnectionsPerPartition");
-    private static final int minConnections =
-            partitionCount * Play.application().configuration().getInt("db.default.minConnectionsPerPartition");
-
-    private static final ThreadPoolExecutor tpe = new ThreadPoolExecutor(minConnections, maxConnections,
-            0L, TimeUnit.MILLISECONDS,
-            new LinkedBlockingQueue<Runnable>(),
-            new NamedThreadFactory("dbEc"));
-    private static final ExecutionContext dbEc = ExecutionContexts.fromExecutorService(tpe);
-
-    // If the thread-pool used by the database grows too large then our server
-    // is probably struggling, and we should start dropping requests. Set
-    // the max size of our queue something above the number of concurrent
-    // connections that we need to handle.
-    public static class IsDbAvailable implements Predicate {
-        @Override
-        public boolean condition() {
-            return tpe.getQueue().size() <= 1024;
-        }
-    }
-
-    @Predicated(predicate = IsDbAvailable.class, failed = SERVICE_UNAVAILABLE)
-    public static F.Promise<Result> db() {
-        return getRandomWorlds(1).map(new F.Function<List<World>, Result>() {
-            @Override
-            public Result apply(List<World> worlds) {
-                return ok(Json.toJson(worlds.get(0)));
-            }
-        });
-    }
-
-    @Predicated(predicate = IsDbAvailable.class, failed = SERVICE_UNAVAILABLE)
-    public static F.Promise<Result> queries(final String queryCountString) {
-        int queryCount;
-        try {
-            queryCount = Integer.parseInt(queryCountString, 10);
-        } catch (NumberFormatException e) {
-            queryCount = 1;
-        }
-        if (queryCount < 1) {
-            queryCount = 1;
-        } else if (queryCount > 500) {
-            queryCount = 500;
-        }
-
-        return getRandomWorlds(queryCount).map(new F.Function<List<World>, Result>() {
-            @Override
-            public Result apply(List<World> worlds) {
-                return ok(Json.toJson(worlds));
-            }
-        });
-    }
-
-    private static F.Promise<List<World>> getRandomWorlds(final int n) {
-        return F.Promise.promise(new F.Function0<List<World>>() {
-            @Override
-            public List<World> apply() {
-                Random random = ThreadLocalRandom.current();
-                List<World> worlds = new ArrayList<World>(n);
-                for (int i = 0; i < n; ++i) {
-                    long randomId = random.nextInt(TEST_DATABASE_ROWS) + 1;
-                    World world = World.find.byId(randomId);
-                    worlds.add(world);
-                }
-                return worlds;
-            }
-        }, dbEc);
-    }
-
-}

+ 0 - 20
frameworks/Scala/play2-scala/play2-java-ebean/app/models/World.java

@@ -1,20 +0,0 @@
-package models;
-
-import javax.persistence.*;
-
-import play.db.ebean.*;
-
-@Entity
-public class World extends Model {
-
-    @Id
-    public Long id;
-
-    @Column(name = "randomNumber")
-    public Long randomNumber;
-
-    public static Finder<Long, World> find = new Finder<Long, World>(
-            Long.class, World.class
-    );
-
-}

+ 0 - 8
frameworks/Scala/play2-scala/play2-java-ebean/app/utils/Predicate.java

@@ -1,8 +0,0 @@
-package utils;
-
-/**
- * Predicates for PredicatedActions.
- */
-public interface Predicate {
-    boolean condition();
-}

+ 0 - 26
frameworks/Scala/play2-scala/play2-java-ebean/app/utils/Predicated.java

@@ -1,26 +0,0 @@
-package utils;
-
-import play.mvc.With;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Declares a composing action that will check for a condition before deciding on whether to proceed with the request.
- */
-@With(PredicatedAction.class)
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Predicated {
-    /**
-     * The condition.
-     */
-    Class<? extends Predicate> predicate();
-
-    /**
-     * The http status code to return if the condition fails.
-     */
-    int failed();
-}

+ 0 - 23
frameworks/Scala/play2-scala/play2-java-ebean/app/utils/PredicatedAction.java

@@ -1,23 +0,0 @@
-package utils;
-
-/**
- * A predicated action is one where a condition must be satisfied in order to proceed with the request. If the
- * condition is not satisfied then a supplied status result is yielded.
- */
-
-import play.libs.F;
-import play.mvc.Action;
-import play.mvc.Http;
-import play.mvc.SimpleResult;
-
-public class PredicatedAction extends Action<Predicated> {
-    @Override
-    public F.Promise<SimpleResult> call(final Http.Context ctx) throws Throwable {
-        final Predicate p = configuration.predicate().newInstance();
-        if (p.condition()) {
-            return delegate.call(ctx);
-        } else {
-            return F.Promise.<SimpleResult>pure(status(configuration.failed()));
-        }
-    }
-}

+ 0 - 13
frameworks/Scala/play2-scala/play2-java-ebean/build.sbt

@@ -1,13 +0,0 @@
-name := "play2-java-ebean"
-
-version := "1.0-SNAPSHOT"
-
-libraryDependencies ++= Seq(
-  javaJdbc,
-  javaEbean,
-  "mysql" % "mysql-connector-java" % "5.1.22"
-  )
-
-dependencyOverrides += "com.jolbox" % "bonecp" % "0.7.1.RELEASE"
-
-playJavaSettings

+ 0 - 74
frameworks/Scala/play2-scala/play2-java-ebean/conf/application.conf

@@ -1,74 +0,0 @@
-# This is the main configuration file for the application.
-# ~~~~~
-
-# Secret key
-# ~~~~~
-# The secret key is used to secure cryptographics functions.
-# If you deploy your application to several instances be sure to use the same key!
-application.secret="RItx1I:80?W@]8GAtPDuF8Ydd3mXM85p/<7og]Q;uBOdijQAauRDgu73B6`wQP59"
-
-# The application languages
-# ~~~~~
-application.langs="en"
-
-# Global object class
-# ~~~~~
-# Define the Global object class for this application.
-# Default to Global in the root package.
-# global=Global
-
-# 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.user=sa
-# db.default.password=
-#
-# You can expose this datasource via JNDI if needed (Useful for JPA)
-# db.default.jndiName=DefaultDS
-db.default.driver= com.mysql.jdbc.Driver
-db.default.url="jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
-db.default.user=benchmarkdbuser
-db.default.password=benchmarkdbpass
-db.default.jndiName=DefaultDS
-
-db.default.partitionCount=4
-
-# The number of connections to create per partition. Setting this to 
-# 5 with 3 partitions means you will have 15 unique connections to the 
-# database. Note that BoneCP will not create all these connections in 
-# one go but rather start off with minConnectionsPerPartition and 
-# gradually increase connections as required.
-db.default.maxConnectionsPerPartition=64
-
-# The number of initial connections, per partition.
-db.default.minConnectionsPerPartition=64
-
-# Evolutions
-# ~~~~~
-# You can disable evolutions if needed
-evolutionplugin=disabled
-
-# Ebean configuration
-# ~~~~~
-# You can declare as many Ebean servers as you want.
-# By convention, the default server is named `default`
-#
-ebean.default="models.*"
-
-# Logger
-# ~~~~~
-# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
-
-# Root logger:
-logger.root=ERROR
-
-# Logger used by the framework:
-logger.play=ERROR
-
-# Logger provided to your application:
-logger.application=ERROR
-

+ 0 - 10
frameworks/Scala/play2-scala/play2-java-ebean/conf/routes

@@ -1,10 +0,0 @@
-# Routes
-# This file defines all application routes (Higher priority routes first)
-# ~~~~
-
-# Home page
-GET     /db                             controllers.Application.db()
-GET     /queries                        controllers.Application.queries(queries ?= "1")
-
-# Map static resources from the /public folder to the /assets URL path
-GET     /assets/*file               controllers.Assets.at(path="/public", file)

+ 0 - 1
frameworks/Scala/play2-scala/play2-java-ebean/project/build.properties

@@ -1 +0,0 @@
-sbt.version=0.13.0

+ 0 - 8
frameworks/Scala/play2-scala/play2-java-ebean/project/plugins.sbt

@@ -1,8 +0,0 @@
-// Comment to get more information during initialization
-logLevel := Level.Warn
-
-// The Typesafe repository 
-resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
-
-// Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

+ 0 - 9
frameworks/Scala/play2-scala/play2-java-ebean/source_code

@@ -1,9 +0,0 @@
-./play-java/app/
-./play-java/app/controllers
-./play-java/app/controllers/Application.java
-./play-java/app/utils
-./play-java/app/utils/Predicate.java
-./play-java/app/utils/PredicatedAction.java
-./play-java/app/utils/Predicated.java
-./play-java/app/models
-./play-java/app/models/World.java

+ 0 - 30
frameworks/Scala/play2-scala/play2-java/.gitignore

@@ -1,30 +0,0 @@
-logs
-project/project
-project/target
-target
-tmp
-.history
-dist
-
-# Ignore all dotfiles...
-.*
-# except for .gitignore
-!.gitignore
-
-# Ignore Play! working directory #
-db
-eclipse
-lib
-log
-logs
-modules
-precompiled
-project/project
-project/target
-target
-tmp
-test-result
-server.pid
-*.iml
-*.eml
-

+ 0 - 18
frameworks/Scala/play2-scala/play2-java/README.md

@@ -1,18 +0,0 @@
-#Play Benchmarking Test
-
-This is the Play portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
-
-### JSON Encoding Test
-
-* [JSON test source](app/controllers/Application.java)
-
-## Infrastructure Software Versions
-The tests were run with:
-
-* [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
-* [Play 2](http://http://www.playframework.com/)
-
-## Test URLs
-### JSON Encoding Test
-
-http://localhost/json

+ 0 - 19
frameworks/Scala/play2-scala/play2-java/app/controllers/Application.java

@@ -1,19 +0,0 @@
-package controllers;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import play.mvc.Controller;
-import play.mvc.Result;
-
-public class Application extends Controller {
-
-    //http://stackoverflow.com/questions/3907929/should-i-make-jacksons-objectmapper-as-static-final
-    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
-    public static Result json() {
-        final ObjectNode result = OBJECT_MAPPER.createObjectNode();
-        result.put("message", "Hello, World!");
-        return ok(result);
-    }
-
-}

+ 0 - 5
frameworks/Scala/play2-scala/play2-java/build.sbt

@@ -1,5 +0,0 @@
-name := "play2-java"
-
-version := "1.0-SNAPSHOT"
-
-lazy val root = (project in file(".")).enablePlugins(PlayJava)

+ 0 - 26
frameworks/Scala/play2-scala/play2-java/conf/application.conf

@@ -1,26 +0,0 @@
-# This is the main configuration file for the application.
-# ~~~~~
-
-# Secret key
-# ~~~~~
-# The secret key is used to secure cryptographics functions.
-# If you deploy your application to several instances be sure to use the same key!
-application.secret="RItx1I:80?W@]8GAtPDuF8Ydd3mXM85p/<7og]Q;uBOdijQAauRDgu73B6`wQP59"
-
-# The application languages
-# ~~~~~
-application.langs="en"
-
-# Logger
-# ~~~~~
-# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
-
-# Root logger:
-logger.root=ERROR
-
-# Logger used by the framework:
-logger.play=ERROR
-
-# Logger provided to your application:
-logger.application=ERROR
-

+ 0 - 9
frameworks/Scala/play2-scala/play2-java/conf/routes

@@ -1,9 +0,0 @@
-# Routes
-# This file defines all application routes (Higher priority routes first)
-# ~~~~
-
-# Home page
-GET     /json                           controllers.Application.json
-
-# Map static resources from the /public folder to the /assets URL path
-GET     /assets/*file               controllers.Assets.at(path="/public", file)

+ 0 - 1
frameworks/Scala/play2-scala/play2-java/project/build.properties

@@ -1 +0,0 @@
-sbt.version=0.13.5

+ 0 - 8
frameworks/Scala/play2-scala/play2-java/project/plugins.sbt

@@ -1,8 +0,0 @@
-// Comment to get more information during initialization
-logLevel := Level.Warn
-
-// The Typesafe repository 
-resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
-
-// Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.2")

+ 0 - 9
frameworks/Scala/play2-scala/play2-java/source_code

@@ -1,9 +0,0 @@
-./play-java/app/
-./play-java/app/controllers
-./play-java/app/controllers/Application.java
-./play-java/app/utils
-./play-java/app/utils/Predicate.java
-./play-java/app/utils/PredicatedAction.java
-./play-java/app/utils/Predicated.java
-./play-java/app/models
-./play-java/app/models/World.java

+ 0 - 6
frameworks/Scala/play2-scala/setup_java.py

@@ -1,6 +0,0 @@
-
-# This file was generated by generate_config.py.
-# Do not edit this file directly.
-from .setup_common import make_setup_for_dir
-
-make_setup_for_dir(globals(), 'play2-java')

+ 0 - 6
frameworks/Scala/play2-scala/setup_java_ebean.py

@@ -1,6 +0,0 @@
-
-# This file was generated by generate_config.py.
-# Do not edit this file directly.
-from .setup_common import make_setup_for_dir
-
-make_setup_for_dir(globals(), 'play2-java-ebean')