All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalatest.events.Event.scala Maven / Gradle / Ivy

Go to download

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

There is a newer version: 2.0.M6-SNAP4
Show newest version
/*
 * Copyright 2001-2008 Artima, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.scalatest.events

import org.scalatest._
import java.util.Date
import scala.xml.Elem
import java.io.StringWriter
import java.io.PrintWriter
import java.io.BufferedWriter

import exceptions.StackDepthException

/**
 * A base class for the events that can be passed to the report function passed
 * to the execute method of a Suite.
 *
 * @author Bill Venners
 */
sealed abstract class Event extends Ordered[Event] with java.io.Serializable {

  /**
   * An Ordinal that can be used to place this event in order in the context of
   * other events reported during the same run.
   */
  val ordinal: Ordinal

  /**
   * An optional formatter that provides extra information that can be used by reporters in determining
   * how to present this event to the user.
   */
  val formatter: Option[Formatter]

  /**
   * An optional location that provides information indicating where in the source code an event originated.
   * IDEs can use this information, for example, to allow the user to hop from an event report to the relevant
   * line of source code.
   */
  val location: Option[Location]

  /**
   * An optional object that can be used to pass custom information to the reporter about this event.
   */
  val payload: Option[Any]

  /**
   * A name for the Thread about whose activity this event was reported.
   */
  val threadName: String

  /**
   * A Long indicating the time this event was reported, expressed in terms of the
   * number of milliseconds since the standard base time known as "the epoch":
   * January 1, 1970, 00:00:00 GMT.
   */
  val timeStamp: Long

  /**
   * Comparing this event with the event passed as that. Returns
   * x, where x < 0 iff this < that, x == 0 iff this == that, x > 0 iff this > that.
   *
   * @param that the event to compare to this event
   * @param return an integer indicating whether this event is less than, equal to, or greater than
   * the passed event
   */
  def compare(that: Event): Int = ordinal.compare(that.ordinal)
  
  /**
   * 
   */
  private [scalatest] def toXml: Elem
  
  private[events] object EventXmlHelper {
    def stringOption(strOption: Option[String]) = strOption.getOrElse("")
    def longOption(longOption: Option[Long]) = if (longOption.isDefined) longOption.get.toString else ""
    def booleanOption(booleanOption: Option[Boolean]) = if (booleanOption.isDefined) booleanOption.get.toString else ""
    def formatterOption(formatterOption: Option[Formatter]) = {
      formatterOption match {
        case Some(formatter) =>
          formatter match {
            case MotionToSuppress => 
              
            case indentedText: IndentedText => 
              
                 { indentedText.formattedText }
                 { indentedText.rawText }
                 { indentedText.indentationLevel }
              
          }
        case None => ""
      }
    }
    def locationOption(locationOption: Option[Location]) = {
      locationOption match {
        case Some(location) =>
          location match {
            case topOfClass: TopOfClass =>
              
                { topOfClass.className }
              
            case topOfMethod: TopOfMethod => 
              
                { topOfMethod.className }
                { topOfMethod.methodId }
              
            case lineInFile: LineInFile => 
              
                { lineInFile.lineNumber }
                { lineInFile.fileName }
              
            case SeeStackDepthException => 
              
            case _ =>
              ""
          } 
        case None => ""
      }
    }
    def getThrowableStackDepth(throwable: Throwable) = {
      throwable match { 
        case sde: StackDepthException => sde.failedCodeStackDepth 
        case _ => -1
      }
    }
    def throwableOption(throwableOption: Option[Throwable]) = {
      throwableOption match {
        case Some(throwable) => 
          { throwable.getMessage }
          { getThrowableStackDepth(throwable) }
          
            {
              val stackTraces = throwable.getStackTrace
              for (stackTrace <- stackTraces) yield {
                
                  { stackTrace.getClassName }
                  { stackTrace.getMethodName }
                  { stackTrace.getFileName }
                  { stackTrace.getLineNumber }
                  { stackTrace.isNativeMethod }
                  { stackTrace.toString }
                
              }
              /*val stringWriter = new StringWriter()
              val writer = new PrintWriter(new BufferedWriter(stringWriter))
              throwable.printStackTrace(writer)
              writer.flush()
              stringWriter.toString*/
            }
          
        case None => ""
      }
    }
    def summaryOption(summaryOption: Option[Summary]) = {
      summaryOption match {
        case Some(summary) =>
          { summary.testsSucceededCount }
          { summary.testsFailedCount }
          { summary.testsIgnoredCount }
          { summary.testsPendingCount }
          { summary.testsCanceledCount }
          { summary.suitesCompletedCount }
          { summary.suitesAbortedCount }
        case None => ""
      }
    }
    def nameInfoOption(nameInfoOption: Option[NameInfo]) = {
      nameInfoOption match {
        case Some(nameInfo) => 
          { nameInfo.suiteName }
          { nameInfo.suiteId }
          { stringOption(nameInfo.suiteClassName) }
          { stringOption(nameInfo.testName) }
        case None => 
          ""
      }
    }
  }
}

/**
 * Marker trait for test completed event's recordedEvents.
 */
sealed trait RecordableEvent extends Event

/**
 * Event that indicates a suite (or other entity) is about to start running a test.
 *
 * 

* For example, trait Suite uses TestStarting to report * that a test method of a Suite is about to be invoked. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a TestStarting event like this: *

* *
 * report(TestStarting(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName), testName))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite containing the test that is starting, suitable for presenting to the user * @param suiteId a string ID for the suite containing the test that is starting, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the test that is starting * @param testName the name of the test that is starting * @param testText the text of the test that is starting (may be the test name, or a suffix of the test name) * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param rerunner an optional String giving the fully qualified name of the class that can be used to rerun the test that is starting. (If None * is passed, the test cannot be rerun.) * @param payload an optional object that can be used to pass custom information to the reporter about the TestStarting event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class TestStarting ( ordinal: Ordinal, suiteName: String, suiteId: String, suiteClassName: Option[String], testName: String, testText: String, formatter: Option[Formatter] = None, location: Option[Location] = None, rerunner: Option[String] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (testName == null) throw new NullPointerException("testName was null") if (testText == null) throw new NullPointerException("testText was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (rerunner == null) throw new NullPointerException("rerunner was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { suiteName } { suiteId } { stringOption(suiteClassName) } { testName } { testText } { formatterOption(formatter) } { locationOption(location) } { stringOption(rerunner) } { threadName } { timeStamp } } /** * Event that indicates a suite (or other entity) has completed running a test that succeeded. * *

* For example, trait Suite uses TestSucceeded to report * that a test method of a Suite returned normally * (without throwing an Exception). *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a TestSucceeded event like this: *

* *
 * report(TestSucceeded(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName), testName))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite containing the test that has succeeded, suitable for presenting to the user * @param suiteId a string ID for the suite containing the test that is starting, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the test that has succeeded * @param testName the name of the test that has succeeded * @param testText the text of the test that has succeeded (may be the test name, or a suffix of the test name) * @param recordedEvents recorded events in the test. * @param duration an optional amount of time, in milliseconds, that was required to run the test that has succeeded * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param rerunner an optional String giving the fully qualified name of the class that can be used to rerun the test that has succeeded. (If None * is passed, the test cannot be rerun.) * @param payload an optional object that can be used to pass custom information to the reporter about the TestSucceeded event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class TestSucceeded ( ordinal: Ordinal, suiteName: String, suiteId: String, suiteClassName: Option[String], testName: String, testText: String, recordedEvents: collection.immutable.IndexedSeq[RecordableEvent], duration: Option[Long] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, rerunner: Option[String] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (testName == null) throw new NullPointerException("testName was null") if (testText == null) throw new NullPointerException("testText was null") if (duration == null) throw new NullPointerException("duration was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (rerunner == null) throw new NullPointerException("rerunner was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { suiteName } { suiteId } { stringOption(suiteClassName) } { longOption(duration) } { testName } { testText } { recordedEvents.map(_.toXml) } { formatterOption(formatter) } { locationOption(location) } { stringOption(rerunner) } { threadName } { timeStamp } } /** * Event that indicates a suite (or other entity) has completed running a test that failed. * *

* For example, trait Suite uses TestFailed to report * that a test method of a Suite completed abruptly with an Exception. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a TestFailed event like this: *

* *
 * report(TestFailed(ordinal, userFriendlyName, message, suiteName, Some(thisSuite.getClass.getName), testName))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName a localized name identifying the suite containing the test that has failed, suitable for presenting to the user * @param suiteId a string ID for the suite containing the test that is starting, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the test that has failed * @param testName the name of the test that has failed * @param testText the text of the test that has failed (may be the test name, or a suffix of the test name) * @param recordedEvents recorded events in the test. * @param throwable an optional Throwable that, if a Some, indicates why the test has failed, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to run the test that has failed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param rerunner an optional String giving the fully qualified name of the class that can be used to rerun the test that has failed. (If None * is passed, the test cannot be rerun.) * @param payload an optional object that can be used to pass custom information to the reporter about the TestFailed event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class TestFailed ( ordinal: Ordinal, message: String, suiteName: String, suiteId: String, suiteClassName: Option[String], testName: String, testText: String, recordedEvents: collection.immutable.IndexedSeq[RecordableEvent], throwable: Option[Throwable] = None, duration: Option[Long] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, rerunner: Option[String] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (testName == null) throw new NullPointerException("testName was null") if (testText == null) throw new NullPointerException("testText was null") if (throwable == null) throw new NullPointerException("throwable was null") if (duration == null) throw new NullPointerException("duration was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (rerunner == null) throw new NullPointerException("rerunner was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { suiteName } { suiteId } { stringOption(suiteClassName) } { longOption(duration) } { testName } { testText } { recordedEvents.map(_.toXml) } { throwableOption(throwable) } { formatterOption(formatter) } { locationOption(location) } { stringOption(rerunner) } { threadName } { timeStamp } } /** * Event that indicates a suite (or other entity) has ignored a test. * *

* For example, trait Suite uses TestIgnored to report * that a test method of a Suite was ignored because it was annotated with @Ignore. * Ignored tests will not be run, but will usually be reported as reminder to fix the broken test. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a TestIgnored event like this: *

* *
 * report(TestIgnored(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName), testName))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite containing the test that was ignored, suitable for presenting to the user * @param suiteId a string ID for the suite containing the test that is starting, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the test that was ignored * @param testName the name of the test that was ignored * @param testText the text of the test that was ignored (may be the test name, or a suffix of the test name) * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the TestIgnored event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class TestIgnored ( ordinal: Ordinal, suiteName: String, suiteId: String, suiteClassName: Option[String], testName: String, testText: String, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (testName == null) throw new NullPointerException("testName was null") if (testText == null) throw new NullPointerException("testText was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { suiteName } { suiteId } { stringOption(suiteClassName) } { testName } { testText } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a test is pending, i.e., it hasn't yet been implemented. * *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a TestPending event like this: *

* *
 * report(TestPending(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName), testName))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite containing the test that is pending, suitable for presenting to the user * @param suiteId a string ID for the suite containing the test that is starting, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the test that is pending * @param testName the name of the test that is pending * @param testText the text of the test that is pending (may be the test name, or a suffix of the test name) * @param recordedEvents recorded events in the test. * @param duration an optional amount of time, in milliseconds, that was required to run the test that is pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the TestPending event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class TestPending ( ordinal: Ordinal, suiteName: String, suiteId: String, suiteClassName: Option[String], testName: String, testText: String, recordedEvents: collection.immutable.IndexedSeq[RecordableEvent], duration: Option[Long] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (testName == null) throw new NullPointerException("testName was null") if (testText == null) throw new NullPointerException("testText was null") if (duration == null) throw new NullPointerException("duration was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { suiteName } { suiteId } { stringOption(suiteClassName) } { longOption(duration) } { testName } { testText } { recordedEvents.map(_.toXml) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a test was canceled, i.e., it couldn't run because some precondition was not met. * *

* To create instances of this class you may * use the factory methods provided in its companion object. For example, given a * report function named report, you could fire a TestCanceled event like this: *

* *
 * report(TestPending(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName), testName))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName a localized name identifying the suite containing the test that was canceled, suitable for presenting to the user * @param suiteId a string ID for the suite containing the test that is starting, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the test that was canceled * @param testName the name of the test that was canceled * @param testText the text of the test that was canceled (may be the test name, or a suffix of the test name) * @param recordedEvents recorded events in the test. * @param throwable an optional Throwable that, if a Some, indicates why the test was canceled, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to run the test that was canceled * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the TestCanceled event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ // TODO: Probably add a rerunnable to TestCanceled final case class TestCanceled ( ordinal: Ordinal, message: String, suiteName: String, suiteId: String, suiteClassName: Option[String], testName: String, testText: String, recordedEvents: collection.immutable.IndexedSeq[RecordableEvent], throwable: Option[Throwable] = None, duration: Option[Long] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (testName == null) throw new NullPointerException("testName was null") if (testText == null) throw new NullPointerException("testText was null") if (duration == null) throw new NullPointerException("duration was null") if (throwable == null) throw new NullPointerException("throwable was null") if (duration == null) throw new NullPointerException("duration was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { suiteName } { suiteId } { stringOption(suiteClassName) } { longOption(duration) } { testName } { testText } { recordedEvents.map(_.toXml) } { throwableOption(throwable) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a suite of tests is about to start executing. * *

* For example, trait Suite and object Runner use SuiteStarting to report * that the execute method of a Suite is about to be invoked. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a SuiteStarting event like this: *

* *
 * report(SuiteStarting(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName)))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite that is starting, suitable for presenting to the user * @param suiteId a string ID for the suite that is starting, intended to be unique across all suites in a run XXX * @param suiteClassName an optional fully qualifed Suite class name of the suite that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param rerunner an optional String giving the fully qualified name of the class that can be used to rerun the suite that is starting. (If None * is passed, the suite cannot be rerun.) * @param payload an optional object that can be used to pass custom information to the reporter about the SuiteStarting event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class SuiteStarting ( ordinal: Ordinal, suiteName: String, suiteId: String, suiteClassName: Option[String], formatter: Option[Formatter] = None, location: Option[Location] = None, rerunner: Option[String] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (rerunner == null) throw new NullPointerException("rerunner was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { suiteName } { suiteId } { stringOption(suiteClassName) } { formatterOption(formatter) } { locationOption(location) } { stringOption(rerunner) } { threadName } { timeStamp } } /** * Event that indicates a suite of tests has completed executing. * *

* For example, trait Suite and object Runner use SuiteCompleted to report * that the execute method of a Suite * has returned normally (without throwing a RuntimeException). *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a SuiteCompleted event like this: *

* *
 * report(SuiteCompleted(ordinal, userFriendlyName, suiteName, Some(thisSuite.getClass.getName)))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite that has completed, suitable for presenting to the user * @param suiteId a string ID for the suite that has completed, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has completed * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has completed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param rerunner an optional String giving the fully qualified name of the class that can be used to rerun the suite that has completed. (If None * is passed, the suite cannot be rerun.) * @param payload an optional object that can be used to pass custom information to the reporter about the SuiteCompleted event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class SuiteCompleted ( ordinal: Ordinal, suiteName: String, suiteId: String, suiteClassName: Option[String], duration: Option[Long] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, rerunner: Option[String] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (duration == null) throw new NullPointerException("duration was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (rerunner == null) throw new NullPointerException("rerunner was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { suiteName } { suiteId } { stringOption(suiteClassName) } { longOption(duration) } { formatterOption(formatter) } { locationOption(location) } { stringOption(rerunner) } { threadName } { timeStamp } } /** * Event that indicates the execution of a suite of tests has aborted, likely because of an error, prior * to completion. * *

* For example, trait Suite and object Runner use SuiteAborted to report * that the execute method of a Suite * has completed abruptly with a RuntimeException. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a SuiteAborted event like this: *

* *
 * report(SuiteAborted(ordinal, userFriendlyName, message, suiteName, Some(thisSuite.getClass.getName)))
 * 
* *

* The suite class name parameter is optional, because suites in ScalaTest are an abstraction that * need not necessarily correspond to one class. Nevertheless, it most cases each suite will correspond * to a class, and when it does, the fully qualified name of that class should be reported by passing a * Some for suiteClassName. One use for this bit of information is JUnit integration, * because the "name" provided to a JUnit org.junit.runner.Description appears to usually include * a fully qualified class name by convention. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param name a localized name identifying the suite that has aborted, which should include the * suite name, suitable for presenting to the user * @param message a localized message suitable for presenting to the user * @param suiteName a localized name identifying the suite that has aborted, suitable for presenting to the user * @param suiteId a string ID for the suite that has aborted, intended to be unique across all suites in a run * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has aborted * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has aborted * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param rerunner an optional String giving the fully qualified name of the class that can be used to rerun the suite that has aborted. (If None * is passed, the suite cannot be rerun.) * @param payload an optional object that can be used to pass custom information to the reporter about the SuiteAborted event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class SuiteAborted ( ordinal: Ordinal, message: String, suiteName: String, suiteId: String, suiteClassName: Option[String], throwable: Option[Throwable] = None, duration: Option[Long] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, rerunner: Option[String] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (suiteName == null) throw new NullPointerException("suiteName was null") if (suiteId == null) throw new NullPointerException("suiteId was null") if (suiteClassName == null) throw new NullPointerException("suiteClassName was null") if (throwable == null) throw new NullPointerException("throwable was null") if (duration == null) throw new NullPointerException("duration was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (rerunner == null) throw new NullPointerException("rerunner was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { suiteName } { suiteId } { stringOption(suiteClassName) } { longOption(duration) } { throwableOption(throwable) } { formatterOption(formatter) } { locationOption(location) } { stringOption(rerunner) } { threadName } { timeStamp } } // TODO: Put location as a val set to None /** * Event that indicates a runner is about run a suite of tests. * *

* For example, object Runner reports RunStarting to indicate * that the first execute method of a run's initial Suite * is about to be invoked. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a RunStarting event like this: *

* *
 * report(RunStarting(ordinal, testCount))
 * 
* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param testCount the number of tests expected during this run * @param configMap a Map of key-value pairs that can be used by custom Reporters * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the RunStarting event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @throws IllegalArgumentException if testCount is less than zero. * * @author Bill Venners */ final case class RunStarting ( ordinal: Ordinal, testCount: Int, configMap: Map[String, Any], formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (testCount < 0) throw new IllegalArgumentException("testCount was less than zero: " + testCount) if (configMap == null) throw new NullPointerException("configMap was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { testCount } { for ((key, value) <- configMap) yield { { key } { value } } } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a runner has completed running a suite of tests. * *

* Suite's execute method takes a Stopper, whose stopRequested * method indicates a stop was requested. If true is returned by * stopRequested while a suite of tests is running, the * execute method should promptly * return even if that suite hasn't finished running all of its tests. *

* *

If a stop was requested via the Stopper. * Runner will report RunStopped * when the execute method of the run's starting Suite returns. * If a stop is not requested, Runner will report RunCompleted * when the last execute method of the run's starting Suites returns. *

* *

* ScalaTest's Runner fires a RunCompleted report with an empty summary, because * the reporter is responsible for keeping track of the total number of tests reported as succeeded, failed, ignored, and pending. * ScalaTest's internal reporter replaces the RunCompleted with a new one that is identical except that is * has a defined summary. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a RunCompleted event like this: *

* *
 * report(RunCompleted(ordinal))
 * 
* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has completed * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the RunCompleted event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class RunCompleted ( ordinal: Ordinal, duration: Option[Long] = None, summary: Option[Summary] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (duration == null) throw new NullPointerException("duration was null") if (summary == null) throw new NullPointerException("summary was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { longOption(duration) } { summaryOption(summary) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a runner has stopped running a suite of tests prior to completion, likely * because of a stop request. * *

* Suite's execute method takes a Stopper, whose stopRequested * method indicates a stop was requested. If true is returned by * stopRequested while a suite of tests is running, the * execute method should promptly * return even if that suite hasn't finished running all of its tests. *

* *

If a stop was requested via the Stopper. * Runner will report RunStopped * when the execute method of the run's starting Suite returns. * If a stop is not requested, Runner will report RunCompleted * when the last execute method of the run's starting Suites returns. *

* *

* ScalaTest's Runner fires a RunStopped report with an empty summary, because * the reporter is responsible for keeping track of the total number of tests reported as succeeded, failed, ignored, and pending. * ScalaTest's internal reporter replaces the RunStopped with a new one that is identical except that is * has a defined summary. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a RunStopped event like this: *

* *
 * report(RunStopped(ordinal))
 * 
* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has stopped * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the RunStopped event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class RunStopped ( ordinal: Ordinal, duration: Option[Long] = None, summary: Option[Summary] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (duration == null) throw new NullPointerException("duration was null") if (summary == null) throw new NullPointerException("summary was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { longOption(duration) } { summaryOption(summary) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a runner encountered an error while attempting to run a suite of tests. * *

* For example, object Runner reports RunAborted if the * execute method of any of the run's starting Suites completes * abruptly with a Throwable. *

* *

* ScalaTest's Runner fires a RunAborted report with an empty summary, because * the reporter is responsible for keeping track of the total number of tests reported as succeeded, failed, ignored, and pending. * ScalaTest's internal reporter replaces the RunAborted with a new one that is identical except that is * has a defined summary. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a RunAborted event like this: *

* *
 * report(RunAborted(ordinal, message, Some(exception)))
 * 
* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required by the run that has aborted * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the RunAborted event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class RunAborted ( ordinal: Ordinal, message: String, throwable: Option[Throwable], duration: Option[Long] = None, summary: Option[Summary] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (throwable == null) throw new NullPointerException("throwable was null") if (duration == null) throw new NullPointerException("duration was null") if (summary == null) throw new NullPointerException("summary was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { throwableOption(throwable) } { longOption(duration) } { summaryOption(summary) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event used to provide information that is not appropriate to report via any other Event. * *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a InfoProvided event like this: *

* *
 * report(InfoProvided(ordinal, message, Some(NameInfo(suiteName, suiteId, Some(thisSuite.getClass.getName), Some(testName)))))
 * 
* *

* An InfoProvided event may be fired from anywhere. In this respect InfoProvided is different * from the other events, for which it is defined whether they are fired in the context of a suite or test. * If fired in the context of a test, the InfoProvided event should include a NameInfo in which * testName is defined. If fired in the context of a suite, but not a test, the InfoProvided event * should include a NameInfo in which testName is not defined. If fired within the context * of neither a suite nor a test, the nameInfo of the InfoProvided event (an Option[NameInfo]) should be None. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo an optional NameInfo that if defined, provides names for the suite and optionally the test * in the context of which the information was provided * @param throwable an optional Throwable * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the InfoProvided event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class InfoProvided ( ordinal: Ordinal, message: String, nameInfo: Option[NameInfo], throwable: Option[Throwable] = None, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends RecordableEvent { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (nameInfo == null) throw new NullPointerException("nameInfo was null") if (throwable == null) throw new NullPointerException("throwable was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { nameInfoOption(nameInfo) } { throwableOption(throwable) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event used to provide markup text for document-style reports. * *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a MarkupProvided event like this: *

* *
 * report(MarkupProvided(ordinal, text, Some(NameInfo(suiteName, suiteId, Some(thisSuite.getClass.getName), Some(testName)))))
 * 
* *

* A MarkupProvided event may be fired from anywhere. In this respect MarkupProvided is different * from the other events, for which it is defined whether they are fired in the context of a suite or test. * If fired in the context of a test, the MarkupProvided event should include a NameInfo in which * testName is defined. If fired in the context of a suite, but not a test, the MarkupProvided event * should include a NameInfo in which testName is not defined. If fired within the context * of neither a suite nor a test, the nameInfo of the MarkupProvided event (an Option[NameInfo]) should be None. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param text a snippet of markup text (in Markdown format) * @param nameInfo an optional NameInfo that if defined, provides names for the suite and optionally the test * in the context of which the information was provided * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the MarkupProvided event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class MarkupProvided ( ordinal: Ordinal, text: String, nameInfo: Option[NameInfo], formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends RecordableEvent { if (ordinal == null) throw new NullPointerException("ordinal was null") if (text == null) throw new NullPointerException("message was null") if (nameInfo == null) throw new NullPointerException("nameInfo was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { text } { nameInfoOption(nameInfo) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a new scope has been opened. * *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a ScopeOpened event like this: *

* *
 * report(ScopeOpened(ordinal, message, Some(NameInfo(suiteName, suiteId, Some(thisSuite.getClass.getName), Some(testName)))))
 * 
* *

* A ScopeOpened event may be fired from within suites or tests. * If fired in the context of a test, the ScopeOpened event should include a NameInfo in which * testName is defined. If fired in the context of a suite, but not a test, the ScopeOpened event * should include a NameInfo in which testName is not defined. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo a NameInfo that provides names for the suite and optionally the test * in the context of which the scope was opened * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the ScopeOpened event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class ScopeOpened ( ordinal: Ordinal, message: String, nameInfo: NameInfo, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (nameInfo == null) throw new NullPointerException("nameInfo was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { nameInfoOption(if (nameInfo != null) Some(nameInfo) else None) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /** * Event that indicates a scope has been closed. * *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a ScopeClosed event like this: *

* *
 * report(ScopeClosed(ordinal, message, Some(NameInfo(suiteName, suiteId, Some(thisSuite.getClass.getName), Some(testName)))))
 * 
* *

* A ScopeClosed event may be fired from within suites or tests. * If fired in the context of a test, the ScopeClosed event should include a NameInfo in which * testName is defined. If fired in the context of a suite, but not a test, the ScopeClosed event * should include a NameInfo in which testName is not defined. *

* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo a NameInfo that provides names for the suite and optionally the test * in the context of which the scope was closed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param location An optional location that provides information indicating where in the source code an event originated. * @param payload an optional object that can be used to pass custom information to the reporter about the ScopeClosed event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class ScopeClosed ( ordinal: Ordinal, message: String, nameInfo: NameInfo, formatter: Option[Formatter] = None, location: Option[Location] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (message == null) throw new NullPointerException("message was null") if (nameInfo == null) throw new NullPointerException("nameInfo was null") if (formatter == null) throw new NullPointerException("formatter was null") if (location == null) throw new NullPointerException("location was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") import EventXmlHelper._ private [scalatest] def toXml = { ordinal.runStamp } { message } { nameInfoOption(if (nameInfo != null) Some(nameInfo) else None) } { formatterOption(formatter) } { locationOption(location) } { threadName } { timeStamp } } /* /** * Event that indicates a runner is about run a suite of tests. * *

* For example, object Runner reports RunStarting to indicate * that the first execute method of a run's initial Suite * is about to be invoked. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a RunStarting event like this: *

* *
 * report(RunStarting(ordinal, testCount))
 * 
* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param testCount the number of tests expected during this run * @param configMap a Map of key-value pairs that can be used by custom Reporters * @param payload an optional object that can be used to pass custom information to the reporter about the RunStarting event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @throws IllegalArgumentException if testCount is less than zero. * * @author Bill Venners */ final case class DiscoveryStarting ( ordinal: Ordinal, testCount: Int, configMap: Map[String, Any], payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (testCount < 0) throw new IllegalArgumentException("testCount was less than zero: " + testCount) if (configMap == null) throw new NullPointerException("configMap was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") /** * Location in a DiscoveryStarting is always set to None. */ val location: Option[Location] = None /** * Formatter in a DiscoveryStarting is always set to None. */ val formatter: Option[Formatter] = None } /** * Event that indicates a runner has completed running a suite of tests. * *

* Suite's execute method takes a Stopper, whose stopRequested * method indicates a stop was requested. If true is returned by * stopRequested while a suite of tests is running, the * execute method should promptly * return even if that suite hasn't finished running all of its tests. *

* *

If a stop was requested via the Stopper. * Runner will report RunStopped * when the execute method of the run's starting Suite returns. * If a stop is not requested, Runner will report RunCompleted * when the last execute method of the run's starting Suites returns. *

* *

* ScalaTest's Runner fires a RunCompleted report with an empty summary, because * the reporter is responsible for keeping track of the total number of tests reported as succeeded, failed, ignored, and pending. * ScalaTest's internal reporter replaces the RunCompleted with a new one that is identical except that is * has a defined summary. *

* *

* To create instances of this class you may * use the factory method provided in its companion object. For example, given a * report function named report, you could fire a RunCompleted event like this: *

* *
 * report(RunCompleted(ordinal))
 * 
* * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has completed * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param payload an optional object that can be used to pass custom information to the reporter about the RunCompleted event * @param threadName a name for the Thread about whose activity this event was reported * @param timeStamp a Long indicating the time this event was reported, expressed in terms of the * number of milliseconds since the standard base time known as "the epoch": January 1, 1970, 00:00:00 GMT * * @author Bill Venners */ final case class DiscoveryCompleted ( ordinal: Ordinal, duration: Option[Long] = None, summary: Option[Summary] = None, payload: Option[Any] = None, threadName: String = Thread.currentThread.getName, timeStamp: Long = (new Date).getTime ) extends Event { if (ordinal == null) throw new NullPointerException("ordinal was null") if (duration == null) throw new NullPointerException("duration was null") if (summary == null) throw new NullPointerException("summary was null") if (payload == null) throw new NullPointerException("payload was null") if (threadName == null) throw new NullPointerException("threadName was null") /** * Location in a DiscoveryCompleted is always set to None. */ val location: Option[Location] = None /** * Formatter in a DiscoveryCompleted is always set to None. */ val formatter: Option[Formatter] = None } */ /** * Deprecated singleton object for the TestStarting event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on TestStarting objects. * This object contains methods that were in the TestStarting companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use TestStarting with named and/or default parameters instead.") object DeprecatedTestStarting { /** * Constructs a new TestStarting event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is starting * @param suiteClassName an optional fully qualifed Suite class name containing the test that is starting * @param testName the name of the test that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the test that is starting (if None * is passed, the test cannot be rerun) * @param payload an optional object that can be used to pass custom information to the reporter about the TestStarting event * * @throws NullPointerException if any of the passed values are null * * @return a new TestStarting instance initialized with the passed and default values * */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter], rerunner: Option[Rerunner], payload: Option[Any] ): TestStarting = { TestStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, formatter, None, suiteClassName, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestStarting event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is starting * @param suiteClassName an optional fully qualifed Suite class name containing the test that is starting * @param testName the name of the test that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the test that is starting (if None * is passed, the test cannot be rerun) * * @throws NullPointerException if any of the passed values are null * * @return a new TestStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter], rerunner: Option[Rerunner] ): TestStarting = { TestStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, formatter, None, suiteClassName, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestStarting event with the passed parameters, passing None as the * rerunner, None as the payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is starting * @param suiteClassName an optional fully qualifed Suite class name containing the test that is starting * @param testName the name of the test that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new TestStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter] ): TestStarting = { TestStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, formatter, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestStarting event with the passed parameters, passing None for * formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is starting * @param suiteClassName an optional fully qualifed Suite class name containing the test that is starting * @param testName the name of the test that is starting * * @throws NullPointerException if any of the passed values are null * * @return a new TestStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String ): TestStarting = { TestStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the TestSucceeded event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on TestSucceeded objects. * This object contains methods that were in the TestSucceeded companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use TestSucceeded with named and/or default parameters instead.") object DeprecatedTestSucceeded { /** * Constructs a new TestSucceeded event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that has succeeded * @param suiteClassName an optional fully qualifed Suite class name containing the test that has succeeded * @param testName the name of the test that has succeeded * @param duration an optional amount of time, in milliseconds, that was required to run the test that has succeeded * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the test that has succeeded (if None * is passed, the test cannot be rerun) * @param payload an optional object that can be used to pass custom information to the reporter about the TestSucceeded event * * @throws NullPointerException if any of the passed values are null * * @return a new TestSucceeded instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner], payload: Option[Any] ): TestSucceeded = { TestSucceeded(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, duration, formatter, None, suiteClassName, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestSucceeded event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that has succeeded * @param suiteClassName an optional fully qualifed Suite class name containing the test that has succeeded * @param testName the name of the test that has succeeded * @param duration an optional amount of time, in milliseconds, that was required to run the test that has succeeded * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the test that has succeeded (if None * is passed, the test cannot be rerun) * * @throws NullPointerException if any of the passed values are null * * @return a new TestSucceeded instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner] ): TestSucceeded = { TestSucceeded(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, duration, formatter, None, suiteClassName, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestSucceeded event with the passed parameters, passing None as the * rerunner, None as the payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that has succeeded * @param suiteClassName an optional fully qualifed Suite class name containing the test that has succeeded * @param testName the name of the test that has succeeded * @param duration an optional amount of time, in milliseconds, that was required to run the test that has succeeded * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new TestSucceeded instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, duration: Option[Long], formatter: Option[Formatter] ): TestSucceeded = { TestSucceeded(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, duration, formatter, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestSucceeded event with the passed parameters, passing None for * formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that has succeeded * @param suiteClassName an optional fully qualifed Suite class name containing the test that has succeeded * @param testName the name of the test that has succeeded * @param duration an optional amount of time, in milliseconds, that was required to run the test that has succeeded * * @throws NullPointerException if any of the passed values are null * * @return a new TestSucceeded instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, duration: Option[Long] ): TestSucceeded = { TestSucceeded(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestSucceeded event with the passed parameters, passing None for duration, * None for formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that has succeeded * @param suiteClassName an optional fully qualifed Suite class name containing the test that has succeeded * @param testName the name of the test that has succeeded * * @throws NullPointerException if any of the passed values are null * * @return a new TestSucceeded instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String ): TestSucceeded = { TestSucceeded(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the TestFailed event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on TestFailed objects. * This object contains methods that were in the TestFailed companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use TestFailed with named and/or default parameters instead.") object DeprecatedTestFailed { /** * Constructs a new TestFailed event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the test that has failed * @param suiteClassName an optional fully qualifed Suite class name containing the test that has failed * @param testName the name of the test that has failed * @param throwable an optional Throwable that, if a Some, indicates why the test has failed, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to run the test that has failed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the test that has failed (if None * is passed, the test cannot be rerun) * @param payload an optional object that can be used to pass custom information to the reporter about the TestFailed event * * @throws NullPointerException if any of the passed values are null * * @return a new TestFailed instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], testName: String, throwable: Option[Throwable], duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner], payload: Option[Any] ): TestFailed = { TestFailed(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, throwable, duration, formatter, None, suiteClassName, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestFailed event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the test that has failed * @param suiteClassName an optional fully qualifed Suite class name containing the test that has failed * @param testName the name of the test that has failed * @param throwable an optional Throwable that, if a Some, indicates why the test has failed, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to run the test that has failed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the test that has failed (if None * is passed, the test cannot be rerun) * * @throws NullPointerException if any of the passed values are null * * @return a new TestFailed instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], testName: String, throwable: Option[Throwable], duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner] ): TestFailed = { TestFailed(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, throwable, duration, formatter, None, suiteClassName, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestFailed event with the passed parameters, passing None as the * rerunner, None as the payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the test that has failed * @param suiteClassName an optional fully qualifed Suite class name containing the test that has failed * @param testName the name of the test that has failed * @param throwable an optional Throwable that, if a Some, indicates why the test has failed, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to run the test that has failed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new TestFailed instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], testName: String, throwable: Option[Throwable], duration: Option[Long], formatter: Option[Formatter] ): TestFailed = { TestFailed(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, throwable, duration, formatter, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestFailed event with the passed parameters, passing None for * formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the test that has failed * @param suiteClassName an optional fully qualifed Suite class name containing the test that has failed * @param testName the name of the test that has failed * @param throwable an optional Throwable that, if a Some, indicates why the test has failed, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to run the test that has failed * * @throws NullPointerException if any of the passed values are null * * @return a new TestFailed instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], testName: String, throwable: Option[Throwable], duration: Option[Long] ): TestFailed = { TestFailed(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, throwable, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestFailed event with the passed parameters, passing None for duration, * None for formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the test that has failed * @param suiteClassName an optional fully qualifed Suite class name containing the test that has failed * @param testName the name of the test that has failed * @param throwable an optional Throwable that, if a Some, indicates why the test has failed, * or a Throwable created to capture stack trace information about the problem. * * @throws NullPointerException if any of the passed values are null * * @return a new TestFailed instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], testName: String, throwable: Option[Throwable] ): TestFailed = { TestFailed(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, throwable, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the TestIgnored event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on TestIgnored objects. * This object contains methods that were in the TestIgnored companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use TestIgnored with named and/or default parameters instead.") object DeprecatedTestIgnored { /** * Constructs a new TestIgnored event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that was ignored * @param suiteClassName an optional fully qualifed Suite class name containing the test that was ignored * @param testName the name of the test that was ignored * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the TestIgnored event * * @throws NullPointerException if any of the passed values are null * * @return a new TestIgnored instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter], payload: Option[Any] ): TestIgnored = { TestIgnored(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestIgnored event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that was ignored * @param suiteClassName an optional fully qualifed Suite class name containing the test that was ignored * @param testName the name of the test that was ignored * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new TestIgnored instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter] ): TestIgnored = { TestIgnored(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestIgnored event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that was ignored * @param suiteClassName an optional fully qualifed Suite class name containing the test that was ignored * @param testName the name of the test that was ignored * * @throws NullPointerException if any of the passed values are null * * @return a new TestIgnored instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String ): TestIgnored = { TestIgnored(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the TestPending event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on TestPending objects. * This object contains methods that were in the TestPending companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use TestPending with named and/or default parameters instead.") object DeprecatedTestPending { /** * Constructs a new TestPending event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is pending * @param suiteClassName an optional fully qualifed Suite class name containing the test that is pending * @param testName the name of the test that is pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the TestPending event * * @throws NullPointerException if any of the passed values are null * * @return a new TestPending instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter], payload: Option[Any] ): TestPending = { TestPending(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, None, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestPending event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is pending * @param suiteClassName an optional fully qualifed Suite class name containing the test that is pending * @param testName the name of the test that is pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new TestPending instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String, formatter: Option[Formatter] ): TestPending = { TestPending(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, None, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new TestPending event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the test that is pending * @param suiteClassName an optional fully qualifed Suite class name containing the test that is pending * @param testName the name of the test that is pending * * @throws NullPointerException if any of the passed values are null * * @return a new TestPending instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], testName: String ): TestPending = { TestPending(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, testName, testName, Vector.empty, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the SuiteStarting event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on SuiteStarting objects. * This object contains methods that were in the SuiteStarting companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use SuiteStarting with named and/or default parameters instead.") object DeprecatedSuiteStarting { /** * Constructs a new SuiteStarting event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite that is starting, which should include the * suite name, suitable for presenting to the user * @param suiteClassName an optional fully qualifed Suite class name of the suite that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the suite that is starting (if None * is passed, the suite cannot be rerun) * @param payload an optional object that can be used to pass custom information to the reporter about the SuiteStarting event * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], formatter: Option[Formatter], rerunner: Option[Rerunner], payload: Option[Any] ): SuiteStarting = { SuiteStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, formatter, None, suiteClassName, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteStarting event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite that is starting, which should include the * suite name, suitable for presenting to the user * @param suiteClassName an optional fully qualifed Suite class name of the suite that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the suite that is starting (if None * is passed, the suite cannot be rerun) * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], formatter: Option[Formatter], rerunner: Option[Rerunner] ): SuiteStarting = { SuiteStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, formatter, None, suiteClassName, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteStarting event with the passed parameters, passing None as the * rerunner, None as the payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite that is starting, which should include the * suite name, suitable for presenting to the user * @param suiteClassName an optional fully qualifed Suite class name of the suite that is starting * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], formatter: Option[Formatter] ): SuiteStarting = { SuiteStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, formatter, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteStarting event with the passed parameters, passing None for * formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName a localized name identifying the suite that is starting, which should include the * suite name, suitable for presenting to the user * @param suiteClassName an optional fully qualifed Suite class name of the suite that is starting * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String] ): SuiteStarting = { SuiteStarting(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the SuiteCompleted event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on SuiteCompleted objects. * This object contains methods that were in the SuiteCompleted companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use SuiteCompleted with named and/or default parameters instead.") object DeprecatedSuiteCompleted { /** * Constructs a new SuiteCompleted event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the suite that has completed * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has completed * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has completed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the suite that has completed (if None * is passed, the suite cannot be rerun) * @param payload an optional object that can be used to pass custom information to the reporter about the SuiteCompleted event * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner], payload: Option[Any] ): SuiteCompleted = { SuiteCompleted(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, duration, formatter, None, suiteClassName, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteCompleted event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the suite that has completed * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has completed * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has completed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the suite that has completed (if None * is passed, the suite cannot be rerun) * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner] ): SuiteCompleted = { SuiteCompleted(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, duration, formatter, None, suiteClassName, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteCompleted event with the passed parameters, passing None as the * rerunner, None as the payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the suite that has completed * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has completed * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has completed * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], duration: Option[Long], formatter: Option[Formatter] ): SuiteCompleted = { SuiteCompleted(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, duration, formatter, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteCompleted event with the passed parameters, passing None for * formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param suiteName the name of the suite containing the suite that has completed * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has completed * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has completed * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String], duration: Option[Long] ): SuiteCompleted = { SuiteCompleted(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteCompleted event with the passed parameters, passing None for duration, * None for formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param name a localized name identifying the suite that has completed, which should include the * suite name, suitable for presenting to the user * @param suiteName the name of the suite containing the suite that has completed * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has completed * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, suiteName: String, suiteClassName: Option[String] ): SuiteCompleted = { SuiteCompleted(ordinal, suiteName, suiteClassName getOrElse suiteName, suiteClassName, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the SuiteAborted event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on SuiteAborted objects. * This object contains methods that were in the SuiteAborted companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use SuiteAborted with named and/or default parameters instead.") object DeprecatedSuiteAborted { /** * Constructs a new SuiteAborted event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param name a localized name identifying the suite that has aborted, which should include the * suite name, suitable for presenting to the user * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the suite that has aborted * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has aborted * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has aborted * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the suite that has aborted (if None * is passed, the suite cannot be rerun) * @param payload an optional object that can be used to pass custom information to the reporter about the SuiteAborted event * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], throwable: Option[Throwable], duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner], payload: Option[Any] ): SuiteAborted = { SuiteAborted(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, throwable, duration, formatter, None, suiteClassName, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteAborted event with the passed parameters, passing None as the * payload, the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the suite that has aborted * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has aborted * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has aborted * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param rerunner an optional Rerunner that can be used to rerun the suite that has aborted (if None * is passed, the suite cannot be rerun) * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], throwable: Option[Throwable], duration: Option[Long], formatter: Option[Formatter], rerunner: Option[Rerunner] ): SuiteAborted = { SuiteAborted(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, throwable, duration, formatter, None, suiteClassName, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteAborted event with the passed parameters, passing None as the * rerunner, None as the payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has aborted * @param suiteName the name of the suite containing the suite that has aborted * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has aborted * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], throwable: Option[Throwable], duration: Option[Long], formatter: Option[Formatter] ): SuiteAborted = { SuiteAborted(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, throwable, duration, formatter, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteAborted event with the passed parameters, passing None for * formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the suite that has aborted * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has aborted * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required to execute the suite that has aborted * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], throwable: Option[Throwable], duration: Option[Long] ): SuiteAborted = { SuiteAborted(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, throwable, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new SuiteAborted event with the passed parameters, passing None for duration, * None for formatter, None as the rerunner, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param suiteName the name of the suite containing the suite that has aborted * @param suiteClassName an optional fully qualifed Suite class name containing the suite that has aborted * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * * @throws NullPointerException if any of the passed values are null * * @return a new SuiteAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, suiteName: String, suiteClassName: Option[String], throwable: Option[Throwable] ): SuiteAborted = { SuiteAborted(ordinal, message, suiteName, suiteClassName getOrElse suiteName, suiteClassName, throwable, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the RunStarting event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on RunStarting objects. * This object contains methods that were in the RunStarting companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null, and IllegalArgumentException if * testCount is less than zero. *

* * @author Bill Venners */ @deprecated("Use RunStarting with named and/or default parameters instead.") object DeprecatedRunStarting { /** * Constructs a new RunStarting event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param testCount the number of tests expected during this run * @param configMap a Map of key-value pairs that can be used by custom Reporters * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the RunStarting event * * @throws IllegalArgumentException if testCount is less than zero. * @throws NullPointerException if any of the passed values are null * * @return a new RunStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, testCount: Int, configMap: Map[String, Any], formatter: Option[Formatter], payload: Option[Any] ): RunStarting = { RunStarting(ordinal, testCount, configMap, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunStarting event with the passed parameters, passing None as the * payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param testCount the number of tests expected during this run * @param configMap a Map of key-value pairs that can be used by custom Reporters * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new RunStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, testCount: Int, configMap: Map[String, Any], formatter: Option[Formatter] ): RunStarting = { RunStarting(ordinal, testCount, configMap, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunStarting event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param testCount the number of tests expected during this run * @param configMap a Map of key-value pairs that can be used by custom Reporters * * @throws NullPointerException if any of the passed values are null * * @return a new RunStarting instance initialized with the passed and default values */ def apply( ordinal: Ordinal, testCount: Int, configMap: Map[String, Any] ): RunStarting = { RunStarting(ordinal, testCount, configMap, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the RunCompleted event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on RunCompleted objects. * This object contains methods that were in the RunCompleted companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use RunCompleted with named and/or default parameters instead.") object DeprecatedRunCompleted { /** * Constructs a new RunCompleted event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has completed * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the RunCompleted event * * @throws NullPointerException if any of the passed values are null * * @return a new RunCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long], summary: Option[Summary], formatter: Option[Formatter], payload: Option[Any] ): RunCompleted = { RunCompleted(ordinal, duration, summary, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunCompleted event with the passed parameters, passing None as the * payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has completed * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new RunCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long], summary: Option[Summary], formatter: Option[Formatter] ): RunCompleted = { RunCompleted(ordinal, duration, summary, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunCompleted event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has completed * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * * @throws NullPointerException if any of the passed values are null * * @return a new RunCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long], summary: Option[Summary] ): RunCompleted = { RunCompleted(ordinal, duration, summary, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunCompleted event with the passed parameters, passing None for summary, * None for formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has completed * * @throws NullPointerException if any of the passed values are null * * @return a new RunCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long] ): RunCompleted = { RunCompleted(ordinal, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunCompleted event with the passed parameters, passing None for duration, * None for summary, None for formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * * @throws NullPointerException if any of the passed values are null * * @return a new RunCompleted instance initialized with the passed and default values */ def apply( ordinal: Ordinal ): RunCompleted = { RunCompleted(ordinal, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the RunStopped event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on RunStopped objects. * This object contains methods that were in the RunStopped companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use RunStopped with named and/or default parameters instead.") object DeprecatedRunStopped { /** * Constructs a new RunStopped event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has stopped * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the RunStopped event * * @throws NullPointerException if any of the passed values are null * * @return a new RunStopped instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long], summary: Option[Summary], formatter: Option[Formatter], payload: Option[Any] ): RunStopped = { RunStopped(ordinal, duration, summary, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunStopped event with the passed parameters, passing None as the * payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has stopped * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new RunStopped instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long], summary: Option[Summary], formatter: Option[Formatter] ): RunStopped = { RunStopped(ordinal, duration, summary, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunStopped event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has stopped * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * * @throws NullPointerException if any of the passed values are null * * @return a new RunStopped instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long], summary: Option[Summary] ): RunStopped = { RunStopped(ordinal, duration, summary, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunStopped event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param duration an optional amount of time, in milliseconds, that was required by the run that has stopped * * @throws NullPointerException if any of the passed values are null * * @return a new RunStopped instance initialized with the passed and default values */ def apply( ordinal: Ordinal, duration: Option[Long] ): RunStopped = { RunStopped(ordinal, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunStopped event with the passed parameters, passing None for duration, * None for formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * * @throws NullPointerException if any of the passed values are null * * @return a new RunStopped instance initialized with the passed and default values */ def apply( ordinal: Ordinal ): RunStopped = { RunStopped(ordinal, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the RunAborted event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on RunAborted objects. * This object contains methods that were in the RunAborted companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use RunAborted with named and/or default parameters instead.") object DeprecatedRunAborted { /** * Constructs a new RunAborted event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required by the run that has aborted * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the RunAborted event * * @throws NullPointerException if any of the passed values are null * * @return a new RunAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, throwable: Option[Throwable], duration: Option[Long], summary: Option[Summary], formatter: Option[Formatter], payload: Option[Any] ): RunAborted = { RunAborted(ordinal, message, throwable, duration, summary, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunAborted event with the passed parameters, passing None as the * payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required by the run that has aborted * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new RunAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, throwable: Option[Throwable], duration: Option[Long], summary: Option[Summary], formatter: Option[Formatter] ): RunAborted = { RunAborted(ordinal, message, throwable, duration, summary, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunAborted event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required by the run that has aborted * @param summary an optional summary of the number of tests that were reported as succeeded, failed, ignored, and pending * * @throws NullPointerException if any of the passed values are null * * @return a new RunAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, throwable: Option[Throwable], duration: Option[Long], summary: Option[Summary] ): RunAborted = { RunAborted(ordinal, message, throwable, duration, summary, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunAborted event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * @param duration an optional amount of time, in milliseconds, that was required by the run that has aborted * * @throws NullPointerException if any of the passed values are null * * @return a new RunAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, throwable: Option[Throwable], duration: Option[Long] ): RunAborted = { RunAborted(ordinal, message, throwable, duration, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new RunAborted event with the passed parameters, passing None for duration, * None for formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param throwable an optional Throwable that, if a Some, indicates why the suite has aborted, * or a Throwable created to capture stack trace information about the problem. * * @throws NullPointerException if any of the passed values are null * * @return a new RunAborted instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, throwable: Option[Throwable] ): RunAborted = { RunAborted(ordinal, message, throwable, None, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } } /** * Deprecated singleton object for the InfoProvided event, which contains overloaded factory methods * and an extractor method to facilitate pattern matching on InfoProvided objects. * This object contains methods that were in the InfoProvided companion object prior to ScalaTest 2.0. If you get a compiler error when upgrading * to 2.0 for one of the methods formerly in the companion object, a quick way to fix it is to put Deprecated in front of your call. * Eventually you will need to fix it properly, as this singleton object is deprecated and will be removed in a future version of ScalaTest, but * this will work as a quick fix to get you compiling again. * *

* All factory methods throw NullPointerException if any of the passed values are null. *

* * @author Bill Venners */ @deprecated("Use InfoProvided with named and/or default parameters instead.") object DeprecatedInfoProvided { /** * Constructs a new InfoProvided event with the passed parameters, passing the current thread's * name as threadname and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo an optional NameInfo that if defined, provides names for the suite and optionally the test * in the context of which the information was provided * @param aboutAPendingTest indicates whether the information being provided via this event is about a pending test * @param throwable an optional Throwable * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * @param payload an optional object that can be used to pass custom information to the reporter about the InfoProvided event * * @throws NullPointerException if any of the passed values are null * * @return a new InfoProvided instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, nameInfo: Option[NameInfo], aboutAPendingTest: Option[Boolean], throwable: Option[Throwable], formatter: Option[Formatter], payload: Option[Any] ): InfoProvided = { InfoProvided(ordinal, message, nameInfo, throwable, formatter, None, payload, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new InfoProvided event with the passed parameters, passing None as the * payload, the current threads name as threadname, * and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo an optional NameInfo that if defined, provides names for the suite and optionally the test * in the context of which the information was provided * @param throwable an optional Throwable * @param formatter an optional formatter that provides extra information that can be used by reporters in determining * how to present this event to the user * * @throws NullPointerException if any of the passed values are null * * @return a new InfoProvided instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, nameInfo: Option[NameInfo], throwable: Option[Throwable], formatter: Option[Formatter] ): InfoProvided = { InfoProvided(ordinal, message, nameInfo, throwable, formatter, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new InfoProvided event with the passed parameters, passing None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo an optional NameInfo that if defined, provides names for the suite and optionally the test * in the context of which the information was provided * @param throwable an optional Throwable * * @throws NullPointerException if any of the passed values are null * * @return a new InfoProvided instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, nameInfo: Option[NameInfo], throwable: Option[Throwable] ): InfoProvided = { InfoProvided(ordinal, message, nameInfo, throwable, None, None, None, Thread.currentThread.getName, (new Date).getTime) } /** * Constructs a new InfoProvided event with the passed parameters, passing None for * the throwable, None for * formatter, None as the payload, * the current threads name as threadname, and the current time as timeStamp. * * @param ordinal an Ordinal that can be used to place this event in order in the context of * other events reported during the same run * @param message a localized message suitable for presenting to the user * @param nameInfo an optional NameInfo that if defined, provides names for the suite and optionally the test * in the context of which the information was provided * @param throwable an optional Throwable * * @throws NullPointerException if any of the passed values are null * * @return a new InfoProvided instance initialized with the passed and default values */ def apply( ordinal: Ordinal, message: String, nameInfo: Option[NameInfo] ): InfoProvided = { InfoProvided(ordinal, message, nameInfo, None, None, None, None, Thread.currentThread.getName, (new Date).getTime) } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy