From 5c508b695694c5e655947485334ba089ddab0c2f Mon Sep 17 00:00:00 2001 From: Philippe Suter <psuter@us.ibm.com> Date: Wed, 12 Oct 2016 10:38:41 -0400 Subject: [PATCH] Added a `binary` field to action records. Only applies to actions that hold code (i.e. not blackbox or sequence). Additional refactorings to how `Exec`s are represented. --- tests/src/whisk/core/entity/test/SchemaTests.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/src/whisk/core/entity/test/SchemaTests.scala b/tests/src/whisk/core/entity/test/SchemaTests.scala index ae655937..f210a138 100644 --- a/tests/src/whisk/core/entity/test/SchemaTests.scala +++ b/tests/src/whisk/core/entity/test/SchemaTests.scala @@ -207,11 +207,11 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with Matchers { it should "properly deserialize and reserialize JSON" in { val json = Seq[JsObject]( - JsObject("kind" -> "nodejs".toJson, "code" -> "js1".toJson), - JsObject("kind" -> "nodejs".toJson, "code" -> "js2".toJson, "init" -> "zipfile2".toJson), - JsObject("kind" -> "nodejs".toJson, "code" -> "js3".toJson, "init" -> "zipfile3".toJson, "foo" -> "bar".toJson), + JsObject("kind" -> "nodejs".toJson, "code" -> "js1".toJson, "binary" -> false.toJson), + JsObject("kind" -> "nodejs".toJson, "code" -> "js2".toJson, "binary" -> false.toJson, "init" -> "zipfile2".toJson), + JsObject("kind" -> "nodejs".toJson, "code" -> "js3".toJson, "binary" -> false.toJson, "init" -> "zipfile3".toJson, "foo" -> "bar".toJson), JsObject("kind" -> "blackbox".toJson, "image" -> "container1".toJson), - JsObject("kind" -> "swift".toJson, "code" -> "swift1".toJson)) + JsObject("kind" -> "swift".toJson, "code" -> "swift1".toJson, "binary" -> false.toJson)) val execs = json.map { e => Exec.serdes.read(e) } @@ -262,9 +262,9 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with Matchers { it should "serialize to json" in { val execs = Seq(Exec.bb("container"), Exec.js("js"), Exec.js("js", "zipfile"), Exec.swift("swft")).map { _.toString } assert(execs(0) == JsObject("kind" -> "blackbox".toJson, "image" -> "container".toJson).compactPrint) - assert(execs(1) == JsObject("kind" -> "nodejs".toJson, "code" -> "js".toJson).compactPrint) - assert(execs(2) == JsObject("kind" -> "nodejs".toJson, "code" -> "js".toJson, "init" -> "zipfile".toJson).compactPrint) - assert(execs(3) == JsObject("kind" -> "swift".toJson, "code" -> "swft".toJson).compactPrint) + assert(execs(1) == JsObject("kind" -> "nodejs".toJson, "code" -> "js".toJson, "binary" -> false.toJson).compactPrint) + assert(execs(2) == JsObject("kind" -> "nodejs".toJson, "code" -> "js".toJson, "binary" -> false.toJson, "init" -> "zipfile".toJson).compactPrint) + assert(execs(3) == JsObject("kind" -> "swift".toJson, "code" -> "swft".toJson, "binary" -> false.toJson).compactPrint) } behavior of "Parameter" -- GitLab