You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@s2graph.apache.org by st...@apache.org on 2019/01/25 22:49:10 UTC

[18/20] incubator-s2graph git commit: fix the bug: broken test

fix the bug: broken test


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

Branch: refs/heads/master
Commit: 8c3f4a28d4681999b04575eec250d02102d3bbd6
Parents: 4bcf9d9
Author: daewon <da...@apache.org>
Authored: Thu Jan 24 20:59:10 2019 +0900
Committer: daewon <da...@apache.org>
Committed: Thu Jan 24 20:59:10 2019 +0900

----------------------------------------------------------------------
 .../scala/org/apache/s2graph/graphql/TestGraph.scala   |  2 +-
 .../scala/org/apache/s2graph/http/AdminRouteSpec.scala | 10 +++++++---
 .../org/apache/s2graph/http/MutateRouteSpec.scala      | 13 ++++++++++---
 3 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/8c3f4a28/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
----------------------------------------------------------------------
diff --git a/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala b/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
index ef01d52..dc578bb 100644
--- a/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
+++ b/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
@@ -85,7 +85,7 @@ class EmptyGraph(config: Config) extends TestGraph {
 
   override def cleanup(): Unit = graph.shutdown(true)
 
-  override def schema: Schema[GraphRepository, Any] = new SchemaDef(s2Repository).S2GraphSchema
+  override def schema: Schema[GraphRepository, Any] = new SchemaDef(s2Repository).schema
 
   override def showSchema: String = SchemaRenderer.renderSchema(schema)
 

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/8c3f4a28/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
----------------------------------------------------------------------
diff --git a/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala b/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
index 26a7045..42ddda0 100644
--- a/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
+++ b/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
@@ -12,12 +12,16 @@ import org.slf4j.LoggerFactory
 import play.api.libs.json.{JsString, JsValue, Json}
 
 class AdminRoutesSpec extends WordSpec with Matchers with ScalaFutures with ScalatestRouteTest with S2GraphAdminRoute with BeforeAndAfterAll {
-  val config = ConfigFactory.load()
-  val s2graph = new S2Graph(config)
+  import scala.collection.JavaConverters._
+
+  val dbUrl = "jdbc:h2:file:./var/metastore_admin_route;MODE=MYSQL;AUTO_SERVER=true"
+  val config =
+    ConfigFactory.parseMap(Map("db.default.url" -> dbUrl).asJava)
+  lazy val s2graph = new S2Graph(config.withFallback(ConfigFactory.load()))
   override val logger = LoggerFactory.getLogger(this.getClass)
 
   override def afterAll(): Unit = {
-    s2graph.shutdown()
+    s2graph.shutdown(true)
   }
 
   lazy val routes = adminRoute

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/8c3f4a28/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
----------------------------------------------------------------------
diff --git a/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala b/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
index 943db98..7a3d2ab 100644
--- a/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
+++ b/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
@@ -4,6 +4,7 @@ import akka.http.scaladsl.marshalling.Marshal
 import akka.http.scaladsl.model._
 import akka.http.scaladsl.testkit.ScalatestRouteTest
 import com.typesafe.config.ConfigFactory
+import org.apache.s2graph.core.Management.JsonModel.Prop
 import org.apache.s2graph.core.S2Graph
 import org.scalatest.concurrent.ScalaFutures
 import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpec}
@@ -11,12 +12,17 @@ import org.slf4j.LoggerFactory
 import play.api.libs.json.{JsValue, Json}
 
 class MutateRouteSpec extends WordSpec with Matchers with PlayJsonSupport with ScalaFutures with ScalatestRouteTest with S2GraphMutateRoute with BeforeAndAfterAll {
-  val config = ConfigFactory.load()
-  val s2graph = new S2Graph(config)
+
+  import scala.collection.JavaConverters._
+
+  val dbUrl = "jdbc:h2:file:./var/metastore_mutate_route;MODE=MYSQL;AUTO_SERVER=true"
+  val config =
+    ConfigFactory.parseMap(Map("db.default.url" -> dbUrl).asJava)
+  lazy val s2graph = new S2Graph(config.withFallback(ConfigFactory.load()))
   override val logger = LoggerFactory.getLogger(this.getClass)
 
   override def afterAll(): Unit = {
-    s2graph.shutdown()
+    s2graph.shutdown(true)
   }
 
   lazy val routes = mutateRoute
@@ -28,6 +34,7 @@ class MutateRouteSpec extends WordSpec with Matchers with PlayJsonSupport with S
 
     "be able to insert vertex (POST /mutate/vertex/insert)" in {
       s2graph.management.createService(serviceName, "localhost", s"${serviceName}-dev", 1, None)
+      s2graph.management.createServiceColumn(serviceName, columnName, "string", Seq(Prop("age", "0", "integer")))
 
       // {"timestamp": 10, "serviceName": "s2graph", "columnName": "user", "id": 1, "props": {}}
       val param = Json.obj(