org.scalatest.testng

class TestNGWrapperSuite

[source: org/scalatest/testng/TestNGWrapperSuite.scala]

class TestNGWrapperSuite(xmlSuiteFilenames : scala.List[java.lang.String])
extends TestNGSuite

Suite that wraps existing TestNG test suites, described by TestNG XML config files. This class allows existing TestNG tests written in Java to be run by ScalaTest.

One way to use this class is to extend it and provide a list of one or more names of TestNG XML config file names to run. Here's an example:

 class MyWrapperSuite extends TestNGWrapperSuite(
   List("oneTest.xml", "twoTest.xml", "redTest.xml", "blueTest.xml")
 )
 

You can also specify TestNG XML config files on Runner's command line with -t parameters. See the documentation for Runner for more information.

To execute TestNGWrapperSuites with ScalaTest's Runner, you must include TestNG's jar file on the class path or runpath. This version of TestNGSuite was tested with TestNG version 5.7.

Author
Josh Cough
Method Summary
override def execute (testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, groupsToInclude : scala.collection.immutable.Set[java.lang.String], groupsToExclude : scala.collection.immutable.Set[java.lang.String], properties : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor]) : Unit
Runs TestNG with the XML config file or files provided to the primary constructor, passing reports to the specified Reporter.
Methods inherited from Suite
nestedSuites, execute, execute, groups, testNames, runTest, runTests, runNestedSuites, suiteName, expectedTestCount
Methods inherited from Assertions
assert, assert, assert, assert, convertToEqualizer, intercept, intercept, intercept, expect, expect, fail, fail, fail, fail
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def execute(testName : scala.Option[java.lang.String], reporter : Reporter, stopper : Stopper, groupsToInclude : scala.collection.immutable.Set[java.lang.String], groupsToExclude : scala.collection.immutable.Set[java.lang.String], properties : scala.collection.immutable.Map[java.lang.String, Any], distributor : scala.Option[Distributor]) : Unit
Runs TestNG with the XML config file or files provided to the primary constructor, passing reports to the specified Reporter.
Parameters
testName - If present (Some), then only the method with the supplied name is executed and groups will be ignored.
reporter - The reporter to be notified of test events (success, failure, etc).
groupsToInclude - Contains the names of groups to run. Only tests in these groups will be executed.
groupsToExclude - Tests in groups in this set will not be executed.
stopper - the Stopper may be used to request an early termination of a suite of tests. However, because TestNG does not support the notion of aborting a run early, this class ignores this parameter.
properties - a Map of properties that can be used by the executing Suite of tests. This class does not use this parameter.
distributor - an optional Distributor, into which nested Suites could be put to be executed by another entity, such as concurrently by a pool of threads. If None, nested Suites will be executed sequentially. Because TestNG handles its own concurrency, this class ignores this parameter.

Overrides
TestNGSuite.execute


Copyright (C) 2001-2009 Artima, Inc. All rights reserved.