Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Commit

Permalink
split multi test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Jul 21, 2021
1 parent 0d5162d commit 1734009
Showing 1 changed file with 33 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.vesoft.nebula.exchange.config.{
import com.vesoft.nebula.exchange.{Argument, KeyPolicy}
import org.apache.log4j.Logger
import org.junit.Test
import org.scalatest.Assertions.assertThrows

class ConfigsSuite {
private[this] val LOG = Logger.getLogger(this.getClass)
Expand Down Expand Up @@ -242,56 +243,53 @@ class ConfigsSuite {
}
}

/**
* correct config
*/
@Test
def DataBaseConfigsSuite(): Unit = {
// correct config
def dataBaseConfigSuite(): Unit = {
val graphAddress = List("127.0.0.1:9669", "127.0.0.1:9670")
val metaAddress = List("127.0.0.1:9559", "127.0.0.1:9560")
val space = "test"
DataBaseConfigEntry(graphAddress, space, metaAddress)
}

// empty space
try {
/**
* empty space
*/
@Test
def dataBaseConfigEmptySpaceSuite: Unit = {
val graphAddress = List("127.0.0.1:9669", "127.0.0.1:9670")
val metaAddress = List("127.0.0.1:9559", "127.0.0.1:9560")
assertThrows[IllegalArgumentException] {
DataBaseConfigEntry(graphAddress, "", metaAddress)
} catch {
case e: IllegalArgumentException => {
LOG.error("we expect here, ", e)
assert(true)
}
case e: Throwable => {
LOG.error("DataBaseConfigSuite failed, ", e)
assert(false)
}
}
}

// wrong graph address
/**
* wrong graph address
*/
@Test
def dataBaseConfigWrongGraphSuite: Unit = {
val wrongGraphAddress = List("127.0.0.1:9669,127.0.0.1:9670")
try {
val space = "test"
val metaAddress = List("127.0.0.1:9559", "127.0.0.1:9560")

assertThrows[IllegalArgumentException] {
DataBaseConfigEntry(wrongGraphAddress, space, metaAddress)
} catch {
case e: IllegalArgumentException => {
LOG.error("we expect here, ", e)
assert(true)
}
case e: Throwable => {
LOG.error("DataBaseConfigSuite failed, ", e)
assert(false)
}
}
}

// wrong meta Address
/**
* wrong meta Address
*/
@Test
def dataBaseConfigWrongMetaSuite: Unit = {
val graphAddress = List("127.0.0.1:9669", "127.0.0.1:9670")
val space = "test"
val wrongMetaAddress = List("127.0.0.1:9559,127.0.0.1:9560")
try {
assertThrows[IllegalArgumentException] {
DataBaseConfigEntry(graphAddress, space, wrongMetaAddress)
} catch {
case e: IllegalArgumentException => {
LOG.error("we expect here, ", e)
assert(true)
}
case e: Throwable => {
LOG.error("DataBaseConfigSuite failed, ", e)
assert(false)
}
}
}
}

0 comments on commit 1734009

Please sign in to comment.