c

org.scalatest.events

NoteProvided

final case class NoteProvided(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 Event with NotificationEvent with Product with Serializable

Event used to provide notifications.

To create instances of this class you may use the factory method. For example, given a report function named report, you could fire a NoteProvided event like this:

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

NoteProvided differs from InfoProvided in that unlike InfoProvided, NoteProvided isn't a RecordableEvent. If fired because of a note call from a test, for example, the NoteProvided will immediately be sent to the reporters rather than being stored and sent in the recordedEvents field of the test completion event. Thus, NoteProvided enables "status notifications" to be provided while tests are happening. The difference between NoteProvided and AlertProvided, which is also a "status notification" fired immediately during tests, is that AlertProvided is intended for warnings, where as NoteProvided is just for information. As an illustration, AlertProvided messages are displayed in yellow, NoteProvided in green, in the stdout, stderr, and file reporters.

An NoteProvided event may be fired from anywhere. In this respect NoteProvided is different from 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 NoteProvided event should include a NameInfo in which testName is defined. If fired in the context of a suite, but not a test, the NoteProvided 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 NoteProvided event (an Option[NameInfo]) should be None.

ordinal

an Ordinal that can be used to place this event in order in the context of other events reported during the same run

message

a localized message suitable for presenting to the user

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

throwable

an optional Throwable

formatter

an optional Formatter that provides extra information that can be used by reporters in determining how to present this event to the user

location

An optional Location that provides information indicating where in the source code an event originated.

payload

an optional object that can be used to pass custom information to the reporter about the NoteProvided event

threadName

a name for the Thread about whose activity this event was reported

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

Source
Event.scala
Linear Supertypes
NotificationEvent, Event, Serializable, Serializable, Product, Equals, Ordered[Event], Comparable[Event], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NoteProvided
  2. NotificationEvent
  3. Event
  4. Serializable
  5. Serializable
  6. Product
  7. Equals
  8. Ordered
  9. Comparable
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NoteProvided(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)

    ordinal

    an Ordinal that can be used to place this event in order in the context of other events reported during the same run

    message

    a localized message suitable for presenting to the user

    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

    throwable

    an optional Throwable

    formatter

    an optional Formatter that provides extra information that can be used by reporters in determining how to present this event to the user

    location

    An optional Location that provides information indicating where in the source code an event originated.

    payload

    an optional object that can be used to pass custom information to the reporter about the NoteProvided event

    threadName

    a name for the Thread about whose activity this event was reported

    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

Value Members

  1. def <(that: Event): Boolean
    Definition Classes
    Ordered
  2. def <=(that: Event): Boolean
    Definition Classes
    Ordered
  3. def >(that: Event): Boolean
    Definition Classes
    Ordered
  4. def >=(that: Event): Boolean
    Definition Classes
    Ordered
  5. def compare(that: Event): Int

    Comparing this event with the event passed as that.

    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.

    that

    the event to compare to this event

    Definition Classes
    Event → Ordered
  6. def compareTo(that: Event): Int
    Definition Classes
    Ordered → Comparable
  7. val formatter: Option[Formatter]
    Definition Classes
    NoteProvidedEvent
  8. val location: Option[Location]
    Definition Classes
    NoteProvidedEvent
  9. val message: String
  10. val nameInfo: Option[NameInfo]
  11. val ordinal: Ordinal
    Definition Classes
    NoteProvidedEvent
  12. val payload: Option[Any]
    Definition Classes
    NoteProvidedEvent
  13. val threadName: String
    Definition Classes
    NoteProvidedEvent
  14. val throwable: Option[Throwable]
  15. val timeStamp: Long
    Definition Classes
    NoteProvidedEvent