Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
| def lambda_handler(event, context): | |
| import subprocess | |
| result = subprocess.call("curl -I http://foo.bar", shell=True) | |
| return result | |
| task runLoadTest(type: JavaExec) { | |
| classpath = sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath + sourceSets.e2eTest.runtimeClasspath | |
| jvmArgs = [ '-Dgatling.core.directory.binaries=./build/classes/e2eTest' ] | |
| // Gatling application | |
| main = "io.gatling.app.Gatling" | |
| // Specify the simulation to run | |
| args = Eval.me("['-s', 'BasicSimulation']") | |
| } |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
| package org.lnu.is.integration.person | |
| import java.util.UUID | |
| import scala.concurrent.duration.DurationInt | |
| import io.gatling.core.Predef.checkBuilder2Check | |
| import io.gatling.core.Predef.findCheckBuilder2ValidatorCheckBuilder | |
| import io.gatling.core.Predef.scenario | |
| import io.gatling.core.Predef.stringToExpression |
| import io.gatling.core.Predef._ | |
| import io.gatling.http.Predef._ | |
| import scala.concurrent.duration._ | |
| class BasicSimulation extends Simulation { | |
| val passwords = csv("passwords.csv") | |
| def setPassNum = exec(session => | |
| session.set("passwordNumber", "3")) |
| package computerdatabase | |
| import io.gatling.core.Predef._ | |
| import io.gatling.http.Predef._ | |
| import scala.concurrent.duration._ | |
| import io.gatling.jsonpath._ | |
| class Test1 extends Simulation { | |
| val httpConf = http |
| package test | |
| import io.gatling.core.Predef._ | |
| import io.gatling.core.structure.PopulatedScenarioBuilder | |
| import io.gatling.core.controller.inject.InjectionStep | |
| import io.gatling.http.Predef._ | |
| import io.gatling.jdbc.Predef._ | |
| import scala.concurrent.duration._ | |
| import scala.collection.mutable.ArraySeq | |
| import org.json.JSONArray; | |
| import org.json.JSONObject; |
| //Scala worksheet | |
| import com.josephpconley.jsonpath.JSONPath | |
| import play.api.libs.json.Json | |
| val store = Json.parse("""{"store":{"book":[{"category":"reference","author":"Nigel Rees","title":"Sayings of the Century","price":8.95},{"category":"fiction","author":"Evelyn Waugh","title":"Sword of Honour","price":12.99},{"category":"fiction","author":"Herman Melville","title":"Moby Dick","isbn":"0-553-21311-3","price":8.99},{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99}],"bicycle":{"color":"red","price":19.95}}}""") | |
| JSONPath.query("$.store.book[*].author", store) | |
| JSONPath.query("$..author", store) | |
| JSONPath.query("$.store.*", store) | |
| JSONPath.query("$.store..price", store) | |
| JSONPath.query("$..book[2]", store) |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <meta name="description" content="[add your bin description]" /> | |
| <meta charset=utf-8 /> | |
| <title>Decimalizer c.2013 - Nadine Whitfield</title> | |
| </head> | |
| <body> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |