ScalaTest

Getting started with JUnit and ScalaTest

In JUnit 3 (the latest release of which is JUnit 3.8), you write tests by extending junit.framework.TestCase and creating methods whose name starts with test. You set up fixtures in the setUp method and tear them down in the tearDown method. If you would like to write ScalaTest tests using JUnit 3, see:

In JUnit 4, your test classes need not extend any particular superclass. You annotate test methods with @Test, set up fixtures in methods marked @Before, and tear them down in methods marked @After. If you would like to write ScalaTest tests using JUnit 4, see:

Also be aware that with ScalaTest's JUnitRunner annotation, you can run any ScalaTest Suite written in any style with JUnit 4.

ScalaTest is brought to you by Bill Venners, with contributions from several other folks. It is sponsored by Artima, Inc.
ScalaTest is free, open-source software released under the Apache 2.0 license.

Copyright © 2009 Artima, Inc. All Rights Reserved.

artima