Browse Source

Moved play-java[-ebean] and play-scala[-anorm] into one play2 directory

All these tests use Play 2.3. Setup and configuration is standardised and
generated by the `generate_config.py` script. In the future some of the
other Play 2 tests could be moved into this directory.
Rich Dougherty 11 years ago
parent
commit
f078026f82
69 changed files with 267 additions and 260 deletions
  1. 1 4
      .travis.yml
  2. 0 24
      play-java-ebean/benchmark_config
  3. 0 12
      play-java-ebean/setup.py
  4. 0 0
      play-java/__init__.py
  5. 0 23
      play-java/benchmark_config
  6. 0 34
      play-java/setup.py
  7. 0 0
      play-scala-anorm/__init__.py
  8. 0 47
      play-scala-anorm/benchmark_config
  9. 0 33
      play-scala-anorm/setup.py
  10. 0 0
      play-scala/__init__.py
  11. 0 41
      play-scala/benchmark_config
  12. 0 3
      play-scala/install.sh
  13. 0 34
      play-scala/setup.py
  14. 5 0
      play2/README.md
  15. 0 0
      play2/__init__.py
  16. 1 0
      play2/bash_profile.sh
  17. 104 0
      play2/benchmark_config
  18. 72 0
      play2/generate_config.py
  19. 0 0
      play2/install.sh
  20. 0 0
      play2/play2-java-ebean/.gitignore
  21. 0 0
      play2/play2-java-ebean/README.md
  22. 0 0
      play2/play2-java-ebean/app/controllers/Application.java
  23. 0 0
      play2/play2-java-ebean/app/models/World.java
  24. 0 0
      play2/play2-java-ebean/app/utils/Predicate.java
  25. 0 0
      play2/play2-java-ebean/app/utils/Predicated.java
  26. 0 0
      play2/play2-java-ebean/app/utils/PredicatedAction.java
  27. 1 1
      play2/play2-java-ebean/build.sbt
  28. 0 0
      play2/play2-java-ebean/conf/application.conf
  29. 0 0
      play2/play2-java-ebean/conf/routes
  30. 0 0
      play2/play2-java-ebean/project/build.properties
  31. 0 0
      play2/play2-java-ebean/project/plugins.sbt
  32. 0 0
      play2/play2-java-ebean/source_code
  33. 0 0
      play2/play2-java/.gitignore
  34. 0 0
      play2/play2-java/README.md
  35. 0 0
      play2/play2-java/app/controllers/Application.java
  36. 1 1
      play2/play2-java/build.sbt
  37. 0 0
      play2/play2-java/conf/application.conf
  38. 0 0
      play2/play2-java/conf/routes
  39. 0 0
      play2/play2-java/project/build.properties
  40. 0 0
      play2/play2-java/project/plugins.sbt
  41. 0 0
      play2/play2-java/source_code
  42. 0 0
      play2/play2-scala-anorm/.gitignore
  43. 0 0
      play2/play2-scala-anorm/README.md
  44. 0 0
      play2/play2-scala-anorm/app/controllers/Application.scala
  45. 0 0
      play2/play2-scala-anorm/app/models/Fortune.scala
  46. 0 0
      play2/play2-scala-anorm/app/models/World.scala
  47. 0 0
      play2/play2-scala-anorm/app/utils/PredicatedAction.scala
  48. 0 0
      play2/play2-scala-anorm/app/views/fortune.scala.html
  49. 0 0
      play2/play2-scala-anorm/app/views/main.scala.html
  50. 1 1
      play2/play2-scala-anorm/build.sbt
  51. 1 1
      play2/play2-scala-anorm/conf/application.conf
  52. 0 0
      play2/play2-scala-anorm/conf/routes
  53. 0 0
      play2/play2-scala-anorm/project/build.properties
  54. 0 0
      play2/play2-scala-anorm/project/plugins.sbt
  55. 0 0
      play2/play2-scala-anorm/source_code
  56. 0 0
      play2/play2-scala/.gitignore
  57. 0 0
      play2/play2-scala/README.md
  58. 0 0
      play2/play2-scala/app/controllers/Application.scala
  59. 1 1
      play2/play2-scala/build.sbt
  60. 0 0
      play2/play2-scala/conf/application.conf
  61. 0 0
      play2/play2-scala/conf/routes
  62. 0 0
      play2/play2-scala/project/build.properties
  63. 0 0
      play2/play2-scala/project/plugins.sbt
  64. 0 0
      play2/play2-scala/source_code
  65. 55 0
      play2/setup_common.py
  66. 6 0
      play2/setup_java.py
  67. 6 0
      play2/setup_java_ebean.py
  68. 6 0
      play2/setup_scala.py
  69. 6 0
      play2/setup_scala_anorm.py

+ 1 - 4
.travis.yml

@@ -97,12 +97,9 @@ env:
     - TESTDIR=plain
     - TESTDIR=play1
     - TESTDIR=play1siena
+    - TESTDIR=play2
     - TESTDIR=play-activate-mysql
-    - TESTDIR=play-java
-    - TESTDIR=play-java-ebean
     - TESTDIR=play-java-jpa
-    - TESTDIR=play-scala
-    - TESTDIR=play-scala-anorm
     - TESTDIR=play-scala-mongodb
     - TESTDIR=play-slick
     - TESTDIR=pyramid

+ 0 - 24
play-java-ebean/benchmark_config

@@ -1,24 +0,0 @@
-{
-  "framework": "play-java-ebean",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "db_url": "/db",
-      "query_url": "/db?queries=",
-      "port": 9000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MySQL",
-      "framework": "play2",
-      "language": "Java",
-      "orm": "Full",
-      "platform": "Netty",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "play-java-ebean",
-      "notes": "",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 12
play-java-ebean/setup.py

@@ -1,12 +0,0 @@
-import setup_util
-import subprocess
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("play-java-ebean/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
-  subprocess.Popen(["play","start"], stdin=subprocess.PIPE, cwd="play-java-ebean", stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  p = subprocess.Popen(["play","stop"], cwd="play-java-ebean", stderr=errfile, stdout=logfile)
-  p.communicate()
-  return 0

+ 0 - 0
play-java/__init__.py


+ 0 - 23
play-java/benchmark_config

@@ -1,23 +0,0 @@
-{
-  "framework": "play-java",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "port": 9000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "None",
-      "framework": "play2",
-      "language": "Java",
-      "orm": "Full",
-      "platform": "Netty",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "play-java",
-      "notes": "",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 34
play-java/setup.py

@@ -1,34 +0,0 @@
-import os
-import signal
-import subprocess
-
-dirname = projname = 'play-java'
-is_windows = args.os.lower() == "windows"
-cmd_suffix = '.bat' if is_windows else ''
-
-def start(args, logfile, errfile):
-  kill_running_process() # Kill the running process and delete the 
-                         # RUNNING_PID file (if any). With any luck no 
-                         # new process has picked up the same PID.
-
-  subprocess.call(['sbt'+cmd_suffix,"stage"], stdin=subprocess.PIPE, cwd=dirname, stderr=errfile, stdout=logfile)
-  subprocess.Popen([os.path.join("target","universal","stage","bin",projname+cmd_suffix)], shell=True, stdin=subprocess.PIPE, cwd=dirname, stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  kill_running_process()  
-  return 0
-
-def kill_running_process():
-  pidfile = os.path.join(dirname,"target","universal","stage","RUNNING_PID")
-  try:
-    with open(pidfile) as f:
-      pid = int(f.read())
-      os.kill(pid, signal.SIGTERM)
-  except:
-    pass
-
-  try:
-    os.remove(pidfile)
-  except OSError:
-    pass

+ 0 - 0
play-scala-anorm/__init__.py


+ 0 - 47
play-scala-anorm/benchmark_config

@@ -1,47 +0,0 @@
-{
-  "framework": "play-scala-anorm",
-  "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-anorm",
-      "notes": "",
-      "versus": "netty"
-    },
-    "windows-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": "Windows",
-      "database_os": "Linux",
-      "display_name": "play-scala-anorm-windows",
-      "notes": "",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 33
play-scala-anorm/setup.py

@@ -1,33 +0,0 @@
-import setup_util
-import subprocess
-import os
-
-def start(args, logfile, errfile):
-  kill_running_process() # Kill the running process and delete the 
-                         # RUNNING_PID file (if any). With any luck no 
-                         # new process has picked up the same PID.
-
-  play_cmd = "play"
-  if args.os.lower() == "windows":
-    play_cmd = "play.bat"
-  
-  setup_util.replace_text("play-scala/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
-  subprocess.Popen([play_cmd,"start"], stdin=subprocess.PIPE, cwd="play-scala-anorm", stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  kill_running_process()  
-  return 0
-
-def kill_running_process():
-  try:
-    with open("./play-scala-anorm/RUNNING_PID") as f:
-      pid = int(f.read())
-      os.kill(pid, 15)
-  except:
-  	pass
-
-  try:
-    os.remove("play-scala-anorm/RUNNING_PID")
-  except OSError:
-    pass  

+ 0 - 0
play-scala/__init__.py


+ 0 - 41
play-scala/benchmark_config

@@ -1,41 +0,0 @@
-{
-  "framework": "play-scala",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "port": 9000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "None",
-      "framework": "play2",
-      "language": "Scala",
-      "orm": "Full",
-      "platform": "Netty",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "play-scala",
-      "notes": "",
-      "versus": "netty"
-    },
-    "windows-default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "port": 9000,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "None",
-      "framework": "play2",
-      "language": "Scala",
-      "orm": "Full",
-      "platform": "Netty",
-      "webserver": "None",
-      "os": "Windows",
-      "database_os": "Linux",
-      "display_name": "play-scala-windows",
-      "notes": "",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 3
play-scala/install.sh

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

+ 0 - 34
play-scala/setup.py

@@ -1,34 +0,0 @@
-import os
-import signal
-import subprocess
-
-dirname = projname = 'play-scala'
-is_windows = args.os.lower() == "windows"
-cmd_suffix = '.bat' if is_windows else ''
-
-def start(args, logfile, errfile):
-  kill_running_process() # Kill the running process and delete the 
-                         # RUNNING_PID file (if any). With any luck no 
-                         # new process has picked up the same PID.
-
-  subprocess.call(['sbt'+cmd_suffix,"stage"], stdin=subprocess.PIPE, cwd=dirname, stderr=errfile, stdout=logfile)
-  subprocess.Popen([os.path.join("target","universal","stage","bin",projname+cmd_suffix)], shell=True, stdin=subprocess.PIPE, cwd=dirname, stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  kill_running_process()  
-  return 0
-
-def kill_running_process():
-  pidfile = os.path.join(dirname,"target","universal","stage","RUNNING_PID")
-  try:
-    with open(pidfile) as f:
-      pid = int(f.read())
-      os.kill(pid, signal.SIGTERM)
-  except:
-    pass
-
-  try:
-    os.remove(pidfile)
-  except OSError:
-    pass

+ 5 - 0
play2/README.md

@@ -0,0 +1,5 @@
+# play2 framework tests
+
+1. Add new test applications in subdirectories named either `play2-language` or `play2-language-orm`.
+2. Edit `generate_config.py` and add configuration for the new test applications.
+3. Run `python generate_config.py` to generate a new `benchmark_config` file and to generate a `setup_play2_*.py` file for your test application.

+ 0 - 0
play-java-ebean/__init__.py → play2/__init__.py


+ 1 - 0
play2/bash_profile.sh

@@ -0,0 +1 @@
+# Intentionally blank

+ 104 - 0
play2/benchmark_config

@@ -0,0 +1,104 @@
+{
+  "framework": "play2", 
+  "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": {
+        "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": {
+        "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": "/db?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": "/db?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": "/db?queries=", 
+        "fortune_url": "/fortunes", 
+        "update_url": "/update?queries="
+      }
+    }
+  ]
+}

+ 72 - 0
play2/generate_config.py

@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+
+import collections, json, textwrap
+
+# This script generates the benchmark_config 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, (os, ...), (test, ...))
+# See the dir_name logic below to see the directory name for each test application.
+configurations = [
+  ('Java',  None,    ['Linux'],            ['json']),
+  ('Scala', None,    ['Linux'],            ['json']),
+  ('Java',  'Ebean', ['Linux'],            ['db', 'query']),
+  ('Scala', 'Anorm', ['Linux', 'Windows'], ['db', 'query', 'fortune', 'update']),
+]
+
+# All play2 test applications must use the same URLs.
+test_urls = {
+  'json': '/json',
+  'db': '/db',
+  'query': '/db?queries=',
+  'fortune': '/fortunes',
+  'update': '/update?queries=',
+}
+
+tests_config_json = collections.OrderedDict()
+
+for lang, orm, oses, tests in configurations:
+  dir_name = 'play2-' + lang.lower() + (('-'+orm.lower()) if orm else '')
+  print 'Generating tests for test application '+dir_name
+  setup_name = 'setup_' + lang.lower() + (('_'+orm.lower()) if orm else '')
+  for os in oses:
+    if len(oses) == 1:
+      test_name = lang.lower() + (('-'+orm.lower()) if orm else '')
+    else:
+      test_name = lang.lower() + (('-'+orm.lower()) if orm else '') + '-'+os.lower()
+    test_config_json = collections.OrderedDict([
+      ('display_name', 'play2-'+test_name),
+      ('setup_file', setup_name),
+      ('framework', 'play2'),
+      ('language', lang),
+      ('orm', orm if orm else 'Raw'),
+      ('os', os),
+      ('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]
+      tests_config_json[test_name] = test_config_json
+    with open(setup_name+'.py', 'w') as f:
+      f.write(textwrap.dedent("""
+        # 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(), '"""+dir_name+"""')
+      """))
+
+with open('benchmark_config', 'w') as f:
+  json_str = json.dumps({
+    'framework': 'play2',
+    'tests': [tests_config_json]
+  }, indent=2)
+  f.write(json_str)

+ 0 - 0
play-java/install.sh → play2/install.sh


+ 0 - 0
play-java-ebean/.gitignore → play2/play2-java-ebean/.gitignore


+ 0 - 0
play-java-ebean/README.md → play2/play2-java-ebean/README.md


+ 0 - 0
play-java-ebean/app/controllers/Application.java → play2/play2-java-ebean/app/controllers/Application.java


+ 0 - 0
play-java-ebean/app/models/World.java → play2/play2-java-ebean/app/models/World.java


+ 0 - 0
play-java-ebean/app/utils/Predicate.java → play2/play2-java-ebean/app/utils/Predicate.java


+ 0 - 0
play-java-ebean/app/utils/Predicated.java → play2/play2-java-ebean/app/utils/Predicated.java


+ 0 - 0
play-java-ebean/app/utils/PredicatedAction.java → play2/play2-java-ebean/app/utils/PredicatedAction.java


+ 1 - 1
play-java-ebean/build.sbt → play2/play2-java-ebean/build.sbt

@@ -1,4 +1,4 @@
-name := "play-java-ebean"
+name := "play2-java-ebean"
 
 version := "1.0-SNAPSHOT"
 

+ 0 - 0
play-java-ebean/conf/application.conf → play2/play2-java-ebean/conf/application.conf


+ 0 - 0
play-java-ebean/conf/routes → play2/play2-java-ebean/conf/routes


+ 0 - 0
play-java-ebean/project/build.properties → play2/play2-java-ebean/project/build.properties


+ 0 - 0
play-java-ebean/project/plugins.sbt → play2/play2-java-ebean/project/plugins.sbt


+ 0 - 0
play-java-ebean/source_code → play2/play2-java-ebean/source_code


+ 0 - 0
play-java/.gitignore → play2/play2-java/.gitignore


+ 0 - 0
play-java/README.md → play2/play2-java/README.md


+ 0 - 0
play-java/app/controllers/Application.java → play2/play2-java/app/controllers/Application.java


+ 1 - 1
play-java/build.sbt → play2/play2-java/build.sbt

@@ -1,4 +1,4 @@
-name := "play-java"
+name := "play2-java"
 
 version := "1.0-SNAPSHOT"
 

+ 0 - 0
play-java/conf/application.conf → play2/play2-java/conf/application.conf


+ 0 - 0
play-java/conf/routes → play2/play2-java/conf/routes


+ 0 - 0
play-java/project/build.properties → play2/play2-java/project/build.properties


+ 0 - 0
play-java/project/plugins.sbt → play2/play2-java/project/plugins.sbt


+ 0 - 0
play-java/source_code → play2/play2-java/source_code


+ 0 - 0
play-scala-anorm/.gitignore → play2/play2-scala-anorm/.gitignore


+ 0 - 0
play-scala-anorm/README.md → play2/play2-scala-anorm/README.md


+ 0 - 0
play-scala-anorm/app/controllers/Application.scala → play2/play2-scala-anorm/app/controllers/Application.scala


+ 0 - 0
play-scala-anorm/app/models/Fortune.scala → play2/play2-scala-anorm/app/models/Fortune.scala


+ 0 - 0
play-scala-anorm/app/models/World.scala → play2/play2-scala-anorm/app/models/World.scala


+ 0 - 0
play-scala-anorm/app/utils/PredicatedAction.scala → play2/play2-scala-anorm/app/utils/PredicatedAction.scala


+ 0 - 0
play-scala-anorm/app/views/fortune.scala.html → play2/play2-scala-anorm/app/views/fortune.scala.html


+ 0 - 0
play-scala-anorm/app/views/main.scala.html → play2/play2-scala-anorm/app/views/main.scala.html


+ 1 - 1
play-scala-anorm/build.sbt → play2/play2-scala-anorm/build.sbt

@@ -1,4 +1,4 @@
-name := "play-scala-anorm"
+name := "play2-scala-anorm"
 
 version := "1.0-SNAPSHOT"
 

+ 1 - 1
play-scala-anorm/conf/application.conf → play2/play2-scala-anorm/conf/application.conf

@@ -30,7 +30,7 @@ application.langs="en"
 # 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.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

+ 0 - 0
play-scala-anorm/conf/routes → play2/play2-scala-anorm/conf/routes


+ 0 - 0
play-scala-anorm/project/build.properties → play2/play2-scala-anorm/project/build.properties


+ 0 - 0
play-scala-anorm/project/plugins.sbt → play2/play2-scala-anorm/project/plugins.sbt


+ 0 - 0
play-scala-anorm/source_code → play2/play2-scala-anorm/source_code


+ 0 - 0
play-scala/.gitignore → play2/play2-scala/.gitignore


+ 0 - 0
play-scala/README.md → play2/play2-scala/README.md


+ 0 - 0
play-scala/app/controllers/Application.scala → play2/play2-scala/app/controllers/Application.scala


+ 1 - 1
play-scala/build.sbt → play2/play2-scala/build.sbt

@@ -1,4 +1,4 @@
-name := "play-scala"
+name := "play2-scala"
 
 version := "1.0-SNAPSHOT"
 

+ 0 - 0
play-scala/conf/application.conf → play2/play2-scala/conf/application.conf


+ 0 - 0
play-scala/conf/routes → play2/play2-scala/conf/routes


+ 0 - 0
play-scala/project/build.properties → play2/play2-scala/project/build.properties


+ 0 - 0
play-scala/project/plugins.sbt → play2/play2-scala/project/plugins.sbt


+ 0 - 0
play-scala/source_code → play2/play2-scala/source_code


+ 55 - 0
play2/setup_common.py

@@ -0,0 +1,55 @@
+import os, setup_util, signal, subprocess
+
+# Create start and stop functions for the Play project with the given dir
+# and install them in the given module's globals.
+def make_setup_for_dir(module_globals, subtest_name):
+
+  def start(args, logfile, errfile):
+    kill_running_process(logfile)
+
+    subtest_dir = get_subtest_dir()
+    install_dir = os.environ['IROOT']
+
+    is_windows = os.name == "nt"
+    cmd_suffix = '.bat' if is_windows else ''
+    sbt_cmd = os.path.join(install_dir, 'sbt', 'bin', 'sbt'+cmd_suffix)
+    app_cmd = os.path.join(subtest_dir, 'target','universal','stage','bin',subtest_name+cmd_suffix)
+
+    setup_util.replace_text(
+      os.path.join(subtest_dir,'conf','application.conf'),
+      "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
+    logfile.write('Staging app: '+sbt_cmd+' stage\n')
+    subprocess.call(
+      [sbt_cmd, 'stage'],
+      stdin=subprocess.PIPE, cwd=subtest_dir, stderr=errfile, stdout=logfile)
+    logfile.write('Starting app: '+app_cmd+'\n')
+    subprocess.Popen(
+      [app_cmd],
+      shell=True, stdin=subprocess.PIPE, cwd=subtest_dir, stderr=errfile, stdout=logfile)
+    return 0
+
+  def stop(logfile, errfile):
+    kill_running_process(logfile)  
+    return 0
+
+  # Install the start and stop functions in the calling module
+  module_globals['start'] = start
+  module_globals['stop'] = stop
+
+  def get_subtest_dir():
+    test_dir = os.environ['TROOT']
+    return os.path.join(test_dir, subtest_name)
+
+  # Kill the running process and delete the RUNNING_PID file (if any).
+  def kill_running_process(logfile):
+    subtest_dir = get_subtest_dir()
+    pidfile = os.path.join(subtest_dir,"target","universal","stage","RUNNING_PID")
+    if not os.path.exists(pidfile):
+      logfile.write('No PID file: {}\n'.format(pidfile))
+      return
+    logfile.write('Reading and deleting PID file: {}\n'.format(pidfile))
+    with open(pidfile) as f:
+      pid = int(f.read())
+    os.remove(pidfile)
+    logfile.write('Sending SIGTERM to process: {}\n'.format(pid))
+    os.kill(pid, signal.SIGTERM)

+ 6 - 0
play2/setup_java.py

@@ -0,0 +1,6 @@
+
+# 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')

+ 6 - 0
play2/setup_java_ebean.py

@@ -0,0 +1,6 @@
+
+# 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')

+ 6 - 0
play2/setup_scala.py

@@ -0,0 +1,6 @@
+
+# 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')

+ 6 - 0
play2/setup_scala_anorm.py

@@ -0,0 +1,6 @@
+
+# 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')