我正在使用scala在我的播放框架上运行测试 我有一个带有一些测试的scala类,它们都是这样的:
@RunWith(classOf[JUnitRunner])
class UpdateProductTest extends Specification
{
abstract class WithDbData extends WithApplication {
}
"Product DB Repository" should
{
//This is test #1 !
"add product with minimal fields" in new WithDbData
{
val name = Some(LocalizedItem(IdGenerator.newId, "testName"))
val description = Some(LocalizedItem(IdGenerator.newId, "testDescription"))
val product = new Product(Option(IdGenerator.newId), "defaultTestName", "defaultTestDescription",
Some(1), None, None, None,
None, new References(Some("1"), Some("1"), Some("1"), Some("1")), None, None,
name,description, None)
val productRepository = new ProductDbRepositoryImpl()
productRepository.addProduct("en_US", "1", product)
}
}
"Product DB Repository" should // <= i wish to run only this test and ignore the test above!!
{
val image1:ProductImage = new ProductImage(java.util.UUID.randomUUID().toString, Some("high resultion"), Some("url to image 1"), Some(1))
val image2:ProductImage = new ProductImage(java.util.UUID.randomUUID().toString, Some("low resolution"), Some("url to image 2"), Some(1))
//This is test #2 !
"add product with minimal fields and images" in new WithDbData
{
.....
}
我的问题是所有测试都以 运行开始,我只想在此课程中运行测试#2 - 我该怎么办?
谢谢!