org.scalatest.tools

# ScalaTestAntTask

#### class ScalaTestAntTask extends Task

An ant task to run ScalaTest. Instructions on how to specify various options are below. See the scaladocs for the `Runner` class for a description of what each of the options does.

To use the ScalaTest ant task, you must first define it in your ant file using `taskdef`. Here's an example:

     &lt;path id="scalatest.classpath"&gt;
       &lt;pathelement location="${lib}/scalatest.jar"/&gt;
       &lt;pathelement location="${lib}/scala-library.jar"/&gt;
     &lt;/path&gt; &lt;target name="main" depends="dist"&gt;
       &lt;taskdef name="scalatest" classname="org.scalatest.tools.ScalaTestAntTask"&gt;
         &lt;classpath refid="scalatest.classpath"/&gt;
       &lt;/taskdef&gt;   &lt;scalatest ...
     &lt;/target&gt;

Once defined, you use the task by specifying information in a `scalatest` element:

      &lt;scalatest ...&gt;
        ...
      &lt;/scalatest&gt;

You can place key value pairs into the `configMap` using nested `&lt;config&gt;` elements, like this:

      &lt;scalatest&gt;
        &lt;config name="dbname" value="testdb"/&gt;
        &lt;config name="server" value="192.168.1.188"/&gt;

You can specify a runpath using either a `runpath` attribute and/or nested`&lt;runpath&gt;` elements, using standard ant path notation:

      &lt;scalatest runpath="serviceuitest-1.1beta4.jar:myjini"&gt;

or

      &lt;scalatest&gt;
        &lt;runpath&gt;
          &lt;pathelement location="serviceuitest-1.1beta4.jar"/&gt;
          &lt;pathelement location="myjini"/&gt;
        &lt;/runpath&gt;

To add a URL to your runpath, use a `&lt;runpathurl&gt;` element (since ant paths don't support URLs):

      &lt;scalatest&gt;
        &lt;runpathurl url="http://foo.com/bar.jar"/&gt;

You can specify reporters using nested `&lt;reporter&gt;` elements, where the `type`attribute must be one of the following:

- `graphic`
- `file`
- `junitxml`
- `stdout`
- `stderr`
- `reporterclass`

Each may include a `config` attribute to specify the reporter configuration. Types `file`, `junitxml` and `reporterclass` require additional attributes`filename`, `directory`, and `classname`, respectively:

      &lt;scalatest&gt;
        &lt;reporter type="stdout"        config="FAB"/&gt;
        &lt;reporter type="file"          filename="test.out"/&gt;
        &lt;reporter type="junitxml"      directory="target"/&gt;
        &lt;reporter type="reporterclass" classname="my.ReporterClass"/&gt;

Specify tags to include and/or exclude using `&lt;tagsToInclude&gt;` and`&lt;tagsToExclude&gt;` elements, like this:

      &lt;scalatest&gt;
        &lt;tagsToInclude&gt;
            CheckinTests
            FunctionalTests
        &lt;/tagsToInclude&gt;    &lt;tagsToExclude&gt;
            SlowTests
            NetworkTests
        &lt;/tagsToExclude&gt;

To specify suites to run, use either a `suite` attribute or nested`&lt;suite&gt;` elements:

      &lt;scalatest suite="com.artima.serviceuitest.ServiceUITestkit"&gt;

or

      &lt;scalatest&gt;
        &lt;suite classname="com.artima.serviceuitest.ServiceUITestkit"/&gt;

To specify suites using members-only or wildcard package names, use either the `membersonly` or `wildcard` attributes, or nested`&lt;membersonly&gt;` or `&lt;wildcard&gt;` elements:

      &lt;scalatest membersonly="com.artima.serviceuitest"&gt;

or

      &lt;scalatest wildcard="com.artima.joker"&gt;

or

      &lt;scalatest&gt;
        &lt;membersonly package="com.artima.serviceuitest"/&gt;
        &lt;wildcard package="com.artima.joker"/&gt;

Use attribute `parallel="true"` to specify parallel execution of suites. (If the `parallel` attribute is left out or set to false, suites will be executed sequentially by one thread.) When `parallel` is true, you can include an optional `numthreads` attribute to specify the number of threads to be created in thread pool (e.g., `numthreads="10"`).

Use attribute `haltonfailure="true"` to cause ant to fail the build if there's a test failure.

Use attribute `fork="true"` to cause ant to run the tests in a separate process.

When `fork` is `true`, attribute `maxmemory` may be used to specify the maximum memory size that will be passed to the forked jvm.&nbsp; For example, the following setting will cause `"-Xmx1280M"` to be passed to the java command used to run the tests.

      &lt;scalatest maxmemory="1280M"&gt;

When `fork` is true, nested `&lt;jvmarg&gt;` elements may be used to pass additional arguments to the forked jvm. For example, if you are running into 'PermGen space' memory errors, you could add the following `jvmarg` to bump up the JVM's `MaxPermSize` value:

      &lt;jvmarg value="-XX:MaxPermSize=128m"/&gt;

known subclasses: ScalaTestTask

authors:

1. George Berger

Inherited

1. Hide All
2. Show all

1. Task
2. ProjectComponent
3. Cloneable
4. AnyRef
5. Any

Visibility

1. Public
2. All

### Instance constructors

1. #### new ScalaTestAntTask()

### Value Members

1. #### def !=(arg0: AnyRef): Boolean

   attributes: final
   definition classes: AnyRef

2. #### def !=(arg0: Any): Boolean

   `o != arg0` is the same as `!(o == (arg0))`.

   `o != arg0` is the same as `!(o == (arg0))`.

   arg0

     the object to compare against this object for dis-equality.

   returns

     `false` if the receiver object is equivalent to the argument; `true` otherwise.

   attributes: final
   definition classes: Any

3. #### def ##(): Int

   attributes: final
   definition classes: AnyRef → Any

4. #### def $asInstanceOf[T0](): T0

   attributes: final
   definition classes: AnyRef

5. #### def $isInstanceOf[T0](): Boolean

   attributes: final
   definition classes: AnyRef

6. #### def ==(arg0: AnyRef): Boolean

   `o == arg0` is the same as `if (o eq null) arg0 eq null else o.equals(arg0)`.

   `o == arg0` is the same as `if (o eq null) arg0 eq null else o.equals(arg0)`.

   arg0

     the object to compare against this object for equality.

   returns

     `true` if the receiver object is equivalent to the argument; `false` otherwise.

   attributes: final
   definition classes: AnyRef

7. #### def ==(arg0: Any): Boolean

   `o == arg0` is the same as `o.equals(arg0)`.

   `o == arg0` is the same as `o.equals(arg0)`.

   arg0

     the object to compare against this object for equality.

   returns

     `true` if the receiver object is equivalent to the argument; `false` otherwise.

   attributes: final
   definition classes: Any

8. #### def addConfiguredConfig(config: NameValuePair): Unit

   Sets values from nested element `config`.

   Sets values from nested element `config`.

9. #### def addConfiguredExcludes(excludes: TextElement): Unit

   Sets value from nested element `excludes`.

   Sets value from nested element `excludes`.The `excludes` attribute has been deprecated and will be removed in a future version of ScalaTest. Please use the `tagsToExclude` attribute instead.

   deprecated:

10. #### def addConfiguredIncludes(includes: TextElement): Unit

    Sets value from nested element `includes`.

    Sets value from nested element `includes`.The `includes` attribute has been deprecated and will be removed in a future version of ScalaTest. Please use the `tagsToInclude` attribute instead.

    deprecated:

11. #### def addConfiguredJvmArg(arg: JvmArg): Unit

    Sets value from nested element `jvmarg`.

    Sets value from nested element `jvmarg`.

12. #### def addConfiguredMembersOnly(membersonly: PackageElement): Unit

    Sets value from nested element `membersonly`.

    Sets value from nested element `membersonly`.

13. #### def addConfiguredProperty(property: NameValuePair): Unit

    Sets values from nested element `property`.

    Sets values from nested element `property`.The `property` attribute has been deprecated and will be removed in a future version of ScalaTest. Please use the `config` attribute instead.

    deprecated:

14. #### def addConfiguredReporter(reporter: ReporterElement): Unit

    Sets value from nested element `reporter`.

    Sets value from nested element `reporter`.

15. #### def addConfiguredRunpath(runpath: Path): Unit

    Sets value from nested element `runpath`.

    Sets value from nested element `runpath`.

16. #### def addConfiguredRunpathUrl(runpathurl: RunpathUrl): Unit

    Sets value from nested element `runpathurl`.

    Sets value from nested element `runpathurl`.

17. #### def addConfiguredSuite(suite: SuiteElement): Unit

    Sets value from nested element `suite`.

    Sets value from nested element `suite`.

18. #### def addConfiguredTagsToExclude(tagsToExclude: TextElement): Unit

    Sets value from nested element `excludes`.

    Sets value from nested element `excludes`.

19. #### def addConfiguredTagsToInclude(tagsToInclude: TextElement): Unit

    Sets value from nested element `tagsToInclude`.

    Sets value from nested element `tagsToInclude`.

20. #### def addConfiguredTestNGSuites(testNGSuitePath: Path): Unit

    Sets value from nested element `testngsuites`.

    Sets value from nested element `testngsuites`.

21. #### def addConfiguredWildcard(wildcard: PackageElement): Unit

    Sets value from nested element `wildcard`.

    Sets value from nested element `wildcard`.

22. #### def asInstanceOf[T0]: T0

    This method is used to cast the receiver object to be of type `T0`.

    This method is used to cast the receiver object to be of type `T0`.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression`1.asInstanceOf[String]` will throw a `ClassCastException` at runtime, while the expression`List(1).asInstanceOf[List[String]]` will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

      the receiver object.

    attributes: final
    definition classes: Any

23. #### def bindToOwner(arg0: Task): Unit

    attributes: final
    definition classes: Task

24. #### def clone(): AnyRef

    This method creates and returns a copy of the receiver object.

    This method creates and returns a copy of the receiver object.

    The default implementation of the `clone` method is platform dependent.

    returns

      a copy of the receiver object.

    definition classes: ProjectComponent → AnyRef

25. #### def eq(arg0: AnyRef): Boolean

    This method is used to test whether the argument (`arg0`) is a reference to the receiver object (`this`).

    This method is used to test whether the argument (`arg0`) is a reference to the receiver object (`this`).

    The `eq` method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on non-null instances of `AnyRef`: * It is reflexive: for any non-null instance `x` of type `AnyRef`, `x.eq(x)` returns `true`. * It is symmetric: for any non-null instances `x` and `y` of type `AnyRef`, `x.eq(y)` returns `true` if and only if `y.eq(x)` returns `true`. * It is transitive: for any non-null instances `x`, `y`, and `z` of type `AnyRef` if `x.eq(y)` returns `true` and `y.eq(z)` returns `true`, then `x.eq(z)` returns `true`.

    Additionally, the `eq` method has three other properties. * It is consistent: for any non-null instances `x` and `y` of type `AnyRef`, multiple invocations of `x.eq(y)` consistently returns `true` or consistently returns `false`. * For any non-null instance `x` of type `AnyRef`, `x.eq(null)` and `null.eq(x)` returns `false`. * `null.eq(null)` returns `true`.

    When overriding the `equals` or `hashCode` methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (`o1 eq o2`), they should be equal to each other (`o1 == o2`) and they should hash to the same value (`o1.hashCode == o2.hashCode`).

    arg0

      the object to compare against this object for reference equality.

    returns

      `true` if the argument is a reference to the receiver object; `false` otherwise.

    attributes: final
    definition classes: AnyRef

26. #### def equals(arg0: Any): Boolean

    This method is used to compare the receiver object (`this`) with the argument object (`arg0`) for equivalence.

    This method is used to compare the receiver object (`this`) with the argument object (`arg0`) for equivalence.

    The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]: * It is reflexive: for any instance `x` of type `Any`, `x.equals(x)` should return `true`. * It is symmetric: for any instances `x` and `y` of type `Any`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`. * It is transitive: for any instances `x`, `y`, and `z` of type `AnyRef` if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override `hashCode` to ensure that objects that are "equal" (`o1.equals(o2)` returns `true`) hash to the same scala.Int (`o1.hashCode.equals(o2.hashCode)`).

    arg0

      the object to compare against this object for equality.

    returns

      `true` if the receiver object is equivalent to the argument; `false` otherwise.

    definition classes: AnyRef → Any

27. #### def execute(): Unit

    Executes the task.

    Executes the task.

    definition classes: ScalaTestAntTask → Task

28. #### def finalize(): Unit

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    The details of when and if the `finalize` method are invoked, as well as the interaction between `finalize`and non-local returns and exceptions, are all platform dependent.

    attributes: protected
    definition classes: AnyRef

29. #### def getClass(): java.lang.Class[_ <: java.lang.Object]

    Returns a representation that corresponds to the dynamic class of the receiver object.

    Returns a representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

      a representation that corresponds to the dynamic class of the receiver object.

    attributes: final
    definition classes: AnyRef

30. #### def getDescription(): String

    definition classes: ProjectComponent

31. #### def getLocation(): Location

    definition classes: ProjectComponent

32. #### def getOwningTarget(): Target

    definition classes: Task

33. #### def getProject(): Project

    definition classes: ProjectComponent

34. #### def getRuntimeConfigurableWrapper(): RuntimeConfigurable

    definition classes: Task

35. #### def getTaskName(): String

    definition classes: Task

36. #### def getTaskType(): String

    definition classes: Task

37. #### def getWrapper(): RuntimeConfigurable

    attributes: protected
    definition classes: Task

38. #### def handleErrorFlush(arg0: String): Unit

    attributes: protected
    definition classes: Task

39. #### def handleErrorOutput(arg0: String): Unit

    attributes: protected
    definition classes: Task

40. #### def handleFlush(arg0: String): Unit

    attributes: protected
    definition classes: Task

41. #### def handleInput(arg0: Array[Byte], arg1: Int, arg2: Int): Int

    attributes: protected
    definition classes: Task

42. #### def handleOutput(arg0: String): Unit

    attributes: protected
    definition classes: Task

43. #### def hashCode(): Int

    Returns a hash code value for the object.

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (`o1.hashCode.equals(o2.hashCode)`) yet not be equal (`o1.equals(o2)` returns `false`). A degenerate implementation could always return `0`. However, it is required that if two objects are equal (`o1.equals(o2)` returns `true`) that they have identical hash codes (`o1.hashCode.equals(o2.hashCode)`). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the `equals` method.

    returns

      the hash code value for the object.

    definition classes: AnyRef → Any

44. #### def init(): Unit

    definition classes: Task

45. #### def isInstanceOf[T0]: Boolean

    This method is used to test whether the dynamic type of the receiver object is `T0`.

    This method is used to test whether the dynamic type of the receiver object is `T0`.

    Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression`1.isInstanceOf[String]` will return `false`, while the expression `List(1).isInstanceOf[List[String]]` will return `true`. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

      `true` if the receiver object is an instance of erasure of type `T0`; `false` otherwise.

    attributes: final
    definition classes: Any

46. #### def isInvalid(): Boolean

    attributes: protected final
    definition classes: Task

47. #### def log(arg0: String, arg1: Throwable, arg2: Int): Unit

    definition classes: Task

48. #### def log(arg0: Throwable, arg1: Int): Unit

    definition classes: Task

49. #### def log(arg0: String, arg1: Int): Unit

    definition classes: Task → ProjectComponent

50. #### def log(arg0: String): Unit

    definition classes: Task → ProjectComponent

51. #### def maybeConfigure(): Unit

    definition classes: Task

52. #### def ne(arg0: AnyRef): Boolean

    `o.ne(arg0)` is the same as `!(o.eq(arg0))`.

    `o.ne(arg0)` is the same as `!(o.eq(arg0))`.

    arg0

      the object to compare against this object for reference dis-equality.

    returns

      `false` if the argument is not a reference to the receiver object; `true` otherwise.

    attributes: final
    definition classes: AnyRef

53. #### def notify(): Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Wakes up a single thread that is waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef

54. #### def notifyAll(): Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

    Wakes up all threads that are waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef

55. #### def perform(): Unit

    attributes: final
    definition classes: Task

56. #### def reconfigure(): Unit

    definition classes: Task

57. #### def setConcurrent(concurrent: Boolean): Unit

    Sets value of the `concurrent` attribute.

    Sets value of the `concurrent` attribute.Note: The `concurrent` attribute has been deprecated and will be removed in a future version of ScalaTest. Please use the `parallel` attribute instead.

    deprecated:

58. #### def setDescription(arg0: String): Unit

    definition classes: ProjectComponent

59. #### def setFork(fork: Boolean): Unit

    Sets value of the `fork` attribute.

    Sets value of the `fork` attribute.

60. #### def setHaltonfailure(haltonfailure: Boolean): Unit

    Sets value of the `haltonfailure` attribute.

    Sets value of the `haltonfailure` attribute.

61. #### def setLocation(arg0: Location): Unit

    definition classes: ProjectComponent

62. #### def setMaxmemory(max: String): Unit

    Sets value of the `maxmemory` attribute.

    Sets value of the `maxmemory` attribute.

63. #### def setMembersonly(packageName: String): Unit

    Sets value of `membersonly` attribute.

    Sets value of `membersonly` attribute.

64. #### def setNumthreads(numthreads: Int): Unit

    Sets value of the `numthreads` attribute.

    Sets value of the `numthreads` attribute.

65. #### def setOwningTarget(arg0: Target): Unit

    definition classes: Task

66. #### def setParallel(parallel: Boolean): Unit

    Sets value of the `parallel` attribute.

    Sets value of the `parallel` attribute.

67. #### def setProject(arg0: Project): Unit

    definition classes: ProjectComponent

68. #### def setRunpath(runpath: Path): Unit

    Sets value of the `runpath` attribute.

    Sets value of the `runpath` attribute.

69. #### def setRuntimeConfigurableWrapper(arg0: RuntimeConfigurable): Unit

    definition classes: Task

70. #### def setSuite(suite: String): Unit

    Sets value of `suite` attribute.

    Sets value of `suite` attribute.

71. #### def setTaskName(arg0: String): Unit

    definition classes: Task

72. #### def setTaskType(arg0: String): Unit

    definition classes: Task

73. #### def setTestNGSuites(testNGSuitePath: Path): Unit

    Sets value of the `testngsuites` attribute.

    Sets value of the `testngsuites` attribute.

74. #### def setWildcard(packageName: String): Unit

    Sets value of `wildcard` attribute.

    Sets value of `wildcard` attribute.

75. #### def synchronized[T0](arg0: T0): T0

    attributes: final
    definition classes: AnyRef

76. #### def toString(): String

    Returns a string representation of the object.

    Returns a string representation of the object.

    The default representation is platform dependent.

    returns

      a string representation of the object.

    definition classes: AnyRef → Any

77. #### def wait(): Unit

    attributes: final
    definition classes: AnyRef

78. #### def wait(arg0: Long, arg1: Int): Unit

    attributes: final
    definition classes: AnyRef

79. #### def wait(arg0: Long): Unit

    attributes: final
    definition classes: AnyRef