|
Re: ScalaTest 0.9.1 Released
|
Posted: Jan 25, 2008 8:24 PM
|
|
> I always thought that Sweet would be the best name for a > unit test framework, ever. But, I'm kinda goofy. > > Lets see... > > Sweet > ScalaTestSweet > SweetScalaTest > Or just "Suite!". SuiteRunner I thought wasn't bad, but it was too long and a bit boring.
> Anyway, I just talked to Cedric and he said he had no > bandwidth for much related to TestNG and Scala. I really > want to work on a Scala test framework, so, keep me filled > in if I can help. > Well, since you're doing TestNG stuff, would you like to work on the org.scalatest.testng package? The first thing to be done is hopefully a trait, but maybe a class, named TestNGSuite, which extends Suite and overrides execute. The goal is to be able to write test classes using TestNG annotations that can be run with either as TestNG test classes or as ScalaTest Suites. This would allow people to write TestNG classes in Scala like you've been wanting to do, but they can use more Scala-like assertion syntax provided by ScalaTest, as in:
@Test(groups = { "checkin-test" }) class All extends TestNGSuite {
@Test(groups = { "func-test" ) def method1() { expect(List(1, 2)) { List(1) ::: List(2) } }
def method2() { assert(List(1, 2) === 1 :: List(2)) } }
Ideally people could do anything in those classes that they could do in a regular TestNG class, and have it do the same thing TestNG would do when you invoke execute on it. The way I figured we could do that is to actually ask TestNG to run the Suite. So what TestNG.execute would need to do is somehow translate the parameters that are being passed into execute into something a TestNG runner understands, so that the tests would be run by TestNG's code and reports sent back to the ScalaTest Reporter that was passed to execute.
What I was planning to do next was integrate with ScalaCheck, then JUnit 3, and after that try TestNG. But if you want to try it that would be great.
The other thing I wanted to have in org.scalatest.testng was probably a class called TestNGWrapperSuite, which extends Suite and simply wraps existing TestNG tests, which are most likely written in Java. The idea would be that you could start writing new tests in Scala, continue to maintain and enhance your existing TestNG tests in Java, and run them all together with ScalaTest. So that is the other task in that area. Interested in trying your hand at this?
|
|