You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/09/13 09:21:01 UTC

[GitHub] markusthoemmes commented on a change in pull request #2593: Add BaseWsk class for Wsk and WskRest to inherit

markusthoemmes commented on a change in pull request #2593: Add BaseWsk class for Wsk and WskRest to inherit
URL: https://github.com/apache/incubator-openwhisk/pull/2593#discussion_r138567104
 
 

 ##########
 File path: tests/src/test/scala/common/BaseWsk.scala
 ##########
 @@ -0,0 +1,365 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ */
+
+package common
+
+import java.io.BufferedWriter
+import java.io.File
+import java.io.FileWriter
+import java.time.Instant
+
+import scala.concurrent.duration.DurationInt
+import scala.collection.mutable.Buffer
+import scala.concurrent.duration.Duration
+import scala.language.postfixOps
+import org.scalatest.Matchers
+
+import TestUtils._
+import spray.json.JsObject
+import spray.json.JsValue
+import spray.json.pimpString
+import whisk.core.entity.ByteSize
+
+case class WskProps(
+  authKey: String = WhiskProperties.readAuthKey(WhiskProperties.getAuthFileForTesting),
+  cert: String =
+    WhiskProperties.getFileRelativeToWhiskHome("ansible/roles/nginx/files/openwhisk-client-cert.pem").getAbsolutePath,
+  key: String =
+    WhiskProperties.getFileRelativeToWhiskHome("ansible/roles/nginx/files/openwhisk-client-key.pem").getAbsolutePath,
+  namespace: String = "_",
+  apiversion: String = "v1",
+  apihost: String = WhiskProperties.getEdgeHost,
+  token: String = "") {
+  def overrides = Seq("-i", "--apihost", apihost, "--apiversion", apiversion)
+  def writeFile(propsfile: File) = {
+    val propsStr =
+      s"NAMESPACE=$namespace\nAPIVERSION=$apiversion\nAUTH=$authKey\nAPIHOST=$apihost\nAPIGW_ACCESS_TOKEN=$token\n"
 
 Review comment:
   Should we break this into a multi-line string?
   
   ```scala
   val propsStr = s"""NAMESPACE=$namespace
                                 |APIVERSION=$apiversion
                                 |AUTH=$authKey
                                 |APIHOST=$apihost
                                 |APIGW_ACCESS_TOKEN=$token""".stripMargin
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services