Browse Source

Merge branch 'LadyMozzarella-refactor-play-activate-mysql'

Brittany Mazza 10 years ago
parent
commit
a3c2a5a9ef
40 changed files with 174 additions and 316 deletions
  1. 0 1
      .travis.yml
  2. 0 95
      frameworks/Java/play2-java/generate_config.py
  3. 0 27
      frameworks/Scala/play-activate-mysql/README.md
  4. 0 62
      frameworks/Scala/play-activate-mysql/app/controllers/Application.scala
  5. 0 26
      frameworks/Scala/play-activate-mysql/benchmark_config.json
  6. 0 3
      frameworks/Scala/play-activate-mysql/install.sh
  7. 0 13
      frameworks/Scala/play-activate-mysql/setup.sh
  8. 40 19
      frameworks/Scala/play2-scala/benchmark_config.json
  9. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/.gitignore
  10. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/Global.scala
  11. 91 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/controllers/Application.scala
  12. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/models/Migrations.scala
  13. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/models/Models.scala
  14. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/models/PersistenceContext.scala
  15. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/views/fortune.scala.html
  16. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/app/views/main.scala.html
  17. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/conf/application.conf
  18. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/conf/play.plugins
  19. 3 2
      frameworks/Scala/play2-scala/play2-scala-activate/conf/routes
  20. 1 1
      frameworks/Scala/play2-scala/play2-scala-activate/project/Build.scala
  21. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/project/build.properties
  22. 0 0
      frameworks/Scala/play2-scala/play2-scala-activate/project/plugins.sbt
  23. 1 1
      frameworks/Scala/play2-scala/play2-scala-anorm/app/controllers/Application.scala
  24. 0 20
      frameworks/Scala/play2-scala/play2-scala-mongodb/README.md
  25. 0 16
      frameworks/Scala/play2-scala/play2-scala-mongodb/project/Build.scala
  26. 0 1
      frameworks/Scala/play2-scala/play2-scala-mongodb/project/build.properties
  27. 0 3
      frameworks/Scala/play2-scala/play2-scala-mongodb/source_code
  28. 0 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/.gitignore
  29. 0 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/app/controllers/Application.scala
  30. 11 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/build.sbt
  31. 0 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/application.conf
  32. 0 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/play.plugins
  33. 1 2
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/routes
  34. 1 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/build.properties
  35. 1 1
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/plugins.sbt
  36. 3 0
      frameworks/Scala/play2-scala/play2-scala-reactivemongo/source_code
  37. 1 1
      frameworks/Scala/play2-scala/play2-scala-slick/app/controllers/Application.scala
  38. 0 18
      frameworks/Scala/play2-scala/play2-scala/README.md
  39. 4 4
      frameworks/Scala/play2-scala/setup_scala_activate.sh
  40. 16 0
      frameworks/Scala/play2-scala/setup_scala_reactivemongo.sh

+ 0 - 1
.travis.yml

@@ -140,7 +140,6 @@ env:
     - "TESTDIR=Scala/finagle"
     - "TESTDIR=Scala/finagle"
     - "TESTDIR=Scala/lift-stateless"
     - "TESTDIR=Scala/lift-stateless"
     - "TESTDIR=Scala/plain"
     - "TESTDIR=Scala/plain"
-    - "TESTDIR=Scala/play-activate-mysql"
     - "TESTDIR=Scala/play2-scala"
     - "TESTDIR=Scala/play2-scala"
     - "TESTDIR=Scala/scalatra"
     - "TESTDIR=Scala/scalatra"
     - "TESTDIR=Scala/scruffy"
     - "TESTDIR=Scala/scruffy"

+ 0 - 95
frameworks/Java/play2-java/generate_config.py

@@ -1,95 +0,0 @@
-#!/usr/bin/env python
-
-import collections, json, os, textwrap
-
-# This script generates the benchmark_config.json and setup_*.py files.
-# To add new tests, modify the `configurations` and `test_urls` tables.
-
-# Each line corresponds to a test application.
-# Format is: (language, orm, (opsys, ...), (test, ...))
-# See the dir_name logic below to see the directory name for each test application.
-configurations = [
-  ('Java',  None,    			['Linux'],            ['json', 'plaintext']),
-  ('Java',  'Ebean BoneCP', 	['Linux'],            ['db', 'query', 'fortune', 'update']),
-  ('Java',  'Ebean HikariCP', 	['Linux'],            ['db', 'query', 'fortune', 'update']),
-  ('Java',  'JPA BoneCP',		['Linux'],            ['db', 'query', 'fortune', 'update']),
-  ('Java',  'JPA HikariCP',		['Linux'],            ['db', 'query', 'fortune', 'update']),
-  ('Scala', None,    			['Linux'],            ['json']),
-  ('Scala', 'Anorm', 			['Linux', 'Windows'], ['db', 'query', 'fortune', 'update']),
-  ('Scala', 'Slick', 			['Linux'],            ['db', 'query', 'fortune', 'update']),
-]
-
-# All play2 test applications must use the same URLs.
-test_urls = {
-  'json': '/json',
-  'db': '/db',
-  'query': '/queries?queries=',
-  'fortune': '/fortunes',
-  'update': '/update?queries=',
-  'plaintext': '/plaintext',
-}
-
-langs = {
-  'Java': ['Java', 'play2-java'],
-  'Scala': ['Scala', 'play2-scala']
-}
-def pathForLang(lang):
-  return os.path.join(frameworksPath(), *langs[lang])
-def frameworksPath():
-  'Get the absolute path of ROOT/frameworks'
-  return os.path.abspath(os.path.join(__file__, '..', '..', '..'))
-
-lang_test_configs = {}
-for lang, _ in langs.iteritems():
-  lang_test_configs[lang] = collections.OrderedDict()
-
-for lang, orm, opsyses, tests in configurations:
-  dir_name = 'play2-' + lang.lower() + (('-'+orm.replace(' ', '-').lower()) if orm else '')
-  setup_name = 'setup_' + lang.lower() + (('_'+orm.replace(' ', '_').lower()) if orm else '')
-
-  setup_path = os.path.join(pathForLang(lang), setup_name+'.py')
-  print 'Generating', setup_path
-  with open(setup_path, 'w') as f:
-    f.write(textwrap.dedent("""
-      # This file was generated by frameworks/Java/play2-java/generate_config.py.
-      # Do not edit this file directly, use the script to regenerate.
-      from .setup_common import make_setup_for_dir
-
-      make_setup_for_dir(globals(), '"""+dir_name+"""')
-    """))
-
-  for opsys in opsyses:
-    if len(opsyses) == 1:
-      test_name = lang.lower() + (('-'+orm.replace(' ', '-').lower()) if orm else '')
-    else:
-      test_name = lang.lower() + (('-'+orm.replace(' ', '-').lower()) if orm else '') + '-'+opsys.lower()
-    test_config_json = collections.OrderedDict([
-      ('display_name', 'play2-'+test_name),
-      ('setup_file', setup_name),
-      ('framework', 'play2'),
-      ('language', lang),
-      ('orm', 'Full' if orm else 'Raw'),
-      ('os', opsys),
-      ('database', 'MySQL' if orm else 'None'),
-      ('approach', 'Realistic'),
-      ('classification', 'Fullstack'),
-      ('platform', 'Netty'),
-      ('webserver', 'None'),
-      ('database_os', 'Linux'),
-      ('notes', ''),
-      ('versus', 'netty'),
-      ('port', '9000'),
-    ])
-    for test in tests:
-      test_config_json[test+'_url'] = test_urls[test]
-      lang_test_configs[lang][test_name] = test_config_json
-
-for lang, _ in langs.iteritems():
-  benchmark_config_path = os.path.join(pathForLang(lang), 'benchmark_config.json')
-  print 'Generating', benchmark_config_path
-  with open(benchmark_config_path, 'w') as f:
-    json_str = json.dumps({
-      'framework': 'play2',
-      'tests': [lang_test_configs[lang]]
-    }, indent=2)
-    f.write(json_str)

+ 0 - 27
frameworks/Scala/play-activate-mysql/README.md

@@ -1,27 +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)
-
-### 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.1.0](http://http://www.playframework.com/)
-
-## Test URLs
-### JSON Encoding Test
-
-http://localhost/json
-
-### Data-Store/Database Mapping Test
-
-http://localhost/db?queries=5

+ 0 - 62
frameworks/Scala/play-activate-mysql/app/controllers/Application.scala

@@ -1,62 +0,0 @@
-package controllers
-
-import play.api.Play.current
-import play.api.mvc._
-import play.api.libs.json.Json
-import java.util.concurrent._
-import scala.concurrent._
-import scala.concurrent.Future
-import play.api.libs.concurrent.Execution.Implicits._
-import play.core.NamedThreadFactory
-import models.ActivateWorld
-import models.Models._
-import models.ActivateFortune
-import models.persistenceContext._
-
-object Application extends Controller {
-
-    private val TestDatabaseRows = 10000
-
-    def db(queries: Int) =
-        Action {
-            transactional {
-                val random = ThreadLocalRandom.current()
-
-                val worlds =
-                    for (_ <- 1 to queries) yield {
-                        ActivateWorld.fingByLegacyId(random.nextInt(TestDatabaseRows) + 1)
-                    }
-
-                Ok(Json.toJson(worlds))
-            }
-        }
-
-    def fortunes() =
-        Action {
-            val transaction = new Transaction
-            try
-                transactional(transaction) {
-                    val fortunes =
-                        ActivateFortune.all ++ List(new ActivateFortune(0, "Additional fortune added at request time."))
-                    Ok(views.html.fortune(fortunes))
-                }
-            finally
-                transaction.rollback
-        }
-
-    def update(queries: Int) =
-        Action {
-
-            val random = ThreadLocalRandom.current()
-
-            transactional {
-                val worlds =
-                    for (_ <- 1 to queries) yield {
-                        val world = ActivateWorld.fingByLegacyId(random.nextInt(TestDatabaseRows) + 1)
-                        world.randomNumber = random.nextInt(TestDatabaseRows) + 1
-                        world
-                    }
-                Ok(Json.toJson(worlds)).withHeaders("Server" -> "Netty")
-            }
-        }
-}

+ 0 - 26
frameworks/Scala/play-activate-mysql/benchmark_config.json

@@ -1,26 +0,0 @@
-{
-  "framework": "play-activate-mysql",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "db_url": "/db",
-      "query_url": "/db?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/update?queries=",
-      "port": 9000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MySQL",
-      "framework": "play2",
-      "language": "Scala",
-      "orm": "Full",
-      "platform": "Netty",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "play-scala-activate",
-      "notes": "",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 3
frameworks/Scala/play-activate-mysql/install.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-fw_depends java maven play2 sbt

+ 0 - 13
frameworks/Scala/play-activate-mysql/setup.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-export PLAY2_HOME=${IROOT}/play-2.2.0
-
-sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
-
-${PLAY2_HOME}/play clean dist
-
-cd target/universal
-unzip play-activate-mysql-1.0-SNAPSHOT.zip
-cd play-activate-mysql-1.0-SNAPSHOT/bin
-chmod +x play-activate-mysql
-
-./play-activate-mysql &

+ 40 - 19
frameworks/Scala/play2-scala/benchmark_config.json

@@ -20,6 +20,27 @@
         "port": "9000", 
         "port": "9000", 
         "json_url": "/json"
         "json_url": "/json"
       }, 
       }, 
+      "activate": {
+        "display_name": "play2-scala-activate", 
+        "setup_file": "setup_scala_activate", 
+        "framework": "play2", 
+        "language": "Scala", 
+        "orm": "Full", 
+        "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="
+      }, 
       "anorm-linux": {
       "anorm-linux": {
         "display_name": "play2-scala-anorm-linux", 
         "display_name": "play2-scala-anorm-linux", 
         "setup_file": "setup_scala_anorm", 
         "setup_file": "setup_scala_anorm", 
@@ -62,6 +83,25 @@
         "fortune_url": "/fortunes", 
         "fortune_url": "/fortunes", 
         "update_url": "/update?queries="
         "update_url": "/update?queries="
       }, 
       }, 
+      "reactivemongo": {
+        "display_name": "play2-scala-reactivemongo", 
+        "setup_file": "setup_scala_reactivemongo", 
+        "framework": "play2", 
+        "language": "Scala", 
+        "orm": "Full", 
+        "os": "Linux", 
+        "database": "MongoDB", 
+        "approach": "Realistic", 
+        "classification": "Fullstack", 
+        "platform": "Netty", 
+        "webserver": "None", 
+        "database_os": "Linux", 
+        "notes": "", 
+        "versus": "netty", 
+        "port": "9000", 
+        "db_url": "/db", 
+        "query_url": "/queries?queries="
+      }, 
       "slick": {
       "slick": {
         "display_name": "play2-scala-slick", 
         "display_name": "play2-scala-slick", 
         "setup_file": "setup_scala_slick", 
         "setup_file": "setup_scala_slick", 
@@ -82,25 +122,6 @@
         "query_url": "/queries?queries=", 
         "query_url": "/queries?queries=", 
         "fortune_url": "/fortunes", 
         "fortune_url": "/fortunes", 
         "update_url": "/update?queries="
         "update_url": "/update?queries="
-      },
-      "scala-mongodb": {
-        "setup_file": "setup_scala_mongodb",
-        "db_url": "/db",
-        "query_url": "/queries?queries=",
-        "port": 9000,
-        "approach": "Realistic",
-        "classification": "Fullstack",
-        "database": "MongoDB",
-        "framework": "play2",
-        "language": "Scala",
-        "orm": "Raw",
-        "platform": "Netty",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "play2-scala-mongodb",
-        "notes": "Uses Reactive Mongo",
-        "versus": "netty"
       }
       }
     }
     }
   ]
   ]

+ 0 - 0
frameworks/Scala/play-activate-mysql/.gitignore → frameworks/Scala/play2-scala/play2-scala-activate/.gitignore


+ 0 - 0
frameworks/Scala/play-activate-mysql/app/Global.scala → frameworks/Scala/play2-scala/play2-scala-activate/app/Global.scala


+ 91 - 0
frameworks/Scala/play2-scala/play2-scala-activate/app/controllers/Application.scala

@@ -0,0 +1,91 @@
+package controllers
+
+import play.api.Play.current
+import play.api.mvc._
+import play.api.libs.json.Json
+import java.util.concurrent._
+import scala.concurrent._
+import scala.concurrent.Future
+import play.api.libs.concurrent.Execution.Implicits._
+import play.core.NamedThreadFactory
+import models.ActivateWorld
+import models.Models._
+import models.ActivateFortune
+import models.persistenceContext._
+
+object Application extends Controller {
+
+  def getRandomWorlds(n: Int): Seq[ActivateWorld] = {
+      val random = ThreadLocalRandom.current()
+      for (_ <- 1 to n) yield {
+          val randomId = random.nextInt(TestDatabaseRows) + 1
+          ActivateWorld.fingByLegacyId(randomId)
+      }
+  }
+
+  def getFortunes(): Seq[ActivateFortune] = {
+      ActivateFortune.all
+  }
+
+  def updateWorlds(n: Int): Seq[ActivateWorld] = {
+      val random = ThreadLocalRandom.current()
+      for (_ <- 1 to n) yield {
+            val randomId = random.nextInt(TestDatabaseRows) + 1
+            val world = ActivateWorld.fingByLegacyId(randomId)
+            world.randomNumber = random.nextInt(10000) + 1
+            world
+      }
+  }
+
+  // Common(ish) code between Scala database code
+
+  protected val TestDatabaseRows = 10000
+
+  def db = Action {
+      transactional {
+          val worlds = getRandomWorlds(1)
+          Ok(Json.toJson(worlds.head))
+      }
+  }
+
+  def queries(countString: String) = Action {
+      val n = parseCount(countString)
+      transactional {
+          val worlds = getRandomWorlds(n)
+          Ok(Json.toJson(worlds))
+      }
+  }
+
+  def fortunes() = Action {
+      val transaction = new Transaction
+      try
+          transactional(transaction) {
+              val dbFortunes = getFortunes()
+              val appendedFortunes =  new ActivateFortune(0, "Additional fortune added at request time.") :: (dbFortunes.to[List])
+              Ok(views.html.fortune(appendedFortunes))
+          }
+      finally
+          transaction.rollback
+  }
+
+  def update(queries: String) = Action {
+      transactional {
+          val n = parseCount(queries)
+          val worlds = updateWorlds(n)
+          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
+      }
+  }
+}

+ 0 - 0
frameworks/Scala/play-activate-mysql/app/models/Migrations.scala → frameworks/Scala/play2-scala/play2-scala-activate/app/models/Migrations.scala


+ 0 - 0
frameworks/Scala/play-activate-mysql/app/models/Models.scala → frameworks/Scala/play2-scala/play2-scala-activate/app/models/Models.scala


+ 0 - 0
frameworks/Scala/play-activate-mysql/app/models/PersistenceContext.scala → frameworks/Scala/play2-scala/play2-scala-activate/app/models/PersistenceContext.scala


+ 0 - 0
frameworks/Scala/play-activate-mysql/app/views/fortune.scala.html → frameworks/Scala/play2-scala/play2-scala-activate/app/views/fortune.scala.html


+ 0 - 0
frameworks/Scala/play-activate-mysql/app/views/main.scala.html → frameworks/Scala/play2-scala/play2-scala-activate/app/views/main.scala.html


+ 0 - 0
frameworks/Scala/play-activate-mysql/conf/application.conf → frameworks/Scala/play2-scala/play2-scala-activate/conf/application.conf


+ 0 - 0
frameworks/Scala/play-activate-mysql/conf/play.plugins → frameworks/Scala/play2-scala/play2-scala-activate/conf/play.plugins


+ 3 - 2
frameworks/Scala/play-activate-mysql/conf/routes → frameworks/Scala/play2-scala/play2-scala-activate/conf/routes

@@ -3,9 +3,10 @@
 # ~~~~
 # ~~~~
 
 
 # Home page
 # Home page
-GET     /db                             controllers.Application.db(queries: Int ?= 1)
+GET     /db                             controllers.Application.db
+GET     /queries                        controllers.Application.queries(queries ?= "1")
 GET     /fortunes                       controllers.Application.fortunes
 GET     /fortunes                       controllers.Application.fortunes
-GET     /update                         controllers.Application.update(queries: Int ?= 1)
+GET     /update                         controllers.Application.update(queries ?= "1")
 
 
 # Map static resources from the /public folder to the /assets URL path
 # Map static resources from the /public folder to the /assets URL path
 GET     /assets/*file                   controllers.Assets.at(path="/public", file)
 GET     /assets/*file                   controllers.Assets.at(path="/public", file)

+ 1 - 1
frameworks/Scala/play-activate-mysql/project/Build.scala → frameworks/Scala/play2-scala/play2-scala-activate/project/Build.scala

@@ -4,7 +4,7 @@ import play.Project._
 
 
 object ApplicationBuild extends Build {
 object ApplicationBuild extends Build {
 
 
-  val appName         = "play-activate-mysql"
+  val appName         = "play2-scala-activate"
   val appVersion      = "1.0-SNAPSHOT"
   val appVersion      = "1.0-SNAPSHOT"
 
 
   val activateVersion = "1.4.4"
   val activateVersion = "1.4.4"

+ 0 - 0
frameworks/Scala/play-activate-mysql/project/build.properties → frameworks/Scala/play2-scala/play2-scala-activate/project/build.properties


+ 0 - 0
frameworks/Scala/play-activate-mysql/project/plugins.sbt → frameworks/Scala/play2-scala/play2-scala-activate/project/plugins.sbt


+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-anorm/app/controllers/Application.scala

@@ -42,7 +42,7 @@ object Application extends Controller {
     }
     }
   }
   }
 
 
-  // Common code between Anorm and Slick
+  // Common code between Scala database code
 
 
   protected val TestDatabaseRows = 10000
   protected val TestDatabaseRows = 10000
 
 

+ 0 - 20
frameworks/Scala/play2-scala/play2-scala-mongodb/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)
-
-## Infrastructure Software Versions
-The tests were run with:
-
-* [Java OpenJDK 1.7.0_09](http://openjdk.java.net/)
-* [Play 2.2.0](http://http://www.playframework.com/)
-* [Reactivemongo 0.10.5.0.akka22](https://github.com/zenexity/Play-ReactiveMongo)
-
-## Test URLs
-### Single Database Query test
-http://localhost:9000/db
-### Multiple Database Query test
-http://localhost:9000/queries?queries=5

+ 0 - 16
frameworks/Scala/play2-scala/play2-scala-mongodb/project/Build.scala

@@ -1,16 +0,0 @@
-import sbt._
-import Keys._
-
-object ApplicationBuild extends Build {
-
-  val appName         = "play2-scala-mongodb"
-  val appVersion      = "1.0-SNAPSHOT"
-
-  val appDependencies = Seq(
-    "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka22" exclude("org.scala-stm", "scala-stm_2.10.0")
-  )
-
-  val main = play.Project(appName, appVersion, appDependencies).settings(
-  )
-
-}

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

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

+ 0 - 3
frameworks/Scala/play2-scala/play2-scala-mongodb/source_code

@@ -1,3 +0,0 @@
-./play-scala-mongodb/app/
-./play-scala-mongodb/app/controllers
-./play-scala-mongodb/app/controllers/Application.scala

+ 0 - 0
frameworks/Scala/play2-scala/play2-scala-mongodb/.gitignore → frameworks/Scala/play2-scala/play2-scala-reactivemongo/.gitignore


+ 0 - 0
frameworks/Scala/play2-scala/play2-scala-mongodb/app/controllers/Application.scala → frameworks/Scala/play2-scala/play2-scala-reactivemongo/app/controllers/Application.scala


+ 11 - 0
frameworks/Scala/play2-scala/play2-scala-reactivemongo/build.sbt

@@ -0,0 +1,11 @@
+name := "play2-scala-reactivemongo"
+
+version := "1.0-SNAPSHOT"
+
+scalaVersion := "2.11.4"
+
+lazy val root = (project in file(".")).enablePlugins(PlayScala)
+
+libraryDependencies ++= Seq(
+  "org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23"
+)

+ 0 - 0
frameworks/Scala/play2-scala/play2-scala-mongodb/conf/application.conf → frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/application.conf


+ 0 - 0
frameworks/Scala/play2-scala/play2-scala-mongodb/conf/play.plugins → frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/play.plugins


+ 1 - 2
frameworks/Scala/play2-scala/play2-scala-mongodb/conf/routes → frameworks/Scala/play2-scala/play2-scala-reactivemongo/conf/routes

@@ -2,8 +2,7 @@
 # This file defines all application routes (Higher priority routes first)
 # This file defines all application routes (Higher priority routes first)
 # ~~~~
 # ~~~~
 
 
-# Home page
-GET     /db                             controllers.Application.singledb()
+GET     /db                             controllers.Application.singledb
 GET     /queries                        controllers.Application.dbqueries(queries: String ?= "1")
 GET     /queries                        controllers.Application.dbqueries(queries: String ?= "1")
 
 
 # Map static resources from the /public folder to the /assets URL path
 # Map static resources from the /public folder to the /assets URL path

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

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

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-mongodb/project/plugins.sbt → frameworks/Scala/play2-scala/play2-scala-reactivemongo/project/plugins.sbt

@@ -5,4 +5,4 @@ logLevel := Level.Warn
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
 
 // Use the Play sbt plugin for Play projects
 // Use the Play sbt plugin for Play projects
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.6")

+ 3 - 0
frameworks/Scala/play2-scala/play2-scala-reactivemongo/source_code

@@ -0,0 +1,3 @@
+./play2-scala-reactivemongo/app/
+./play2-scala-reactivemongo/app/controllers
+./play2-scala-reactivemongo/app/controllers/Application.scala

+ 1 - 1
frameworks/Scala/play2-scala/play2-scala-slick/app/controllers/Application.scala

@@ -44,7 +44,7 @@ object Application extends Controller {
     }
     }
   }
   }
 
 
-  // Common code between Anorm and Slick
+  // Common code between Scala database code
 
 
   protected val TestDatabaseRows = 10000
   protected val TestDatabaseRows = 10000
 
 

+ 0 - 18
frameworks/Scala/play2-scala/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

+ 4 - 4
frameworks/Scala/play2-scala/setup_scala_mongodb.sh → frameworks/Scala/play2-scala/setup_scala_activate.sh

@@ -1,16 +1,16 @@
 #!/bin/bash
 #!/bin/bash
 
 
-cd play2-scala-mongodb
+cd play2-scala-activate
 sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
 sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
 
 
 # If application has an already existing process id, clear it.
 # If application has an already existing process id, clear it.
-if [ -f ${TROOT}/play2-scala-mongodb/target/universal/stage/RUNNING_PID ]
+if [ -f ${TROOT}/play2-scala-activate/target/universal/stage/RUNNING_PID ]
 then
 then
-  rm -f -r ${TROOT}/play2-scala-mongodb/target/universal/stage/RUNNING_PID
+  rm -f -r ${TROOT}/play2-scala-activate/target/universal/stage/RUNNING_PID
 fi
 fi
 
 
 # Stage application.
 # Stage application.
 ${IROOT}/sbt/bin/sbt stage
 ${IROOT}/sbt/bin/sbt stage
 
 
 # Execute Start script in background.
 # Execute Start script in background.
-${TROOT}/play2-scala-mongodb/target/universal/stage/bin/play2-scala-mongodb &
+${TROOT}/play2-scala-activate/target/universal/stage/bin/play2-scala-activate &

+ 16 - 0
frameworks/Scala/play2-scala/setup_scala_reactivemongo.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+
+cd play2-scala-reactivemongo
+sed -i 's|jdbc:mysql://.*:3306|jdbc:mysql://'"${DBHOST}"':3306|g' conf/application.conf
+
+# If application has an already existing process id, clear it.
+if [ -f ${TROOT}/play2-scala-reactivemongo/target/universal/stage/RUNNING_PID ]
+then
+  rm -f -r ${TROOT}/play2-scala-reactivemongo/target/universal/stage/RUNNING_PID
+fi
+
+# Stage application.
+${IROOT}/sbt/bin/sbt stage
+
+# Execute Start script in background.
+${TROOT}/play2-scala-reactivemongo/target/universal/stage/bin/play2-scala-reactivemongo &