repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
nelsonblaha/playframework | framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/multiproject-assets/module/build.sbt | name := "assets-module-sample"
version := "1.0-SNAPSHOT"
scalaVersion := Option(System.getProperty("scala.version")).getOrElse("2.11.7")
includeFilter in (Assets, LessKeys.less) := "*.less"
excludeFilter in (Assets, LessKeys.less) := new PatternFilter("""[_].*\.less""".r.pattern) |
nelsonblaha/playframework | framework/src/play/src/main/scala/models/DummyPlaceHolder.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package models
/*
* Empty placeholder object to make sure templates keep compiling (due to
* imports in template files), even if projects don't have any models.
*/
object DummyPlaceHolder
|
nelsonblaha/playframework | framework/src/play-netty-server/src/main/scala/play/core/server/netty/NettyServerFlow.scala | package play.core.server.netty
import java.net.InetSocketAddress
import akka.stream.Materializer
import akka.stream.scaladsl.Flow
import com.typesafe.netty.http.DefaultWebSocketHttpResponse
import io.netty.channel.Channel
import io.netty.handler.codec.TooLongFrameException
import io.netty.handler.codec.http._
import ... |
nelsonblaha/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/ssl/Config.scala | /*
*
* * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
import play.api.PlayConfig
import java.security.{ KeyStore, SecureRandom }
import java.net.URL
import javax.net.ssl.{ TrustManagerFactory, KeyManagerFactory }
/**
* Configuration for a keystore.
*
* A ke... |
nelsonblaha/playframework | framework/src/sbt-plugin/src/main/scala/play/sbt/run/package.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.sbt
import sbt._
import play.runsupport.LoggerProxy
package object run {
import scala.language.implicitConversions
implicit def toLoggerProxy(in: Logger): LoggerProxy = new LoggerProxy {
def verbose(message: => String): Uni... |
nelsonblaha/playframework | documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/oneapppertest/ExampleSpec.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.scalatest.oneapppertest
import play.api.test._
import org.scalatest._
import org.scalatestplus.play._
import play.api.{Play, Application}
// #scalafunctionaltest-oneapppertest
class ExampleSpec extends PlaySpec with One... |
nelsonblaha/playframework | documentation/manual/detailedTopics/build/code/SubProjectsAssetsBuilder.scala | <filename>documentation/manual/detailedTopics/build/code/SubProjectsAssetsBuilder.scala
//#assets-builder
package controllers.admin
import play.api.http.LazyHttpErrorHandler
object Assets extends controllers.AssetsBuilder(LazyHttpErrorHandler)
//#assets-builder
|
nelsonblaha/playframework | framework/src/play-json/src/main/scala/play/api/libs/json/JsPath.scala | <gh_stars>0
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.json
import play.api.data.validation.ValidationError
sealed trait PathNode {
def apply(json: JsValue): List[JsValue]
def toJsonString: String
private[json] def splitChildren(json: JsValue): List[Either[(... |
nelsonblaha/playframework | framework/src/play-json/src/main/scala/play/api/libs/json/JsResult.scala | <reponame>nelsonblaha/playframework<gh_stars>1-10
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.json
import Json._
import play.api.data.validation.ValidationError
case class JsSuccess[T](value: T, path: JsPath = JsPath()) extends JsResult[T] {
def get: T = value
}
... |
nelsonblaha/playframework | framework/src/sbt-plugin/src/main/scala/play/package.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package object play {
@deprecated("Use play.sbt.Play instead", "2.4.0")
val Play = sbt.Play
@deprecated("Use play.sbt.Play instead", "2.4.0")
val PlayJava = sbt.PlayJava
@deprecated("Use play.sbt.PlayScala instead", "2.4.0")
val Pla... |
nelsonblaha/playframework | documentation/manual/working/scalaGuide/main/async/code/ScalaAsync.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.async.scalaasync
import scala.concurrent.Future
import play.api.mvc._
import play.api.test._
object ScalaAsyncSpec extends PlaySpecification {
"scala async" should {
"allow returning a future" in new WithApplication()... |
nelsonblaha/playframework | framework/src/sbt-plugin/src/sbt-test/routes-compiler-plugin/aggregate-reverse-routes/build.sbt | <reponame>nelsonblaha/playframework
lazy val root = (project in file("."))
.enablePlugins(PlayScala)
.settings(commonSettings: _*)
.dependsOn(a, c)
.aggregate(common, a, b, c, nonplay)
def commonSettings: Seq[Setting[_]] = Seq(
scalaVersion := sys.props.get("scala.version").getOrElse("2.11.7"),
routesGener... |
nelsonblaha/playframework | framework/src/play-streams/src/test/scala/play/api/libs/streams/impl/PromiseSubscriberSpec.scala | <reponame>nelsonblaha/playframework
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.streams.impl
import org.specs2.mutable.Specification
import scala.concurrent.duration.{ FiniteDuration => ScalaFiniteDuration, SECONDS }
import scala.concurrent.Promise
import scala.util.... |
nelsonblaha/playframework | framework/src/play-server/src/main/scala/play/core/server/common/ConnectionInfo.scala | <filename>framework/src/play-server/src/main/scala/play/core/server/common/ConnectionInfo.scala
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server.common
import java.net.InetAddress
import play.api.mvc.Headers
/**
* Basic information about an HTTP connection.
*/
final... |
nelsonblaha/playframework | framework/src/iteratees/src/main/scala/play/api/libs/concurrent/StateMachine.scala | <filename>framework/src/iteratees/src/main/scala/play/api/libs/concurrent/StateMachine.scala
package play.api.libs.concurrent
/**
* A state machine with a non-blocking mutex protecting its state.
*/
private[play] class StateMachine[S](initialState: S) {
/**
* The current state. Modifications to the state shoul... |
nelsonblaha/playframework | documentation/manual/detailedTopics/production/code/assembly.sbt | <reponame>nelsonblaha/playframework
//#assembly
import AssemblyKeys._
assemblySettings
mainClass in assembly := Some("play.core.server.ProdServerStart")
fullClasspath in assembly += Attributed.blank(PlayKeys.playPackageAssets.value)
//#assembly |
nelsonblaha/playframework | documentation/manual/working/scalaGuide/main/tests/code-scalatestplus-play/ScalaFunctionalTestSpec.scala | <reponame>nelsonblaha/playframework
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package scalaguide.tests.scalatest
import org.scalatest._
import org.scalatestplus.play._
import play.api.libs.ws._
import play.api.mvc._
import play.api.test._
import play.api.{GlobalSettings, Application}... |
nelsonblaha/playframework | framework/src/play-akka-http-server/src/main/scala/play/core/server/akkahttp/AkkaStreamsConversion.scala | package play.core.server.akkahttp
import akka.stream.Materializer
import akka.stream.scaladsl._
import org.reactivestreams._
import play.api.libs.iteratee._
import play.api.libs.streams.Streams
/**
* Conversion of Enumerators into Akka Streams objects. In the future
* this object will probably end up in the Play-St... |
nelsonblaha/playframework | documentation/manual/detailedTopics/configuration/filters/code/filters.sbt | //#content
libraryDependencies += filters
//#content
|
nelsonblaha/playframework | documentation/manual/working/scalaGuide/main/sql/code/ScalaControllerInject.scala | <gh_stars>1-10
package scalaguide.sql
import javax.inject.Inject
import play.api.Play.current
import play.api.mvc._
import play.api.db._
class ScalaControllerInject @Inject()(db: Database) extends Controller {
def index = Action {
var outString = "Number is "
val conn = db.getConnection()
try {
... |
nelsonblaha/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/ssl/Ciphers.scala | /*
*
* * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
import javax.net.ssl.SSLContext
/**
* This class contains sets of recommended and deprecated TLS cipher suites.
*
* The JSSE list of cipher suites is different from the RFC defined list, with some cipher... |
nelsonblaha/playframework | framework/src/play-integration-test/src/test/scala/play/it/i18n/LangSpec.scala | <reponame>nelsonblaha/playframework<filename>framework/src/play-integration-test/src/test/scala/play/it/i18n/LangSpec.scala
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.it.i18n
import play.api.i18n.Lang
import play.api.test._
class LangSpec extends PlaySpecification {
"lang... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/api/package.scala | <gh_stars>1-10
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
/**
* Play framework.
*
* == Play ==
* [[http://www.playframework.com http://www.playframework.com]]
*/
package object play
package play {
/**
* Contains the public API for Scala developers.
*
* ==== Access the c... |
nelsonblaha/playframework | framework/src/play-jdbc-evolutions/src/test/scala/play/api/db/evolutions/DefaultEvolutionsConfigParserSpec.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.db.evolutions
import org.specs2.mutable.Specification
import play.api.Configuration
object DefaultEvolutionsConfigParserSpec extends Specification {
def parse(config: (String, Any)*): EvolutionsConfig = {
new DefaultEvol... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/core/Router.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core
@deprecated("Most of the user facing API from this object has been moved to play.api.routing", "2.4.0")
object Router {
@deprecated("Use play.api.routing.Router instead", "2.4.0")
type Routes = play.api.routing.Router
}
|
nelsonblaha/playframework | framework/src/play-akka-http-server/src/sbt-test/akka-http/system-property/build.sbt | <reponame>nelsonblaha/playframework
lazy val root = (project in file(".")).enablePlugins(PlayScala)
name := "system-property"
scalaVersion := Option(System.getProperty("scala.version")).getOrElse("2.11.7")
// because the "test" directory clashes with the scripted test file
scalaSource in Test <<= baseDirectory(_ / "... |
nelsonblaha/playframework | framework/src/play-streams/src/main/scala/play/api/libs/streams/impl/FuturePublisher.scala | package play.api.libs.streams.impl
import org.reactivestreams._
import play.api.libs.concurrent.StateMachine
import play.api.libs.iteratee.Execution
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.{ Failure, Success, Try }
/*
* Creates Subscriptions that link Subscribers to a Future.
*/
priva... |
nelsonblaha/playframework | documentation/manual/working/javaGuide/advanced/routing/code/AppLoader.scala | import play.api.ApplicationLoader.Context
import play.api._
import play.api.libs.concurrent.Execution.Implicits._
import play.api.mvc.Results._
import play.api.mvc._
import play.api.routing.Router
import play.api.routing.sird._
import scala.concurrent.Future
import play.api.inject.guice.GuiceApplicationBuilder
import p... |
nelsonblaha/playframework | framework/src/play-server/src/main/scala/play/core/server/common/ForwardedHeaderHandler.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server.common
import java.net.InetAddress
import play.api.{ Configuration, PlayException }
import play.api.mvc.Headers
import play.core.server.common.NodeIdentifierParser.Ip
import scala.annotation.tailrec
import ForwardedHead... |
nelsonblaha/playframework | framework/src/play-server/src/main/scala/play/core/server/common/WebSocketFlowHandler.scala | <reponame>nelsonblaha/playframework<filename>framework/src/play-server/src/main/scala/play/core/server/common/WebSocketFlowHandler.scala
package play.core.server.common
import java.util.concurrent.atomic.AtomicReference
import akka.stream.AbruptTerminationException
import akka.stream.scaladsl._
import akka.stream.sta... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/api/inject/Module.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.inject
import java.lang.reflect.Constructor
import play.{ Configuration => JavaConfiguration, Environment => JavaEnvironment }
import play.api._
import play.utils.PlayIO
import scala.annotation.varargs
import scala.reflect.Class... |
nelsonblaha/playframework | framework/src/play-streams/src/main/scala/play/api/libs/streams/impl/SubscriptionFactory.scala | <gh_stars>1-10
package play.api.libs.streams.impl
import org.reactivestreams._
/**
* A SubscriptionFactory is an object that knows how to create Subscriptions.
* It can be used as a building block for creating Publishers, allowing the
* Subscription creation logic to be factored out.
*/
private[streams] trait Sub... |
nelsonblaha/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/ssl/debug/FixLoggingAction.scala | /*
*
* * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl.debug
import java.lang.reflect.Field
import java.security.PrivilegedExceptionAction
import play.api.libs.ws.ssl.MonkeyPatcher
/**
* A privileged action that will find relevant classes containing static fin... |
nelsonblaha/playframework | framework/src/play-streams/src/main/scala/play/api/libs/streams/impl/RelaxedPublisher.scala | package play.api.libs.streams.impl
import org.reactivestreams._
/**
* A Publisher which subscribes Subscribers without performing any
* checking about whether he Suscriber is already subscribed. This
* makes RelaxedPublisher a bit faster, but possibly a bit less safe,
* than a CheckingPublisher.
*/
private[strea... |
nelsonblaha/playframework | framework/src/play/src/test/scala/play/mvc/ResultSpec.scala | package play.test
import org.specs2.mutable._
import play.mvc.Result
import scala.concurrent.Future
import play.api.mvc.{ Cookie, Results, Result => ScalaResult }
/**
*
*/
object ResultSpec extends Specification {
"Result" should {
// This is in Scala because building wrapped scala results is easier.
"t... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/utils/Conversions.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.utils
/**
* provides conversion helpers
*/
object Conversions {
def newMap[A, B](data: (A, B)*) = Map(data: _*)
}
|
nelsonblaha/playframework | documentation/manual/detailedTopics/production/code/debian.sbt | <filename>documentation/manual/detailedTopics/production/code/debian.sbt
//#debian
lazy val root = (project in file("."))
.enablePlugins(PlayScala, DebianPlugin)
maintainer in Linux := "<NAME> <<EMAIL>>"
packageSummary in Linux := "My custom package summary"
packageDescription := "My longer package description"
//... |
nelsonblaha/playframework | framework/src/play/src/test/scala/play/api/libs/MimeTypesSpec.scala | /*
* Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs
import org.specs2.mutable._
object MimeTypesSpec extends Specification {
"Mime types" should {
"choose the correct mime type for file with lowercase extension" in {
MimeTypes.forFileName("image.png") must be equalT... |
nelsonblaha/playframework | framework/src/play-filters-helpers/src/main/scala/play/filters/csrf/CSRFFilter.scala | <filename>framework/src/play-filters-helpers/src/main/scala/play/filters/csrf/CSRFFilter.scala<gh_stars>1-10
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.filters.csrf
import javax.inject.{ Provider, Inject }
import akka.stream.Materializer
import play.api.mvc._
import play.fil... |
nelsonblaha/playframework | framework/src/play-ws/src/test/scala/play/api/libs/ws/ssl/SystemPropertiesSpec.scala | <filename>framework/src/play-ws/src/test/scala/play/api/libs/ws/ssl/SystemPropertiesSpec.scala
/*
*
* * Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
import org.specs2.mutable._
import java.security.Security
import play.api.libs.ws.WSClientConfig
object System... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/api/routing/sird/macroimpl/QueryStringParameterMacros.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
// This is in its own package so that the UrlContext.q interpolator in the sird package doesn't make the
// Quasiquote.q interpolator ambiguous.
package play.api.routing.sird.macroimpl
import scala.reflect.macros.blackbox.Context
import scala.la... |
nelsonblaha/playframework | framework/src/play-akka-http-server/src/main/scala/akka/http/play/WebSocketHandler.scala | <filename>framework/src/play-akka-http-server/src/main/scala/akka/http/play/WebSocketHandler.scala
package akka.http.play
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.ws.UpgradeToWebsocket
import akka.http.impl.engine.ws._
import akka.stream.scaladsl._
import akka.stream.stage.{ Context... |
nelsonblaha/playframework | framework/src/play-streams/src/main/scala/play/api/libs/streams/impl/PublisherEnumerator.scala | package play.api.libs.streams.impl
import org.reactivestreams._
import play.api.libs.iteratee._
import scala.concurrent.{ ExecutionContext, Future, Promise }
/**
* Adapts a Publisher to an Enumerator.
*
* When an Iteratee is applied to the Enumerator, we adapt the Iteratee into
* a Subscriber, then subscribe it t... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/core/j/HttpExecutionContext.scala | <gh_stars>0
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.j
import java.util.concurrent.Executor
import play.mvc.Http
import scala.compat.java8.FutureConverters
import scala.concurrent.{ ExecutionContext, ExecutionContextExecutor }
object HttpExecutionContext {
/**
... |
nelsonblaha/playframework | framework/src/play-streams/src/test/scala/play/api/libs/streams/impl/SubscriberEvents.scala | <reponame>nelsonblaha/playframework
package play.api.libs.streams.impl
import org.reactivestreams.{ Subscriber, Subscription }
object SubscriberEvents {
case object OnComplete
case class OnError(t: Throwable)
case class OnSubscribe(s: Subscription)
case class OnNext(t: Int)
}
trait SubscriberEvents {
self:... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/api/Exceptions.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api
/**
* Generic exception for unexpected error cases.
*/
case class UnexpectedException(message: Option[String] = None, unexpected: Option[Throwable] = None) extends PlayException(
"Unexpected exception",
message.getOrElse {... |
nelsonblaha/playframework | framework/src/play-ws/src/main/scala/play/api/libs/ws/package.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs
/**
* Asynchronous API to to query web services, as an http client.
*/
package object ws {
@deprecated("Use WSRequest", "2.4.0")
type WSRequestHolder = WSRequest
}
|
nelsonblaha/playframework | framework/src/iteratees/src/main/scala/play/api/libs/iteratee/Parsing.scala | <reponame>nelsonblaha/playframework
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.iteratee
import scala.concurrent.Future
import play.api.libs.iteratee.Execution.Implicits.{ defaultExecutionContext => dec }
object Parsing {
sealed trait MatchInfo[A] {
def cont... |
nelsonblaha/playframework | framework/src/play-docs-sbt-plugin/src/main/scala/com/typesafe/play/docs/sbtplugin/PlayDocsValidation.scala | <reponame>nelsonblaha/playframework
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package com.typesafe.play.docs.sbtplugin
import java.io.{ Closeable, BufferedReader, InputStreamReader, InputStream }
import java.net.HttpURLConnection
import java.util.concurrent.Executors
import java.util.ja... |
nelsonblaha/playframework | documentation/manual/working/javaGuide/main/http/code/javaguide/http/JavaErrorHandling.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package javaguide.http
import play.api.mvc.Action
import play.api.test._
import scala.reflect.ClassTag
object JavaErrorHandling extends PlaySpecification with WsTestClient {
def fakeApp[A](implicit ct: ClassTag[A]) = {
FakeApplication(
... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/api/libs/concurrent/Promise.scala | <filename>framework/src/play/src/main/scala/play/api/libs/concurrent/Promise.scala<gh_stars>1-10
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.libs.concurrent
import scala.language.higherKinds
import play.core._
import play.api._
import scala.concurrent.duration.{ FiniteD... |
nelsonblaha/playframework | framework/src/play-server/src/main/scala/play/core/server/ServerConfig.scala | <gh_stars>1-10
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server
import com.typesafe.config._
import java.io.File
import java.util.Properties
import play.api.{ Configuration, Mode }
/**
* Common configuration for servers such as NettyServer.
*
* @param rootDir The r... |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/api/LoggerConfigurator.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api
import java.io.File
import java.net.URL
import java.util.Properties
import play.api.Mode.Mode
/**
* Runs through underlying logger configuration.
*/
trait LoggerConfigurator {
/**
* Initialize the Logger when there's n... |
nelsonblaha/playframework | documentation/manual/working/scalaGuide/advanced/dependencyinjection/code/injected.sbt | //#content
routesGenerator := InjectedRoutesGenerator
//#content |
nelsonblaha/playframework | framework/src/play/src/main/scala/play/core/j/JavaResults.scala | <filename>framework/src/play/src/main/scala/play/core/j/JavaResults.scala
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.j
import akka.stream.Materializer
import akka.stream.scaladsl.Source
import akka.util.ByteString
import play.api.libs.streams.Streams
import scala.annot... |
nelsonblaha/playframework | framework/src/play-server/src/test/scala/play/core/server/common/NodeIdentifierParserSpec.scala | package play.core.server.common
import java.net.InetAddress.getByName
import org.specs2.mutable.Specification
import play.core.server.common.NodeIdentifierParser._
class NodeIdentifierParserSpec extends Specification {
"NodeIdentifierParser" should {
"parse an ip v6 address with port" in {
parseNode("[8f... |
nelsonblaha/playframework | framework/src/sbt-plugin/src/sbt-test/routes-compiler-plugin/aggregate-reverse-routes/a/app/controllers/a/A.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package controllers.a
import play.api.mvc._
class A extends Controller {
def index = Action {
controllers.a.routes.A.index
controllers.b.routes.B.index
controllers.c.routes.C.index
Ok
}
} |
nelsonblaha/playframework | framework/version.sbt | version in ThisBuild := "2.5.0-SNAPSHOT" |
nelsonblaha/playframework | framework/src/play-netty-server/src/main/scala/play/core/server/netty/WebSocketHandler.scala | <filename>framework/src/play-netty-server/src/main/scala/play/core/server/netty/WebSocketHandler.scala
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.core.server.netty
import akka.stream.scaladsl.Flow
import akka.stream.stage.{ Stage, PushStage, Context }
import akka.util.ByteSt... |
nelsonblaha/playframework | framework/src/play-filters-helpers/src/main/scala/play/filters/gzip/Gzip.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.filters.gzip
import play.api.libs.iteratee._
import play.api.libs.iteratee.Enumeratee.CheckDone
import java.util.zip._
import play.api.libs.concurrent.Execution.Implicits._
/**
* Enumeratees for dealing with gzip streams
*/
objec... |
nelsonblaha/playframework | templates/play-java/project/plugins.sbt | // The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "%PLAY_VERSION%")
// Web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "%COFFEESCRIPT_VERSION%")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "%LESS_VERSION%")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "%JSHINT_VERSION%")
ad... |
nelsonblaha/playframework | framework/src/play/src/test/scala/play/api/mvc/BindersSpec.scala | /*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.mvc
import java.util.UUID
import org.specs2.mutable._
object BindersSpec extends Specification {
val uuid = UUID.randomUUID
"UUID path binder" should {
val subject = implicitly[PathBindable[UUID]]
"Unbind UUID as... |
nelsonblaha/playframework | framework/src/play-streams/src/test/scala/play/api/libs/streams/impl/SubscriberIterateeSpec.scala | package play.api.libs.streams.impl
import org.specs2.mutable.Specification
import org.specs2.specification.Scope
import play.api.libs.iteratee.{ Step, Iteratee, Enumerator }
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
import scala.concurrent.duration._
object SubscriberIteratee... |
nelsonblaha/playframework | framework/src/play/src/test/scala/play/api/libs/EventSourceSpec.scala | <reponame>nelsonblaha/playframework<gh_stars>1-10
package play.api.libs
import org.specs2.mutable.Specification
import play.api.http.{ ContentTypes, HeaderNames }
import play.api.libs.iteratee.Enumerator
import play.api.mvc.Results
object EventSourceSpec extends Specification {
import EventSource.Event
"EventSo... |
nelsonblaha/playframework | documentation/manual/working/javaGuide/main/sql/code/jpa.sbt | PlayKeys.externalizeResources := false
|
nelsonblaha/playframework | templates/project/plugins.sbt | <gh_stars>1-10
addSbtPlugin("com.typesafe.sbt" % "sbt-s3" % "0.5")
// Depend on hard coded play-ws version, since we don't need/want the latest, and the system
// properties from this build interfere with the system properties from Play's build. This
// can be updated to something else when needed, but doesn't need t... |
harborx/play-di-example | play-macwire/test/com/harborx/api/device/DeviceServiceSpec.scala | package com.harborx.api.device
import com.harborx.api.modules.DeviceModule
import org.scalamock.scalatest.MockFactory
import org.scalatest.GivenWhenThen
import org.scalatestplus.play.PlaySpec
/**
* We shall use our custom Spec instead of PlaySpec in real life
* Test for service layer logic here, so we stub Device... |
harborx/play-di-example | play-guice/app/com/harborx/api/system/SystemConfig.scala | <reponame>harborx/play-di-example
package com.harborx.api.system
import javax.inject.Inject
import play.api.Configuration
/**
* An example config object. I can "inject" to anywhere I need
*/
class SystemConfig @Inject() (config: Configuration) {
val EXAMPLE_CONFIG = config.getString("harborx.api.example").get... |
harborx/play-di-example | play-guice/app/com/harborx/api/system/SystemController.scala | package com.harborx.api.system
import javax.inject._
import play.api.Environment
import play.api.mvc.{Action, Controller}
class SystemController @Inject() (config: SystemConfig, env: Environment) extends Controller {
def configExample() = Action {
Ok(config.EXAMPLE_CONFIG)
}
def envExample() = Action {
... |
harborx/play-di-example | play-macwire/app/com/harborx/api/system/SystemController.scala | package com.harborx.api.system
import play.api.Environment
import play.api.mvc.{Action, Controller}
class SystemController(config: SystemConfig, environment: Environment) extends Controller {
def configExample() = Action {
Ok(config.EXAMPLE_CONFIG)
}
def envExample() = Action {
Ok(s"current mode is:${... |
harborx/play-di-example | play-macwire/app/com/harborx/api/modules/SystemModule.scala | <reponame>harborx/play-di-example
package com.harborx.api.modules
import com.harborx.api.system._
trait SystemModule extends CoreModule {
// it need to extends CoreModule to acquire the dependency on configuration and environment
import com.softwaremill.macwire._
lazy val systemController: SystemController = w... |
harborx/play-di-example | play-macwire/test/com/harborx/api/WithApplicationComponents.scala | <reponame>harborx/play-di-example<filename>play-macwire/test/com/harborx/api/WithApplicationComponents.scala
package com.harborx.api
import org.scalatest.{Suite, TestData}
import org.scalatestplus.play.{OneAppPerSuite, OneAppPerTest, OneServerPerSuite, OneServerPerTest}
import play.api.ApplicationLoader.Context
import... |
harborx/play-di-example | play-macwire/app/com/harborx/api/modules/AppSingletonModule.scala | package com.harborx.api.modules
import com.harborx.api.singleton.AppSingleton
import play.api.inject.ApplicationLifecycle
trait AppSingletonModule extends CoreModule {
import com.softwaremill.macwire._
lazy val appSingleton: AppSingleton = wire[AppSingleton]
def applicationLifecycle: ApplicationLifecycle
}
|
harborx/play-di-example | play-macwire/test/com/harborx/api/system/SystemSpec.scala | package com.harborx.api.system
import com.harborx.api.{HxAppComponents, OneAppPerTestWithComponents}
import org.scalamock.scalatest.MockFactory
import org.scalatest._
import org.scalatestplus.play.{PlaySpec, _}
import play.api.ApplicationLoader.Context
import play.api.mvc._
import play.api.test.FakeRequest
import play... |
harborx/play-di-example | play-macwire/app/com/harborx/api/system/SystemConfig.scala | <gh_stars>1-10
package com.harborx.api.system
import play.api.Configuration
/**
* an example config object
*/
class SystemConfig(configuration: Configuration) {
val EXAMPLE_CONFIG = configuration.getString("harborx.api.example").getOrElse("config DI fail!?")
}
|
harborx/play-di-example | play-guice/app/com/harborx/api/module/SingletonModule.scala | package com.harborx.api.module
import com.google.inject.AbstractModule
import com.harborx.api.singleton._
class SingletonModule extends AbstractModule {
def configure() = {
bind(classOf[AppSingleton]).to(classOf[AppSingletonImpl]).asEagerSingleton
}
}
|
harborx/play-di-example | play-guice/build.sbt | <reponame>harborx/play-di-example
name := """play-guice"""
version := "1.0.0"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.8"
scalacOptions := Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-Ywarn-dead-code",
"-Ywarn-n... |
harborx/play-di-example | play-macwire/test/com/harborx/api/system/SystemControllerSpec.scala | <filename>play-macwire/test/com/harborx/api/system/SystemControllerSpec.scala
package com.harborx.api.system
import com.harborx.api.SimpleEnvConfigProvider
import com.harborx.api.modules.SystemModule
import org.scalamock.scalatest.MockFactory
import org.scalatestplus.play.PlaySpec
import play.api.mvc._
import play.api... |
harborx/play-di-example | play-macwire/app/com/harborx/api/AppApplicationLoader.scala | package com.harborx.api
import com.harborx.api.modules._
import play.api.ApplicationLoader.Context
import play.api._
import play.api.routing.Router
import router.Routes
import com.softwaremill.macwire._
class AppApplicationLoader extends ApplicationLoader {
def load(context: Context): Application = new HxAppCompone... |
harborx/play-di-example | play-guice/app/com/harborx/api/singleton/AppSingleton.scala | package com.harborx.api.singleton
import javax.inject._
import com.google.inject.ImplementedBy
import play.api.Logger
import play.api.inject.ApplicationLifecycle
import scala.concurrent.Future
@ImplementedBy(classOf[AppSingletonImpl])
trait AppSingleton {
}
@Singleton
class AppSingletonImpl @Inject() (lifecycle: ... |
harborx/play-di-example | play-macwire/app/com/harborx/api/device/DeviceRepositoryImpl.scala | package com.harborx.api.device
trait DeviceRepository {
def getDevice(id: Int): Device
}
class DeviceRepositoryImpl extends DeviceRepository {
def getDevice(id: Int): Device = Device(id)
}
|
harborx/play-di-example | play-macwire/test/com/harborx/api/SimpleEnvConfigProvider.scala | package com.harborx.api
import com.harborx.api.modules.CoreModule
import play.api.{Configuration, Environment}
trait SimpleEnvConfigProvider {
this: CoreModule =>
// dependence
override def configuration: Configuration = Configuration.load(environment)
override def environment: Environment = Environment.sim... |
harborx/play-di-example | play-macwire/app/com/harborx/api/device/DeviceController.scala | <reponame>harborx/play-di-example
package com.harborx.api.device
import play.api.mvc.{Action, Controller}
class DeviceController(deviceService: DeviceService) extends Controller {
def get() = Action {
val d = deviceService.getDevice(1)
Ok(d.toString)
}
}
|
harborx/play-di-example | play-guice/app/com/harborx/api/device/DeviceService.scala | package com.harborx.api.device
import com.google.inject.ImplementedBy
import javax.inject._
@ImplementedBy(classOf[DeviceServiceImpl])
trait DeviceService {
def getDevice(id: Int): Device
}
/**
* Impl with DeviceServiceImpl is not happy
* If we forgot to extends, can compile, but run time error!!
*/
class Devi... |
harborx/play-di-example | play-macwire/app/com/harborx/api/singleton/AppSingleton.scala | <reponame>harborx/play-di-example<gh_stars>1-10
package com.harborx.api.singleton
import play.api.{Configuration, Logger}
import play.api.inject.ApplicationLifecycle
import scala.concurrent.Future
class AppSingleton(configuration: Configuration, applicationLifecycle: ApplicationLifecycle) {
protected val logger = ... |
harborx/play-di-example | play-guice/test/com/harborx/api/device/DeviceSpec.scala | <filename>play-guice/test/com/harborx/api/device/DeviceSpec.scala
package com.harborx.api.device
import org.scalatest._
import org.scalatestplus.play.{PlaySpec, _}
import play.api.inject.bind
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.mvc._
import play.api.test.FakeRequest
import play.api.tes... |
harborx/play-di-example | play-guice/test/com/harborx/api/device/DeviceControllerSpec.scala | package com.harborx.api.device
import org.scalamock.scalatest.MockFactory
import org.scalatestplus.play.PlaySpec
import play.api.mvc._
import play.api.test.FakeRequest
import play.api.test.Helpers._
import scala.concurrent.Future
/**
* Test for controller logic
* So we mock service here
*/
class DeviceControll... |
harborx/play-di-example | play-guice/app/com/harborx/api/device/DeviceRepository.scala | <filename>play-guice/app/com/harborx/api/device/DeviceRepository.scala
package com.harborx.api.device
import com.google.inject.ImplementedBy
/**
* easy to forgot or make typo!
*/
@ImplementedBy(classOf[DeviceRepositoryImpl])
trait DeviceRepository {
def getDevice(id: Int): Device
}
/**
* Impl with DeviceReposit... |
harborx/play-di-example | play-guice/app/com/harborx/api/device/DeviceController.scala | <filename>play-guice/app/com/harborx/api/device/DeviceController.scala
package com.harborx.api.device
import javax.inject._
import play.api.mvc.{Action, Controller}
class DeviceController @Inject() (deviceService: DeviceService) extends Controller {
def get() = Action {
val d = deviceService.getDevice(1)
... |
harborx/play-di-example | play-macwire/app/com/harborx/api/modules/CoreModule.scala | package com.harborx.api.modules
import play.api.{Configuration, Environment}
trait CoreModule {
// dependence
// AppApplicationLoader and HxAppComponents will help to load(?) it.
def configuration: Configuration
def environment: Environment
}
|
harborx/play-di-example | play-macwire/app/com/harborx/api/device/DeviceServiceImpl.scala | package com.harborx.api.device
trait DeviceService {
def getDevice(id: Int): Device
}
class DeviceServiceImpl(deviceRepository: DeviceRepository) extends DeviceService {
/**
* simple proxy impl for testing
*/
def getDevice(id: Int): Device = {
deviceRepository.getDevice(id)
}
}
|
harborx/play-di-example | play-guice/test/com/harborx/api/device/DeviceServiceSpec.scala | package com.harborx.api.device
import org.scalamock.scalatest.MockFactory
import org.scalatest.GivenWhenThen
import org.scalatestplus.play.PlaySpec
/**
* We shall use our custom Spec instead of PlaySpec in real life
* Test for service layer logic here, so we stub DeviceRepository
* TODO: Test for DeviceReposito... |
harborx/play-di-example | play-macwire/test/com/harborx/api/device/DeviceControllerSpec.scala | <reponame>harborx/play-di-example
package com.harborx.api.device
import com.harborx.api.modules.DeviceModule
import org.scalamock.scalatest.MockFactory
import org.scalatestplus.play.PlaySpec
import play.api.mvc._
import play.api.test.FakeRequest
import play.api.test.Helpers._
import scala.concurrent.Future
/**
* T... |
harborx/play-di-example | play-macwire/test/com/harborx/api/device/DeviceSpec.scala | <gh_stars>1-10
package com.harborx.api.device
import com.harborx.api.{HxAppComponents, OneAppPerTestWithComponents}
import org.scalamock.scalatest.MockFactory
import org.scalatest._
import org.scalatestplus.play.PlaySpec
import play.api.ApplicationLoader.Context
import play.api.mvc._
import play.api.test.FakeRequest
i... |
harborx/play-di-example | play-macwire/app/com/harborx/api/device/Device.scala | <reponame>harborx/play-di-example<gh_stars>1-10
package com.harborx.api.device
case class Device(id: Int) |
harborx/play-di-example | play-macwire/app/com/harborx/api/modules/DeviceModule.scala | package com.harborx.api.modules
import com.harborx.api.device._
trait DeviceModule {
import com.softwaremill.macwire._
lazy val deviceController: DeviceController = wire[DeviceController]
lazy val deviceService: DeviceService = wire[DeviceServiceImpl]
lazy val deviceRepository: DeviceRepository = wire[... |
jarredlim/effpi-error-detection | examples/src/main/scala/recovery/test.scala | package effpi.examples.recovery.test
import scala.concurrent.duration.Duration
import effpi.channel.{Channel => Chan, InChannel => IChan, OutChannel => OChan}
import effpi.process._
import effpi.process.dsl._
import scala.util.Random
package object types {
case class Data()
type T1 = OK | Req
case class OK()... |
hmrc/organisations-matching-api | test/unit/uk/gov/hmrc/organisationsmatchingapi/services/MatchingServiceSpec.scala | <gh_stars>0
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
hmrc/organisations-matching-api | test/unit/uk/gov/hmrc/organisationsmatchingapi/domain/organisationsmatching/SaKnownFactsSpec.scala | <reponame>hmrc/organisations-matching-api
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... |
hmrc/organisations-matching-api | app/uk/gov/hmrc/organisationsmatchingapi/domain/ogd/SaMatchingRequest.scala | /*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.