You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/12/10 18:14:03 UTC

[14/41] incubator-usergrid git commit: Added license headers to files

Added license headers to files


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ecce52d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ecce52d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ecce52d4

Branch: refs/heads/UG-rest-test-framework-overhaul
Commit: ecce52d4fcda80cd063cccbb6ea4934c30c36777
Parents: 1b239b7
Author: Todd Nine <tn...@apigee.com>
Authored: Fri Dec 5 14:15:24 2014 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Fri Dec 5 14:15:24 2014 -0700

----------------------------------------------------------------------
 stack/loadtests/runtests.sh                     | 13 ++++++
 .../apache/usergrid/helpers/Extractors.scala    | 49 ++++++++++----------
 .../org/apache/usergrid/helpers/Setup.scala     | 30 ++++++------
 3 files changed, 53 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ecce52d4/stack/loadtests/runtests.sh
----------------------------------------------------------------------
diff --git a/stack/loadtests/runtests.sh b/stack/loadtests/runtests.sh
index 171d561..0897d25 100755
--- a/stack/loadtests/runtests.sh
+++ b/stack/loadtests/runtests.sh
@@ -1,4 +1,17 @@
 #!/bin/bash
+#
+# 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
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
 
 die() { echo "$@" 1>&2 ; exit 1; }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ecce52d4/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 3e85712..aa8c614 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
@@ -1,35 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * 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
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ *
+ */
 package org.apache.usergrid.helpers
 
 import io.gatling.core.Predef._
 import io.gatling.core.session._
 import io.gatling.http.Predef._
 
-import scala.util.parsing.json.JSONArray
-
 /**
  * Helper object that will perform extractions
  */
 object Extractors {
 
-//  /**
-//   * Will extract the cursor from the response.  If the cursor is not present, an empty string will be set
-//   */
-//  val maybeExtractCursor = 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("cursor")
-//
-//  /**
-//   * Will extract entities as a json array into the session. If they do not exist, it will set to an empty list
-//   */
-//  val maybeExtractEntities = jsonPath("..entities").transformOption(extract => {
-//      extract.orElse(Some(JSONArray(List())));
-//    }).saveAs("entities")
-
   /**
    * Will extract the cursor from the response.  If the cursor is not present, an empty string will be set
    */
-  def maybeExtractCursor(saveAsName : String) = {
+  def maybeExtractCursor(saveAsName: String) = {
     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(""))
@@ -42,7 +44,7 @@ object Extractors {
    * @param nameInSession The name of the variable in the session
    * @return
    */
-  def stringParamExists (nameInSession: String) : Expression[Boolean] = {
+  def stringParamExists(nameInSession: String): Expression[Boolean] = {
     session => session(nameInSession) != null && session(nameInSession).as[String] != ""
   }
 
@@ -61,12 +63,12 @@ object Extractors {
    * @param nameInSession  The name ot use when saving to the session
    * @return
    */
-  def sequenceHasElements(nameInSession: String) : Expression[Boolean] = {
+  def sequenceHasElements(nameInSession: String): Expression[Boolean] = {
     session => session(nameInSession) != null && session(nameInSession).as[Seq[Any]].length > 0
   }
 
 
-      val ManagementToken: String = Setup.getManagementToken()
+  val ManagementToken: String = Setup.getManagementToken()
 
 
   /**
@@ -74,10 +76,9 @@ object Extractors {
    * under the variable "authToken"
    * @return
    */
-  def injectStaticTokenToSession() : Expression[Session] = {
-      session => session.set("authToken", ManagementToken)
+  def injectStaticTokenToSession(): Expression[Session] = {
+    session => session.set("authToken", ManagementToken)
   }
 
 
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ecce52d4/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
index 2dd0ed7..fb0bcde 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Setup.scala
@@ -1,20 +1,20 @@
 /*
  *
- *  * Licensed to the Apache Software Foundation (ASF) under one or more
- *  *  contributor license agreements.  The ASF licenses this file to You
- *  * 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
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.  For additional information regarding
- *  * copyright in this work, please see the NOTICE file in the top level
- *  * directory of this distribution.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * 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
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
  *
  */