The Artima Developer Community
Sponsored Link

Running JUnit Tests with Artima SuiteRunner
by Bill Venners
February 17, 2003

<<  Page 3 of 7  >>

Advertisement

Understanding the Recipe File

In the following command, the first and only argument to the Artima SuiteRunner executable JAR file is the name of a recipe file, accountjunit.srj:
java -jar suiterunner-[release].jar accountjunit.srj

A recipe file is a Java properties file that supplies information needed by Artima SuiteRunner to run a suite of tests. Recipe files contain values for three properties: org.suiterunner.Runpath, org.suiterunner.Suites, and org.suiterunner.Reporters. The contents of accountjunit.srj are:

org.suiterunner.Runpath=-p "example"
org.suiterunner.Suites=-s com.artima.examples.account.ex6test.AccountTestCase
org.suiterunner.Reporters=-g

In accountjunit.srj:

When invoked via the previous command that specifies accountjunit.srj as a command line parameter, Artima SuiteRunner will:

  1. Create a URLClassLoader that can load classes from the example directory, the directory specified in the recipe file's org.suiterunner.Runpath property.
  2. Via the URLClassLoader, attempt to load class com.artima.examples.account.ex6test.AccountTestCase, the class specified in in the recipe file's org.suiterunner.Suites property.
  3. Discover via a NoClassDefFoundError that the com.artima.examples.account.ex6test.AccountTestCase class can't be loaded because its superclass, junit.framework.TestCase, can't be found.
  4. Abort the run and reports the NoClassDefFoundError to the user.

<<  Page 3 of 7  >>


Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us