Browse Source

Merge pull request #1024 from richdougherty/rm-play-java-and-scala

Repair merge mistake
Hamilton Turner 11 years ago
parent
commit
5347358efc
36 changed files with 0 additions and 846 deletions
  1. 0 2
      .travis.yml
  2. 0 30
      frameworks/Java/play-java/.gitignore
  3. 0 27
      frameworks/Java/play-java/README.md
  4. 0 0
      frameworks/Java/play-java/__init__.py
  5. 0 81
      frameworks/Java/play-java/app/controllers/Application.java
  6. 0 20
      frameworks/Java/play-java/app/models/World.java
  7. 0 8
      frameworks/Java/play-java/app/utils/Predicate.java
  8. 0 26
      frameworks/Java/play-java/app/utils/Predicated.java
  9. 0 23
      frameworks/Java/play-java/app/utils/PredicatedAction.java
  10. 0 25
      frameworks/Java/play-java/benchmark_config
  11. 0 13
      frameworks/Java/play-java/build.sbt
  12. 0 74
      frameworks/Java/play-java/conf/application.conf
  13. 0 10
      frameworks/Java/play-java/conf/routes
  14. 0 3
      frameworks/Java/play-java/install.sh
  15. 0 1
      frameworks/Java/play-java/project/build.properties
  16. 0 8
      frameworks/Java/play-java/project/plugins.sbt
  17. 0 12
      frameworks/Java/play-java/setup.py
  18. 0 9
      frameworks/Java/play-java/source_code
  19. 0 33
      frameworks/Scala/play-scala/.gitignore
  20. 0 27
      frameworks/Scala/play-scala/README.md
  21. 0 0
      frameworks/Scala/play-scala/__init__.py
  22. 0 93
      frameworks/Scala/play-scala/app/controllers/Application.scala
  23. 0 25
      frameworks/Scala/play-scala/app/models/Fortune.scala
  24. 0 54
      frameworks/Scala/play-scala/app/models/World.scala
  25. 0 20
      frameworks/Scala/play-scala/app/utils/PredicatedAction.scala
  26. 0 18
      frameworks/Scala/play-scala/app/views/fortune.scala.html
  27. 0 12
      frameworks/Scala/play-scala/app/views/main.scala.html
  28. 0 49
      frameworks/Scala/play-scala/benchmark_config
  29. 0 9
      frameworks/Scala/play-scala/build.sbt
  30. 0 66
      frameworks/Scala/play-scala/conf/application.conf
  31. 0 12
      frameworks/Scala/play-scala/conf/routes
  32. 0 3
      frameworks/Scala/play-scala/install.sh
  33. 0 1
      frameworks/Scala/play-scala/project/build.properties
  34. 0 8
      frameworks/Scala/play-scala/project/plugins.sbt
  35. 0 33
      frameworks/Scala/play-scala/setup.py
  36. 0 11
      frameworks/Scala/play-scala/source_code

+ 0 - 2
.travis.yml

@@ -70,7 +70,6 @@ env:
     - "TESTDIR=Java/netty"
     - "TESTDIR=Java/ninja-resin"
     - "TESTDIR=Java/ninja-standalone"
-    - "TESTDIR=Java/play-java"
     - "TESTDIR=Java/play-java-jpa"
     - "TESTDIR=Java/play1"
     - "TESTDIR=Java/play1siena"
@@ -143,7 +142,6 @@ env:
     - "TESTDIR=Scala/lift-stateless"
     - "TESTDIR=Scala/plain"
     - "TESTDIR=Scala/play-activate-mysql"
-    - "TESTDIR=Scala/play-scala"
     - "TESTDIR=Scala/play-scala-mongodb"
     - "TESTDIR=Scala/play-slick"
     - "TESTDIR=Scala/play2-scala"

+ 0 - 30
frameworks/Java/play-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 - 27
frameworks/Java/play-java/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.java)
-
-### 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.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 - 0
frameworks/Java/play-java/__init__.py


+ 0 - 81
frameworks/Java/play-java/app/controllers/Application.java

@@ -1,81 +0,0 @@
-package controllers;
-
-import akka.dispatch.ExecutionContexts;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-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;
-    //http://stackoverflow.com/questions/3907929/should-i-make-jacksons-objectmapper-as-static-final
-    private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
-    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);
-
-    // A predicate for checking our ability to service database requests is determined by ensuring that the request
-    // queue doesn't fill up beyond a certain threshold. For convenience we use the max number of connections * the max
-    // # of db requests per web request to determine this threshold. It is a rough check as we don't know how many
-    // queries we're going to make or what other threads are running in parallel etc. Nevertheless, the check is
-    // adequate in order to throttle the acceptance of requests to the size of the pool.
-    public static class IsDbAvailable implements Predicate {
-        @Override
-        public boolean condition() {
-            return tpe.getQueue().size() < maxConnections * MAX_QUERIES_PER_REQUEST;
-        }
-    }
-
-    public static Result json() {
-        final ObjectNode result = OBJECT_MAPPER.createObjectNode();
-        result.put("message", "Hello, World!");
-        return ok(result);
-    }
-
-    @Predicated(predicate = IsDbAvailable.class, failed = SERVICE_UNAVAILABLE)
-    public static F.Promise<Result> db(final Integer queries) {
-        final Random random = ThreadLocalRandom.current();
-        final List<F.Promise<? extends World>> promises = new ArrayList<F.Promise<? extends World>>(queries);
-        for (int i = 0; i < queries; ++i) {
-            final F.Promise<World> p = F.Promise.promise(new F.Function0<World>() {
-                @Override
-                public World apply() throws Throwable {
-                    return World.find.byId(Long.valueOf(random.nextInt(TEST_DATABASE_ROWS) + 1));
-                }
-            }, dbEc);
-            promises.add(p);
-        }
-        return F.Promise.sequence(promises).map(new F.Function<List<World>, Result>() {
-            @Override
-            public Result apply(List<World> worlds) {
-                return ok(Json.toJson(worlds));
-            }
-        });
-    }
-
-}

+ 0 - 20
frameworks/Java/play-java/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/Java/play-java/app/utils/Predicate.java

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

+ 0 - 26
frameworks/Java/play-java/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/Java/play-java/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 - 25
frameworks/Java/play-java/benchmark_config

@@ -1,25 +0,0 @@
-{
-  "framework": "play2",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "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 - 13
frameworks/Java/play-java/build.sbt

@@ -1,13 +0,0 @@
-name := "play-java"
-
-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/Java/play-java/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/Java/play-java/conf/routes

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

+ 0 - 3
frameworks/Java/play-java/install.sh

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

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

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

+ 0 - 8
frameworks/Java/play-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.2.0")

+ 0 - 12
frameworks/Java/play-java/setup.py

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

+ 0 - 9
frameworks/Java/play-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 - 33
frameworks/Scala/play-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 - 27
frameworks/Scala/play-scala/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 - 0
frameworks/Scala/play-scala/__init__.py


+ 0 - 93
frameworks/Scala/play-scala/app/controllers/Application.scala

@@ -1,93 +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 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 MaxQueriesPerRequest = 20
-  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)
-
-  // A predicate for checking our ability to service database requests is determined by ensuring that the request
-  // queue doesn't fill up beyond a certain threshold. For convenience we use the max number of connections * the max
-  // # of db requests per web request to determine this threshold. It is a rough check as we don't know how many
-  // queries we're going to make or what other threads are running in parallel etc. Nevertheless, the check is
-  // adequate in order to throttle the acceptance of requests to the size of the pool.
-  def isDbAvailable: Boolean = tpe.getQueue.size() < maxConnections * MaxQueriesPerRequest
-
-
-  def json() = Action {
-    Ok(Json.obj("message" -> "Hello, World!"))
-  }
-
-  def db(queries: Int) = PredicatedAction(isDbAvailable, ServiceUnavailable) {
-    Action.async {
-      val random = ThreadLocalRandom.current()
-
-      val worlds = Future.sequence((for {
-        _ <- 1 to queries
-      } yield Future(World.findById(random.nextInt(TestDatabaseRows) + 1))(dbEc)
-        ).toList)
-
-      worlds map {
-        w => Ok(Json.toJson(w))
-      }
-    }
-  }
-
-  def fortunes() = PredicatedAction(isDbAvailable, ServiceUnavailable) {
-    Action.async {
-      Future(Fortune.getAll())(dbEc).map { fs =>
-        val fortunes =  Fortune(0.toLong, "Additional fortune added at request time.") +: fs
-        Ok(views.html.fortune(fortunes))
-      }
-    }
-  }
-
-  def update(queries: Int) = PredicatedAction(isDbAvailable, ServiceUnavailable) {
-    Action.async {
-      val random = ThreadLocalRandom.current()
-
-      val boundsCheckedQueries = queries match {
-        case q if q > 500 => 500
-        case q if q <   1 => 1
-        case _ => queries
-      }
-
-      val worlds = Future.sequence((for {
-        _ <- 1 to boundsCheckedQueries
-      } yield Future {
-          val world = World.findById(random.nextInt(TestDatabaseRows) + 1)
-          val updatedWorld = world.copy(randomNumber = random.nextInt(TestDatabaseRows) + 1)
-          World.updateRandom(updatedWorld)
-          updatedWorld
-        }(dbEc)
-      ).toList)
-
-      worlds.map {
-        w => Ok(Json.toJson(w)).withHeaders("Server" -> "Netty")
-      }
-    }
-  }
-}

+ 0 - 25
frameworks/Scala/play-scala/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 - 54
frameworks/Scala/play-scala/app/models/World.scala

@@ -1,54 +0,0 @@
-package models
-
-import play.api.db._
-import play.api.Play.current
-import anorm._
-import anorm.SqlParser._
-import play.api.libs.json._
-import play.api.libs.functional.syntax._
-
-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): World = {
-    DB.withConnection { implicit connection =>
-      SQL("SELECT * FROM World WHERE id = {id}").on(
-          "id" -> id
-      ).as(World.simpleRowParser.single)
-    }
-  }
-
-  def updateRandom(world: World) {
-    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/Scala/play-scala/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/Scala/play-scala/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/Scala/play-scala/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 - 49
frameworks/Scala/play-scala/benchmark_config

@@ -1,49 +0,0 @@
-{
-  "framework": "play-scala",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "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",
-      "json_url": "/json",
-      "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",
-      "notes": "",
-      "versus": "netty"
-    }
-  }]
-}

+ 0 - 9
frameworks/Scala/play-scala/build.sbt

@@ -1,9 +0,0 @@
-name := "play-scala"
-
-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/Scala/play-scala/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://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
-
-# 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/Scala/play-scala/conf/routes

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

+ 0 - 3
frameworks/Scala/play-scala/install.sh

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

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

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

+ 0 - 8
frameworks/Scala/play-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.2.0")

+ 0 - 33
frameworks/Scala/play-scala/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", stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  kill_running_process()  
-  return 0
-
-def kill_running_process():
-  try:
-    with open("./play-scala/RUNNING_PID") as f:
-      pid = int(f.read())
-      os.kill(pid, 15)
-  except:
-  	pass
-
-  try:
-    os.remove("play-scala/RUNNING_PID")
-  except OSError:
-    pass  

+ 0 - 11
frameworks/Scala/play-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