This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.excilys.ebi.gatling.core.Predef._ | |
import com.excilys.ebi.gatling.http.Predef._ | |
import scala.util.Random | |
import com.excilys.ebi.gatling.core.feeder.Feeder | |
class ServiceSimulation extends Simulation { | |
def apply = { | |
val random = new Random | |
random.setSeed(System.currentTimeMillis) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com) | |
* | |
* 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 agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Write a program that prints out the numbers 1 to 100 (inclusive). | |
If the number is divisible by 3, print Crackle instead of the number. | |
If it's divisible by 5, print Pop. If it's divisible by both 3 and 5, | |
print CracklePop. You can use any language. | |
*/ | |
/// any number x where x % y is divisible by that number. We'll use that fact to match boolean patterns in Scala. | |
//// In Scala RePL, copy-paste the function first. Then use the function in a second call from the REPL. | |
def listEval( number: Int ): String = (number % 3, number % 5 ) match { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package src.main.java; | |
import java.util.Collections; | |
import java.util.List; | |
/** | |
* Created by nwhit8 on 11/1/15. | |
*/ | |
public class Day { |
OlderNewer