Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Add load config from file test
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusMtnez committed Feb 22, 2017
1 parent 64c2248 commit 3c838cc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/test/resources/zookeeper-catalog.conf
Expand Up @@ -5,9 +5,9 @@
##########################################


crossdata-core.catalog.zookeeper.connectionString = "localhost:2181"
crossdata-core.catalog.zookeeper.connectionTimeout = 15000
crossdata-core.catalog.zookeeper.sessionTimeout = 60000
crossdata-core.catalog.zookeeper.retryAttempts = 5
crossdata-core.catalog.zookeeper.retryInterval = 10000
crossdata-core.catalog.prefix = "crossdataCluster"
crossdata-core.config.catalog.zookeeper.connectionString = "localhost:2181"
crossdata-core.config.catalog.zookeeper.connectionTimeout = 15000
crossdata-core.config.catalog.zookeeper.sessionTimeout = 60000
crossdata-core.config.catalog.zookeeper.retryAttempts = 5
crossdata-core.config.catalog.zookeeper.retryInterval = 10000
crossdata-core.config.catalog.prefix = "crossdataCluster"
Expand Up @@ -15,6 +15,7 @@
*/
package org.apache.spark.sql.crossdata

import java.io.File
import java.nio.file.Paths

import com.typesafe.config.ConfigFactory
Expand Down Expand Up @@ -68,7 +69,22 @@ class XDSessionIT extends SharedXDSession with ScalaFutures {
whenReady(sessionsFuture) { sessions: Seq[XDSession] =>
sessions.map(_.id).toSet should have size 10
} (PatienceConfig(timeout = 2 seconds))
}

it should "load catalog config from file" in {

val session = XDSession
.builder()
.config("src/test/resources/zookeeper-catalog.conf")
.create("user")

session.catalogConfig.isEmpty shouldBe false
session.catalogConfig.getString("zookeeper.connectionString") shouldBe "localhost:2181"
session.catalogConfig.getInt("zookeeper.connectionTimeout") shouldBe 15000
session.catalogConfig.getInt("zookeeper.sessionTimeout") shouldBe 60000
session.catalogConfig.getInt("zookeeper.retryAttempts") shouldBe 5
session.catalogConfig.getInt("zookeeper.retryInterval") shouldBe 10000
session.catalogConfig.getString("prefix") shouldBe "crossdataCluster"
}

/*
Expand Down

0 comments on commit 3c838cc

Please sign in to comment.