2012-01-17 39 views
2

使用configMap基本上我需要的是如何使用ConfigMap類可在scalatest項目的例子,這樣我可以例如在Scalatest

  1. 參考源代碼
  2. 使用CONFG值 - 在命令行上使用Scalatest轉輪運行Scalatest Dparametername =值,例如 scala -classpath scalatest-<version>.jar org.scalatest.tools.Runner -Dparam1=value1 -p compiled_tests

我使用Scalatest 1.6.1,這裏的信息http://www.scalatest.org/scaladoc/1.6.1/org/scalatest/Suite.html#configMapSection不是非常特異性的,並且在實施例中如何使用configMap here在FixtureSuite似乎並沒有與配置地圖裏傳遞給了很多地方Scalatest-1.6.1

謝謝〜

回答

2

工作。你將如何使用它取決於你需要做什麼。你能提供更多你想要完成的信息嗎?

配置映射被傳遞給run,runTests,runTest,runNestedSuites和withFixture(都是NoArgTest和OneArgTest變體),所以你可以通過重寫你的測試類中的方法來從中選擇它。如果混入BeforeAndAfterEach,它也會傳遞給beforeEach的重載形式。

您指出的withFixture(OneArgTest)示例應該在1.6.1中工作。我會檢查它以確保。