You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/11/02 23:55:58 UTC
[07/50] [abbrv] usergrid git commit: USERGRID-1044: make jsonPath
extraction optional to keep users from exiting
USERGRID-1044: make jsonPath extraction optional to keep users from exiting
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3c60c49a
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3c60c49a
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3c60c49a
Branch: refs/heads/USERGRID-909
Commit: 3c60c49a157be63ec626ff88666472f2d4876554
Parents: 1a6de02
Author: Mike Dunker <md...@apigee.com>
Authored: Tue Oct 27 08:52:17 2015 -0700
Committer: Mike Dunker <md...@apigee.com>
Committed: Tue Oct 27 08:52:17 2015 -0700
----------------------------------------------------------------------
.../org/apache/usergrid/helpers/Extractors.scala | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/3c60c49a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
index 136a561..b21f9d7 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala
@@ -37,7 +37,7 @@ object Extractors {
jsonPath("$.cursor").transformOption(extract => {
//it may or may not be present. If it is, save it, otherwise save it as an empty string
extract.orElse(Some(""))
- }).saveAs(saveAsName)
+ }).optional.saveAs(saveAsName)
}
/**
@@ -47,7 +47,7 @@ object Extractors {
jsonPath("$.entities[0].uuid").transformOption(extract => {
//it may or may not be present. If it is, save it, otherwise save it as an empty string
extract.orElse(Some(""))
- }).saveAs(saveAsName)
+ }).optional.saveAs(saveAsName)
}
/**
@@ -57,7 +57,7 @@ object Extractors {
jsonPath("$.entities[0].name").transformOption(extract => {
//it may or may not be present. If it is, save it, otherwise save it as an empty string
extract.orElse(Some(""))
- }).saveAs(saveAsName)
+ }).optional.saveAs(saveAsName)
}
/**
@@ -67,21 +67,25 @@ object Extractors {
jsonPath("$.entities[0].modified").ofType[Long].transformOption(extract => {
//it may or may not be present. If it is, save it, otherwise save it as -1
extract.orElse(Some(-1))
- }).saveAs(saveAsName)
+ }).optional.saveAs(saveAsName)
}
/**
* Will extract the audit entities from the get collection response.
*/
def extractAuditEntities(saveAsName: String) = {
- jsonPath("$.entities[*]").ofType[Map[String,Any]].findAll.transformOption(extract => { extract.orElse(Some(Seq.empty)) }).saveAs(saveAsName)
+ jsonPath("$.entities[*]").ofType[Map[String,Any]].findAll.transformOption(extract => {
+ extract.orElse(Some(Seq.empty))
+ }).optional.saveAs(saveAsName)
}
/**
* Will extract the audit entities from the get collection response.
*/
def extractAuditEntity(saveAsName: String) = {
- jsonPath("$.entities[0]").ofType[Map[String,Any]].findAll.transformOption(extract => { extract.orElse(Some(Seq.empty)) }).saveAs(saveAsName)
+ jsonPath("$.entities[0]").ofType[Map[String,Any]].findAll.transformOption(extract => {
+ extract.orElse(Some(Seq.empty))
+ }).optional.saveAs(saveAsName)
}
/**
@@ -100,7 +104,7 @@ object Extractors {
def maybeExtractEntities(saveAsName: String) = {
jsonPath("$.entities").ofType[Seq[Any]].transformOption(extract => {
extract.orElse(Some(Seq()))
- }).saveAs(saveAsName)
+ }).optional.saveAs(saveAsName)
}
/**