Skip to content
Snippets Groups Projects
Commit b7abe2ef authored by Philippe Suter's avatar Philippe Suter Committed by Rodric Rabbah
Browse files

Fix Scala deprecation warnings in code and tests.

Remove semicolons from PingTests.
parent 44357598
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ class NodeJsActionContainerTests extends FlatSpec with Matchers {
val argss = List(
JsObject("greeting" -> JsString("hi!")),
JsObject("numbers" -> JsArray(Vector(JsNumber(42), JsNumber(1)))))
JsObject("numbers" -> JsArray(JsNumber(42), JsNumber(1))))
for (args <- argss) {
val (runCode, out) = c.run(runPayload(args))
......
......@@ -56,7 +56,7 @@ class SwiftActionContainerTests extends FlatSpec
val argss = List(
JsObject("greeting" -> JsString("hi!")),
JsObject("numbers" -> JsArray(Vector(JsNumber(42), JsNumber(1)))))
JsObject("numbers" -> JsArray(JsNumber(42), JsNumber(1))))
for (args <- argss) {
val (runCode, out) = c.run(runPayload(args))
......
......@@ -37,8 +37,8 @@ import common.WhiskProperties
*/
object PingTests {
val bin: File = WhiskProperties.getFileRelativeToWhiskHome("tools/health")
def isAlive(name: String, whiskPropertyFile: String) : (String,String) = {
def isAlive(name: String, whiskPropertyFile: String): (String, String) = {
val p = TestUtils.runCmd(TestUtils.SUCCESS_EXIT, bin, WhiskProperties.python, "isAlive", "-d", whiskPropertyFile, "--wait", "30", name)
(p.fst, p.snd)
}
......@@ -52,7 +52,7 @@ class PingTests {
* Check that the docker REST interface at endpoint is up. envVar is the
* environment variable from which we obtain.
*/
def pingDocker(envVar: String, endpoint: String) : Unit = {
def pingDocker(envVar: String, endpoint: String): Unit = {
assertTrue(envVar + " not set", endpoint != null)
assertTrue(envVar + " not set", endpoint.length() > 0)
......@@ -66,47 +66,47 @@ class PingTests {
* Check that the main docker endpoint is functioning.
*/
@Test
def pingMainDocker() : Unit = {
pingDocker("main.docker.endpoint", WhiskProperties.getMainDockerEndpoint());
def pingMainDocker(): Unit = {
pingDocker("main.docker.endpoint", WhiskProperties.getMainDockerEndpoint())
}
/**
* Check the kafka docker endpoint is functioning.
*/
@Test
def pingKafkaDocker() : Unit = {
pingDocker("kafka.docker.endpoint", WhiskProperties.getKafkaDockerEndpoint());
def pingKafkaDocker(): Unit = {
pingDocker("kafka.docker.endpoint", WhiskProperties.getKafkaDockerEndpoint())
}
/**
* Check that the zookeeper endpoint is up and running
*/
@Test
def pingZookeeper() : Unit = {
PingTests.isAlive("zookeeper", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath());
def pingZookeeper(): Unit = {
PingTests.isAlive("zookeeper", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath())
}
/**
* Check that the kafka endpoint is up and running
*/
@Test
def pingKafka() : Unit = {
PingTests.isAlive("kafka", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath());
def pingKafka(): Unit = {
PingTests.isAlive("kafka", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath())
}
/**
* Check that the activator endpoint is up and running
*/
@Test
def pingActivator() : Unit = {
PingTests.isAlive("activator", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath());
def pingActivator(): Unit = {
PingTests.isAlive("activator", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath())
}
/**
* Check that the invoker endpoints are up and running
*/
@Test
def pingInvoker() : Unit = {
def pingInvoker(): Unit = {
for (i <- 0 until WhiskProperties.numberOfInvokers()) {
PingTests.isAlive("invoker" + i, WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath())
}
......@@ -116,15 +116,15 @@ class PingTests {
* Check that the loadbalancer endpoint is up and running
*/
@Test
def pingLoadBalancer() : Unit = {
PingTests.isAlive("loadbalancer", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath());
def pingLoadBalancer(): Unit = {
PingTests.isAlive("loadbalancer", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath())
}
/**
* Check that the controller endpoint is up and running
*/
@Test
def pingController() : Unit = {
PingTests.isAlive("controller", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath());
def pingController(): Unit = {
PingTests.isAlive("controller", WhiskProperties.getFileRelativeToWhiskHome(".").getAbsolutePath())
}
}
......@@ -243,10 +243,10 @@ class SchemaTests extends FlatSpec with BeforeAndAfter {
behavior of "Parameter"
it should "properly deserialize and reserialize JSON" in {
val json = Seq[JsValue](
JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> "v".toJson))),
JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> "v".toJson, "foo" -> "bar".toJson))),
JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> 3.toJson))),
JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> Vector(false, true).toJson))))
JsArray(JsObject("key" -> "k".toJson, "value" -> "v".toJson)),
JsArray(JsObject("key" -> "k".toJson, "value" -> "v".toJson, "foo" -> "bar".toJson)),
JsArray(JsObject("key" -> "k".toJson, "value" -> 3.toJson)),
JsArray(JsObject("key" -> "k".toJson, "value" -> Vector(false, true).toJson)))
val params = json.map { p => Parameters.serdes.read(p) }
assert(params(0) == Parameters("k", "v"))
assert(params(1) == Parameters("k", "v"))
......@@ -301,10 +301,10 @@ class SchemaTests extends FlatSpec with BeforeAndAfter {
}
it should "serialize to json" in {
assert(Parameters("k", null).toString == JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> JsNull))).compactPrint)
assert(Parameters("k", "").toString == JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> "".toJson))).compactPrint)
assert(Parameters("k", " ").toString == JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> "".toJson))).compactPrint)
assert(Parameters("k", "v").toString == JsArray(Vector(JsObject("key" -> "k".toJson, "value" -> "v".toJson))).compactPrint)
assert(Parameters("k", null).toString == JsArray(JsObject("key" -> "k".toJson, "value" -> JsNull)).compactPrint)
assert(Parameters("k", "").toString == JsArray(JsObject("key" -> "k".toJson, "value" -> "".toJson)).compactPrint)
assert(Parameters("k", " ").toString == JsArray(JsObject("key" -> "k".toJson, "value" -> "".toJson)).compactPrint)
assert(Parameters("k", "v").toString == JsArray(JsObject("key" -> "k".toJson, "value" -> "v".toJson)).compactPrint)
}
behavior of "ActionLimits"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment