Permalink
Browse files

Update maven build to gatling 1.3.5

Change-Id: Icab1d676cae4697445ffd0c63278417f19cd1d66
  • Loading branch information...
1 parent c685463 commit b7686031cefef59c18cf526e057ea95de7a13a6f @dsyer dsyer committed Nov 27, 2012
View
@@ -9,11 +9,11 @@
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
- <scala.version>2.9.1</scala.version>
+ <scala.version>2.9.2</scala.version>
<encoding>UTF-8</encoding>
- <gatling.version>1.2.5</gatling.version>
- <gatling-highcharts.version>1.2.5</gatling-highcharts.version>
+ <gatling.version>1.3.5</gatling.version>
+ <gatling-highcharts.version>1.3.5</gatling-highcharts.version>
<maven-scala-plugin.version>2.15.2</maven-scala-plugin.version>
</properties>
@@ -1 +1 @@
-client_id=vmc&scope=read&credentials={"username":"marissa","password":"koala"}&redirect_uri=uri:oauth:token&response_type=token
+client_id=vmc&credentials={"username":"marissa","password":"koala"}&redirect_uri=https://uaa.cloudfoundry.com/redirect/vmc&response_type=token
@@ -0,0 +1,9 @@
+####################################
+# Akka Actor Config File #
+####################################
+
+akka {
+ scheduler {
+ tick-duration = 50ms
+ }
+}
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
@@ -13,7 +13,7 @@
<root>
<level value="WARN" />
- <!--<level value="DEBUG" />-->
+ <!--level value="DEBUG" /-->
<appender-ref ref="CONSOLE" />
</root>
@@ -0,0 +1,22 @@
+
+import com.excilys.ebi.gatling.core.Predef._
+
+import com.excilys.ebi.gatling.http.Predef._
+import java.util.concurrent.TimeUnit
+import uaa.Config._
+import uaa.ScimApi._
+import uaa.{ UniqueUsernamePasswordFeeder, User, UsernamePasswordFeeder }
+
+import uaa.OAuthComponents._
+
+class AuthCodeFlowSimulation extends Simulation {
+
+ def apply = {
+ Seq(
+ scenario("Authorization Code Login")
+ .feed(UsernamePasswordFeeder())
+ .exec(
+ authorizationCodeLogin(appClient)).configure users 1 protocolConfig uaaHttpConfig)
+ }
+
+}
@@ -95,4 +95,5 @@ class UaaSmokeSimulation extends Simulation {
, vmcFailedLogins.configure users 5 protocolConfig uaaHttpConfig
)
}
+
}
@@ -58,13 +58,13 @@ object Config {
secret= "app_client_secret",
scopes = Seq("cloud_controller.read","cloud_controller.write","openid","password.write","tokens.read","tokens.write"),
redirectUri = Some("http://localhost:8080/app"),
- resources = Seq("cloud_controller"),
+ resources = Seq("uaa.none"),
authorities = Seq("cloud_controller.read","cloud_controller.write","openid","password.write","tokens.read","tokens.write"),
grants = Seq("client_credentials", "authorization_code", "refresh_token"))
// Scim client which is registered by the admin user in order to create users
val scimClient = Client("scim_client", "scim_client_secret",
- Seq("uaa.none"), Seq("cloud_controller","scim", "password"), Seq("scim.read","scim.write","password.write"))
+ Seq("uaa.none"), Seq("uaa.none"), Seq("scim.read","scim.write","password.write"))
// The base user data
val users: Seq[User] = (1 to nUsers).map(i => User("shaun" + i, "password"))
@@ -75,7 +75,7 @@ object OAuthCheckBuilder {
// Only used for saving the location header (status code can be used to check for a redirect)
private[uaa] def locationHeaderExtractorFactory: ExtractorFactory[ExtendedResponse, String, String] = response => expression => {
if (response.getStatusCode() != 302)
- println("Reponse is not a redirect")
+ println("Response is not a redirect")
Option(response.getHeader("Location")) orElse(Some("No location header found"))
}
}
@@ -188,7 +188,9 @@ object OAuthComponents {
val redirectUri = client.redirectUri.getOrElse(throw new RuntimeException("Client does not have a redirectUri"))
bootstrap.exec(
- http("Authorization Request")
+ http("Initial Request To Root")
+ .get("/").check(status.is(302)))
+ .exec(http("Authorization Endpoint")
.get("/oauth/authorize")
.queryParam("client_id", client.id)
// .queryParam("scope", client.scopes.mkString(" "))
@@ -1,23 +1,14 @@
-/*
- * Cloud Foundry 2012.02.03 Beta
- * Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
- *
- * This product is licensed to you under the Apache License, Version 2.0 (the "License").
- * You may not use this product except in compliance with the License.
- *
- * This product includes a number of subcomponents with
- * separate copyright notices and license terms. Your use of these
- * subcomponents is subject to the terms and conditions of the
- * subcomponent's license, as noted in the LICENSE file.
- */
-import com.excilys.ebi.gatling.app.{ Options, Gatling }
+import com.excilys.ebi.gatling.app.Gatling
+import com.excilys.ebi.gatling.core.config.GatlingPropertiesBuilder
import com.excilys.ebi.gatling.core.util.PathHelper.path2string
object Engine extends App {
+
+ val props = new GatlingPropertiesBuilder
+ props.dataDirectory(IDEPathHelper.dataDirectory)
+ props.resultsDirectory(IDEPathHelper.resultsDirectory)
+ props.requestBodiesDirectory(IDEPathHelper.requestBodiesDirectory)
+ props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory)
- new Gatling(Options(
- dataFolder = Some(IDEPathHelper.dataFolder),
- resultsFolder = Some(IDEPathHelper.resultsFolder),
- requestBodiesFolder = Some(IDEPathHelper.requestBodiesFolder),
- simulationBinariesFolder = Some(IDEPathHelper.mavenBinariesDir))).start
+ Gatling.fromMap(props.build)
}
@@ -1,30 +1,19 @@
-/*
- * Cloud Foundry 2012.02.03 Beta
- * Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
- *
- * This product is licensed to you under the Apache License, Version 2.0 (the "License").
- * You may not use this product except in compliance with the License.
- *
- * This product includes a number of subcomponents with
- * separate copyright notices and license terms. Your use of these
- * subcomponents is subject to the terms and conditions of the
- * subcomponent's license, as noted in the LICENSE file.
- */
import scala.tools.nsc.io.File
-import scala.tools.nsc.io.Path
+import scala.tools.nsc.io.Path.string2path
+
object IDEPathHelper {
- val gatlingConfUrl = getClass.getClassLoader.getResource("gatling.conf").getPath
+ val gatlingConfUrl = getClass.getClassLoader.getResource("application.conf").getPath
val projectRootDir = File(gatlingConfUrl).parents(2)
- val mavenSourcesDir = projectRootDir / "src" / "main" / "scala"
- val mavenResourcesDir = projectRootDir / "src" / "main" / "resources"
- val mavenTargetDir = projectRootDir / "target"
- val mavenBinariesDir = mavenTargetDir / "classes"
+ val mavenSourcesDirectory = projectRootDir / "src" / "main" / "scala"
+ val mavenResourcesDirectory = projectRootDir / "src" / "main" / "resources"
+ val mavenTargetDirectory = projectRootDir / "target"
+ val mavenBinariesDirectory = mavenTargetDirectory / "classes"
- val dataFolder = mavenResourcesDir / "data"
- val requestBodiesFolder = mavenResourcesDir / "request-bodies"
+ val dataDirectory = mavenResourcesDirectory / "data"
+ val requestBodiesDirectory = mavenResourcesDirectory / "request-bodies"
- val recorderOutputFolder = mavenSourcesDir
- val resultsFolder = mavenTargetDir / "gatling-results"
+ val recorderOutputDirectory = mavenSourcesDirectory
+ val resultsDirectory = mavenTargetDirectory / "results"
}
@@ -1,25 +1,11 @@
-/*
- * Cloud Foundry 2012.02.03 Beta
- * Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
- *
- * This product is licensed to you under the Apache License, Version 2.0 (the "License").
- * You may not use this product except in compliance with the License.
- *
- * This product includes a number of subcomponents with
- * separate copyright notices and license terms. Your use of these
- * subcomponents is subject to the terms and conditions of the
- * subcomponent's license, as noted in the LICENSE file.
- */
import com.excilys.ebi.gatling.core.util.PathHelper.path2string
-import com.excilys.ebi.gatling.recorder.config.Options
+import com.excilys.ebi.gatling.recorder.config.RecorderOptions
import com.excilys.ebi.gatling.recorder.controller.RecorderController
-import IDEPathHelper.{ requestBodiesFolder, recorderOutputFolder }
-
object Recorder extends App {
- RecorderController(Options(
- outputFolder = Some(recorderOutputFolder),
- simulationPackage = Some("${package}"),
- requestBodiesFolder = Some(requestBodiesFolder)))
+ RecorderController(new RecorderOptions(
+ outputFolder = Some(IDEPathHelper.recorderOutputDirectory),
+ simulationPackage = Some("org.test.gatling"),
+ requestBodiesFolder = Some(IDEPathHelper.requestBodiesDirectory)))
}

0 comments on commit b768603

Please sign in to comment.